ChatResultData: {
    choices: ChatResultChoice[];
    model?: string;
    usage?: ModelUsage;
}

A response returned from a chat model for a given chat completion request.

Type declaration

  • choices: ChatResultChoice[]

    A list of chat completion choices. Can be more than one if n is greater than 1.

  • Optional model?: string

    The API name of the model used to generate the response. Some AI providers may return this as undefined.

  • Optional usage?: ModelUsage

    The number of tokens used in the request and response. Some AI providers may return this as undefined.