InferenceResult class

The result of a completed inference request.

Available extensions

Constructors

InferenceResult({required String text, required double durationSecs, required String durationDisplay, required String finishReason, required List<ToolCallInfo> toolCalls})
const

Properties

durationDisplay → String
Human-readable duration string, e.g. "4.5s" or "2m 3.1s".
final
durationSecs → double
Wall-clock inference duration in seconds.
final
finishReason → String
Finish reason reported by the model, e.g. "stop" or "length".
final
hashCode → int
The hash code for this object.
no setteroverride
hasToolCalls → bool

Available on InferenceResult, provided by the InferenceResultToolsX extension

Returns true if the model requested one or more tool calls.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stoppedNaturally → bool

Available on InferenceResult, provided by the InferenceResultX extension

Returns true if generation stopped naturally (finish reason is "stop").
no setter
text → String
The generated assistant reply text.
final
toolCalls → List<ToolCallInfo>
Tool calls requested by the model (empty if none).
final
truncated → bool

Available on InferenceResult, provided by the InferenceResultX extension

Returns true if generation was truncated by the maxTokens limit.
no setter

Methods

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

Operators

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