@archastro/sdk
    Preparing search index...

    Interface AICompletionResult

    The result of an AI chat completion request. Returned by chat completion endpoints after the model finishes generating.

    interface AICompletionResult {
        finish_reason: string;
        message: AIMessage;
        messages: AIMessage[];
        token_usage?: Record<string, unknown>;
    }
    Index

    Properties

    finish_reason: string

    The reason the model stopped generating. Common values include "stop" (natural end), "length" (token limit reached), and "tool_calls" (the model invoked a tool).

    message: AIMessage

    The final assistant message produced by the completion.

    messages: AIMessage[]

    The complete message history for the conversation, including all user, assistant, and tool messages in order.

    token_usage?: Record<string, unknown>

    Token consumption breakdown keyed by model ID. Each value is a map with "input_tokens" and "output_tokens" counts. null when usage data is unavailable.