Skip to content

AssistantMessageItem

type AssistantMessageItem = object;
content: (
| {
providerData: Record<string, any>;
refusal: string;
type: "refusal";
}
| {
providerData: Record<string, any>;
text: string;
type: "output_text";
}
| {
providerData: Record<string, any>;
text: string;
type: "input_text";
}
| {
audio: | string
| {
id: string;
};
format: null | string;
providerData: Record<string, any>;
transcript: null | string;
type: "audio";
}
| {
image: string;
providerData: Record<string, any>;
type: "image";
})[];

The content of the message.

optional id: string;

An ID to identify the item. This is optional by default. If a model provider absolutely requires this field, it will be validated on the model level.

optional providerData: Record<string, any>;

Additional optional provider specific data. Used for custom functionality or model provider specific fields.

role: "assistant";

Representing a message from the assistant (i.e. the model)

status: "in_progress" | "completed" | "incomplete";

The status of the message.

optional type: "message";

Any item without a type is treated as a message