Skip to content
Français

ModelResult

import type { ModelResult } from "@elie-laloum/outpost";
  • textRequired
    string
    Concatenated text blocks of the response; empty when the model only called tools.
  • contentOptional
    readonly ModelContentBlock[] | undefined
    Normalized response blocks in model order: text, tool calls and opaque reasoning to replay unchanged in later requests. Built-in providers always return it.
  • stopReasonOptional
    ModelStopReason | undefined
    Why the model stopped: end, tool-calls, max-tokens or refusal. A max-tokens result may contain truncated text or incomplete tool calls.
  • usageOptional
    Usage | undefined
    Token counts reported by the service, absent when it reports none. Missing cache details count as zero; Anthropic input includes cache reads and writes.
export interface ModelResult {
  readonly text: string;
  readonly content?: readonly ModelContentBlock[];
  readonly stopReason?: ModelStopReason;
  readonly usage?: Usage;
}