ChatMessage class

Annotations

Constructors

ChatMessage({required String id, required String content, required MessageRole role, required DateTime timestamp, bool isStreaming = false, Map<String, dynamic>? metadata})
const
ChatMessage.assistant({required String content, bool isStreaming = false, Map<String, dynamic>? metadata})
factory
ChatMessage.error({required String content, Map<String, dynamic>? metadata})
factory
ChatMessage.user({required String content, Map<String, dynamic>? metadata})
factory

Properties

content String
final
hashCode int
The hash code for this object.
no setteroverride
id String
final
isStreaming bool
final
metadata Map<String, dynamic>?
final
role MessageRole
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
final

Methods

copyWith({String? id, String? content, MessageRole? role, DateTime? timestamp, bool? isStreaming, Map<String, dynamic>? metadata}) ChatMessage
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.
override