ConversationRole class

The role of a message in a conversation.

Extends the standard roles (user, assistant, system, developer) with additional conversation-specific roles.

Annotations
  • @immutable

Constructors

ConversationRole.fromJson(String json)
Creates a ConversationRole from a JSON string.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String
The role value.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Converts this role to JSON.
toString() String
A string representation of this object.
override

Operators

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

Constants

assistant → const ConversationRole
An assistant message.
critic → const ConversationRole
A critic role (used in certain evaluation contexts).
developer → const ConversationRole
A developer message.
discriminator → const ConversationRole
A discriminator role (used in certain evaluation contexts).
system → const ConversationRole
A system message.
tool → const ConversationRole
A tool message.
unknown → const ConversationRole
An unknown role (for forward compatibility).
user → const ConversationRole
A user message.