ChatMessage class

One conversation turn.

Constructors

ChatMessage(ChatRole role, String content, {List<ToolCall> toolCalls = const [], List<ToolResult> toolResults = const []})
Creates a message.
const
ChatMessage.assistant(String content)
An assistant message.
const
ChatMessage.system(String content)
A system message.
const
ChatMessage.toolResults(List<ToolResult> toolResults)
A user turn carrying tool results; see Agent.
const
ChatMessage.user(String content)
A user message.
const

Properties

content → String
Text content.
final
hashCode → int
The hash code for this object.
no setteroverride
role → ChatRole
Author.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toolCalls → List<ToolCall>
Tools the model asked to run, on an assistant turn.
final
toolResults → List<ToolResult>
Results being handed back, on a user turn.
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.
override