An assistant message in a chat.

interface ChatsAssistantMessage {
    audio?: ChatsAssistantAudio;
    content?: string | ChatsTextContentPart[];
    function_call?: FunctionCall;
    name?: string;
    refusal?: string;
    role: "assistant";
    tool_calls?: ChatsToolCall[];
}

Properties

Data about a previous audio response from the model.

content?: string | ChatsTextContentPart[]

Content of an assistant message. Required unless tool_calls or function_call are specified.

function_call?: FunctionCall

The name and arguments of a function that should be called, as generated by the model.

Deprecated: function_call has been deprecated by OpenAI and replaced by tool_calls.

name?: string

Name for the participant. Provides the model information to differentiate between participants of the same role.

refusal?: string

Refusal message by the assistant.

role: "assistant"

Role of the messages author, in this case should always be "assistant".

tool_calls?: ChatsToolCall[]

Array of tool calls generated by the model, such as function calls.