ChatResponse class

A complete model response.

Constructors

ChatResponse(String text, {String? stopReason, String? model, ChatUsage? usage, List<ToolCall> toolCalls = const []})
Creates a response.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
model → String?
The model that produced the response (it can differ from the one requested, e.g. after a server-side fallback).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stopReason → String?
Why generation stopped (end_turn, max_tokens, stop, length, …), in the provider's vocabulary.
final
text → String
The generated text.
final
toolCalls → List<ToolCall>
Tools the model asked to run. Empty for a plain answer.
final
truncated → bool
Whether the output hit the token limit and is truncated.
no setter
usage → ChatUsage?
Token usage, when reported.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited