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

    Interface ChatResponse

    What the Agents API answers a chat request with.

    Returned by chat(). The SDK has already added the answer to the transcript by the time you get it, so most applications render onNewMessage instead and use this only for the fields that never reach a Message. Expressive (V4) agents chat over the data channel rather than over the Agents API — except in ChatMode.Playground — so for them the object is empty and the answer arrives through the callback.

    interface ChatResponse {
        chatMode?: ChatMode;
        context?: string;
        documentIds?: string[];
        matches?: RetrievalMetadata[];
        result?: string;
        videoId?: string;
    }
    Index
    chatMode?: ChatMode

    The ChatMode the server handled the request in.

    It can differ from the mode that was asked for — see ChatMode.

    context?: string

    The retrieved context the answer was generated from.

    Copied onto the answer as context.

    documentIds?: string[]

    The Agents API's own list of ids for the documents behind the answer. The SDK never reads it; matches is what it keeps on the message.

    matches?: RetrievalMetadata[]

    The knowledge citations behind the answer.

    Copied onto the answer as matches.

    result?: string

    The agent's answer.

    Empty or absent when the answer is delivered as it is generated instead, which is what streaming modes do; the SDK then adds no message for it and the text arrives through onNewMessage.

    videoId?: string

    Id of the video generated for the answer, when the server reported one.