Describes a single choice in a streamed chat response.

interface ChoiceModel {
    delta: { content?: string; role?: string };
    finishReason?: string;
    index: number;
}

Properties

delta: { content?: string; role?: string }

The delta object containing role and content updates for the choice.

Type declaration

  • Optionalcontent?: string

    The content of the message.

  • Optionalrole?: string

    The role of the message sender.

finishReason?: string

The reason why the response generation finished, if applicable.

index: number

The index of the choice in the response.