D-ID Client SDK - v3.0.0-0
    Preparing search index...

    Interface Rating

    A rating stored against one message of a chat, as the Agents API returns it.

    Produced by rate() and returned again by deleteRate(). Keep id if the user may change their mind: pass it back to rate() as rateId to update the rating, or to deleteRate() to remove it.

    interface Rating {
        agent_id: string;
        chat_id: string;
        created_at: string;
        created_by: string;
        external_id: string;
        id: string;
        knowledge_id: string;
        matches: [string, string][];
        message_id: string;
        modified_at: string;
        owner_id: string;
        score: -1 | 1;
    }
    Index
    agent_id: string

    Id of the agent whose answer was rated.

    chat_id: string

    Id of the chat the rated message belongs to — the value onNewChat reported.

    created_at: string

    When the rating was created, as an ISO 8601 timestamp.

    created_by: string

    Identity the Agents API attributed the rating to. Set by the Agents API.

    external_id: string

    The end-user identifier the Agents API recorded for the request.

    Derived from the credentials the SDK sends, which carry externalId for type: 'key' authorization.

    id: string

    Id of this rating.

    Pass it as the rateId argument of rate() to update the rating, or to deleteRate() to remove it.

    knowledge_id: string

    Id of the agent's knowledge base (Agent.knowledge) at the time of the rating.

    An empty string when the agent has no knowledge base.

    matches: [string, string][]

    The knowledge citations that were attached to the rated answer, as [document_id, id] pairs.

    The SDK builds them from the matches of the rated message, so a negative rating can be traced back to the documents the answer was drawn from. Empty when the answer cited nothing.

    message_id: string

    Id of the message that was rated.

    modified_at: string

    When the rating was last changed, as an ISO 8601 timestamp.

    owner_id: string

    Id of the D-ID account that owns the agent the rating was left on. Set by the Agents API.

    score: -1 | 1

    The score itself: 1 for a positive rating, -1 for a negative one.