ThreadMessage class

A message to add to a thread during creation.

Annotations
  • @immutable

Constructors

ThreadMessage({required String role, required Object content, List<MessageAttachment>? attachments, Map<String, String>? metadata})
Creates a ThreadMessage.
const
ThreadMessage.assistant(Object content, {List<MessageAttachment>? attachments, Map<String, String>? metadata})
Creates an assistant message.
factory
ThreadMessage.fromJson(Map<String, dynamic> json)
Creates a ThreadMessage from JSON.
factory
ThreadMessage.user(Object content, {List<MessageAttachment>? attachments, Map<String, String>? metadata})
Creates a user message.
factory

Properties

attachments List<MessageAttachment>?
File attachments for this message.
final
content Object
The content of the message.
final
hashCode int
The hash code for this object.
no setteroverride
metadata Map<String, String>?
Custom metadata.
final
role String
The role of the message author.
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
toJson() Map<String, dynamic>
Converts to JSON.
toString() String
A string representation of this object.
override

Operators

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