AiChatMessage class final

A single message in a chat conversation.

Annotations

Constructors

AiChatMessage({required AiRole role, required String content, List<AiToolCallRequest> toolCalls = const [], String? toolCallId})
const
AiChatMessage.assistant(String content)
factory
AiChatMessage.assistantWithToolCalls(List<AiToolCallRequest> toolCalls, {String content = ''})
An assistant message that invokes tools (OpenAI protocol shape). content carries any text the model produced alongside the calls.
factory
AiChatMessage.system(String content)
factory
AiChatMessage.toolResult({required String toolCallId, required String content})
A tool result answering a specific tool call.
factory
AiChatMessage.user(String content)
factory

Properties

content → String
final
hashCode → int
The hash code for this object.
no setterinherited
role → AiRole
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toolCallId → String?
For tool-role messages: the id of the tool call this result answers.
final
toolCalls → List<AiToolCallRequest>
For assistant messages that invoke tools: the parsed tool calls.
final

Methods

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

Operators

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