@archastro/sdk
    Preparing search index...

    Interface AIMessage

    A single message in an AI conversation, following the OpenAI-compatible chat format. Used in both request inputs and completion responses.

    interface AIMessage {
        content?: string;
        content_parts?: Record<string, unknown>[];
        resume_token?: string;
        role: string;
        structured_output?: unknown;
        tool_calls?: AIToolCall[];
        tool_results?: AIToolResult[];
    }
    Index

    Properties

    content?: string

    Plain-text content of the message. Present for system, user, and assistant messages. null when the message body is expressed through content_parts or tool_calls.

    content_parts?: Record<string, unknown>[]

    Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a type key ("text", "image_url", or "image_data"). null when content is set.

    resume_token?: string

    Opaque token that can be passed on a subsequent request to resume this conversation from the current state. null when the provider does not support conversation resumption.

    role: string

    The speaker role for this message. One of "system", "user", "assistant", or "tool".

    structured_output?: unknown

    Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. null when structured output was not requested.

    tool_calls?: AIToolCall[]

    Tool calls requested by the model in an assistant message. Present only on assistant messages that invoke one or more tools. null on all other message roles.

    tool_results?: AIToolResult[]

    Tool execution results provided in a tool message. Each entry corresponds to a prior tool call by its id. null on all other message roles.