ChatMessage class
One turn in a chat conversation.
Constructors
- ChatMessage({required ChatRole role, required String content, String? toolCallId})
-
Build a chat turn.
const
- ChatMessage.assistant(String content)
-
Convenience constructor for an assistant turn.
const
- ChatMessage.system(String content)
-
Convenience constructor for a system turn.
const
- ChatMessage.user(String content)
-
Convenience constructor for a user turn.
const
Properties
- content → String
-
Turn text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- role → ChatRole
-
Who authored the turn.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toolCallId → String?
-
Identifier of the tool call this turn answers.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toProto(
) → ChatMessage - Build the generated chat message for this turn.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited