MessageObject class
Represents a message within a thread.
- Annotations
-
- @freezed
Constructors
-
MessageObject.new({required String id, required MessageObjectObject object, @JsonKey(name: 'created_at') required int createdAt, @JsonKey(name: 'thread_id') required String threadId, @JsonKey(unknownEnumValue: JsonKey.nullForUndefinedEnumValue) required MessageObjectStatus? status, @JsonKey(name: 'incomplete_details') required MessageObjectIncompleteDetails? incompleteDetails, @JsonKey(name: 'completed_at') required int? completedAt, @JsonKey(name: 'incomplete_at') required int? incompleteAt, required MessageRole role, required List<
MessageContent> content, @JsonKey(name: 'assistant_id') required String? assistantId, @JsonKey(name: 'run_id') required String? runId, required List<MessageAttachment> ? attachments, required Map<String, dynamic> ? metadata}) -
Factory constructor for MessageObject
constfactory
-
MessageObject.fromJson(Map<
String, dynamic> json) -
Object construction from a JSON representation
factory
Properties
- assistantId → String?
-
If applicable, the ID of the assistant that authored this message.
no setterinherited
-
attachments
→ List<
MessageAttachment> ? -
A list of files attached to the message, and the tools they were added to.
no setterinherited
- completedAt → int?
-
The Unix timestamp (in seconds) for when the message was completed.
no setterinherited
-
content
→ List<
MessageContent> -
The content of the message in array of text and/or images.
no setterinherited
-
copyWith
→ $MessageObjectCopyWith<
MessageObject> -
Create a copy of MessageObject
with the given fields replaced by the non-null parameter values.
no setterinherited
- createdAt → int
-
The Unix timestamp (in seconds) for when the message was created.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The identifier, which can be referenced in API endpoints.
no setterinherited
- incompleteAt → int?
-
The Unix timestamp (in seconds) for when the message was marked as incomplete.
no setterinherited
- incompleteDetails → MessageObjectIncompleteDetails?
-
On an incomplete message, details about why the message is incomplete.
no setterinherited
-
metadata
→ Map<
String, dynamic> ? -
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional
information about the object in a structured format. Keys can be a maximum of 64 characters long and values
can be a maximum of 512 characters long.
no setterinherited
- object → MessageObjectObject
-
The object type, which is always
thread.message
.no setterinherited - role → MessageRole
-
The entity that produced the message. One of
user
orassistant
.no setterinherited - runId → String?
-
The ID of the run associated with the creation of this message. Value is
null
when messages are created manually using the create message or create thread endpoints.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → MessageObjectStatus?
-
The status of the message, which can be either
in_progress
,incomplete
, orcompleted
.no setterinherited - threadId → String
-
The thread ID that this message belongs to.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this MessageObject to a JSON map.
inherited
-
toMap(
) → Map< String, dynamic> - Map representation of object (not serialized)
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
) → String? - Perform validations on the schema property values
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
propertyNames
→ const List<
String> - List of all property names of schema