ModelResponse

A complete model response, as a found lookup returns it: the output parts, why it stopped, token usage and the provider's request id.

Fields

contentreadonly OutputPart[]required

The output parts in order: text, tool calls, reasoning and hosted tool results.

stop_reasonModelResponseEvent.data.stop_reasonrequired

Only end_turn, stop_sequence and refusal complete a turn; tool_use dispatches; max_tokens continues; pause_turn re-requests with the paused content as-is, up to context.max_pause_continuations; context_window_exceeded ends the turn context_exhausted; other (a reason the adapter can't name) ends it error.

usageUsagerequired

Per-field measured-or-unknown usage.

provider_request_idNonEmpty | nullrequired

The provider's id for this request, or null when it gives none. A found model lookup must carry it, since model_response_recovered records it.

Edit on GitHub

On this page