ChatMessage class

Annotations
  • @freezed

Constructors

ChatMessage({dynamic content, String? name, @Default(ChatMessageRole.system) ChatMessageRole role, List<MessageToolCall>? toolCalls, @Deprecated("Use toolCalls instead") dynamic functionCall, String? toolCallId})
const
factory
ChatMessage.assistant({required String content, String? name, List<MessageToolCall>? toolCalls, @Deprecated("replaced by tool_calls") dynamic functionCall})
factory
ChatMessage.fromJson(Map<String, Object?> json)
factory
ChatMessage.system({required String content, String? name})
factory
ChatMessage.tool({required String content, required String toolCallId, String? name})
factory
ChatMessage.user({required dynamic content, String? name})
factory

Properties

content → dynamic
The contents of the message. content is required for all messages except assistant messages with function calls.
no setterinherited
copyWith → $ChatMessageCopyWith<ChatMessage>
no setterinherited
functionCall → dynamic
The name and arguments of a function that should be called, as generated by the model.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
name String?
An optional name for the participant. Provides the model information to differentiate between participants of the same role.
no setterinherited
role ChatMessageRole
The role of the messages author. One of ChatMessageRole.system, ChatMessageRole.user, ChatMessageRole.assistant, or ChatMessageRole.tool
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toolCallId String?
Tool call that this message is responding to.
no setterinherited
toolCalls List<MessageToolCall>?
The tool calls generated by the model, such as function calls.
no setterinherited

Methods

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

Operators

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