Interface GenerateObjectResult<T>

The completed result returned by generateObject.

interface GenerateObjectResult<T> {
    object: T;
    text: string;
    usage: TokenUsage;
    finishReason: string;
    provider: string;
    model: string;
    fallback?: FallbackSignal;
}

Type Parameters

  • T

    The inferred type from the Zod schema, representing the validated object.

Properties

object: T

The parsed, Zod-validated object matching the provided schema.

text: string

The raw LLM output text before parsing.

usage: TokenUsage

Aggregated token usage across all attempts (including retries).

finishReason: string

Reason the model stopped generating on the final successful attempt. Mirrors the finish reasons from generateText.

provider: string

Provider identifier used for the run.

model: string

Resolved model identifier used for the run.

fallback?: FallbackSignal

Provider-fallback trail aggregated across all attempts. fired is true when any attempt used or tried a non-primary provider — including a fallback on a failed attempt that a later attempt recovered from on the primary. Callers use this to flag a degraded run.