PromptMessage class
A single message in a prompt result.
Messages have a role (user or assistant) and contain content (text, image, audio, or embedded resource).
Example:
PromptMessage(
role: PromptRole.user,
content: TextPromptContent('Analyze this code and suggest improvements.'),
)
Constructors
- PromptMessage({required PromptRole role, required PromptContent content})
-
Creates a prompt message.
const
Properties
- content → PromptContent
-
The content of the message.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- role → PromptRole
-
The role of the message sender.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited