GenerateTextResult class

Result of generate_text (user-facing). Mirrors GenerateTextResult.ts.

Annotations
  • @JsonSerializable.new()

Constructors

GenerateTextResult({required String text, required List<ToolCall> toolCalls, required FinishReason finishReason, required Usage usage, List<Map<String, dynamic>> warnings = const [], required GenerateResult raw, List<Map<String, dynamic>> reasoning = const [], String reasoningText = '', List<Map<String, dynamic>> sources = const [], List<Map<String, dynamic>> files = const [], List<ModelMessage> responseMessages = const [], String? rawFinishReason, Map<String, dynamic>? providerMetadata, required ResponseMetadata response, required Usage totalUsage})
GenerateTextResult.fromJson(Map<String, dynamic> json)
factory

Properties

files List<Map<String, dynamic>>
final
finishReason FinishReason
final
hashCode int
The hash code for this object.
no setterinherited
providerMetadata Map<String, dynamic>?
Provider-specific metadata (e.g. Anthropic cache info). Mirrored from raw.provider_metadata for top-level convenience. Weak type.
final
raw GenerateResult
final
rawFinishReason String?
Raw provider-specific finish reason string (M12, e.g. "stop", "end_turn").
final
reasoning List<Map<String, dynamic>>
final
reasoningText String
final
response ResponseMetadata
Response metadata (id, timestamp, model_id). Mirrored from raw.response.
final
responseMessages List<ModelMessage>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sources List<Map<String, dynamic>>
final
text String
final
toolCalls List<ToolCall>
final
totalUsage Usage
Total token usage across all steps. In single-step mode (aimux's default), equals usage. Provided for AI SDK parity.
final
usage Usage
final
warnings List<Map<String, dynamic>>
final

Methods

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

Operators

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