pub struct MessageObject {Show 13 fields
pub id: String,
pub created_at: u64,
pub thread_id: String,
pub status: MessageObjectStatus,
pub incomplete_details: Option<MessageObjectIncompleteDetails>,
pub completed_at: Option<u64>,
pub incomplete_at: Option<u64>,
pub role: MessageObjectRole,
pub content: Vec<MessageContent>,
pub assistant_id: Option<String>,
pub run_id: Option<String>,
pub attachments: Option<Vec<MessageObjectAttachments>>,
pub metadata: Option<Metadata>,
}
Expand description
Represents a message within a thread.
Fields§
§id: String
The identifier, which can be referenced in API endpoints.
created_at: u64
The Unix timestamp (in seconds) for when the message was created.
thread_id: String
The thread ID that this message belongs to.
status: MessageObjectStatus
The status of the message, which can be either in_progress
, incomplete
, or completed
.
incomplete_details: Option<MessageObjectIncompleteDetails>
On an incomplete message, details about why the message is incomplete.
completed_at: Option<u64>
The Unix timestamp (in seconds) for when the message was completed.
incomplete_at: Option<u64>
The Unix timestamp (in seconds) for when the message was marked as incomplete.
role: MessageObjectRole
The entity that produced the message. One of user
or assistant
.
content: Vec<MessageContent>
The content of the message in array of text and/or images.
assistant_id: Option<String>
If applicable, the ID of the assistant that authored this message.
run_id: Option<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.
attachments: Option<Vec<MessageObjectAttachments>>
A list of files attached to the message, and the tools they were added to.
metadata: Option<Metadata>
Implementations§
Source§impl MessageObject
impl MessageObject
Sourcepub fn builder() -> MessageObjectBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> MessageObjectBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building MessageObject
.
On the builder, call .id(...)
, .created_at(...)
, .thread_id(...)
, .status(...)
, .incomplete_details(...)
(optional), .completed_at(...)
(optional), .incomplete_at(...)
(optional), .role(...)
, .content(...)
, .assistant_id(...)
(optional), .run_id(...)
(optional), .attachments(...)
(optional), .metadata(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of MessageObject
.
Trait Implementations§
Source§impl Clone for MessageObject
impl Clone for MessageObject
Source§fn clone(&self) -> MessageObject
fn clone(&self) -> MessageObject
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more