@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 {
        completions?: AICompletionProvenance[];
        finish_reason: string;
        message: AIMessage;
        messages: AIMessage[];
        response_model?: string;
        token_usage?: Record<string, unknown>;
    }
    Index

    Properties

    completions?: AICompletionProvenance[]

    Ordered accepted provider completions, including empty records for unknown identities.

    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.

    response_model?: string

    Final accepted completion provider-reported identity; absent when unknown.

    token_usage?: Record<string, unknown>

    Token consumption keyed by model ID. Each value has input (all prompt tokens, including cache reads and writes) and output counts. When reported, fresh_input, cache_read, and cache_creation are disjoint input buckets; missing cache counts remain unknown. null when usage data is unavailable.