Message class abstract interface

A message in a conversation context.

Ported from pi's Message union (UserMessage | AssistantMessage | ToolResultMessage). An abstract interface rather than a sealed class because AssistantMessage predates this interface in this library and sealed subtypes must share a library.

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
role String
The role discriminator: user, assistant, or toolResult.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
When this message was created.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes to a JSON map with a role discriminator (pi shape).
toString() String
A string representation of this object.
inherited

Operators

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