openai_struct/models/message_object.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub MessageObject : Represents a message within a [thread](/docs/api-reference/threads).
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16#[derive(Debug, Serialize, Deserialize)]
17pub struct MessageObject {
18 /// If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.
19 #[serde(rename = "assistant_id")]
20 pub assistant_id: String,
21 /// A list of files attached to the message, and the tools they were added to.
22 #[serde(rename = "attachments")]
23 pub attachments: Vec<crate::models::CreateMessageRequestAttachments>,
24 /// The Unix timestamp (in seconds) for when the message was completed.
25 #[serde(rename = "completed_at")]
26 pub completed_at: i32,
27 /// The content of the message in array of text and/or images.
28 #[serde(rename = "content")]
29 pub content: Vec<Value>,
30 /// The Unix timestamp (in seconds) for when the message was created.
31 #[serde(rename = "created_at")]
32 pub created_at: i32,
33 /// The identifier, which can be referenced in API endpoints.
34 #[serde(rename = "id")]
35 pub id: String,
36 /// The Unix timestamp (in seconds) for when the message was marked as incomplete.
37 #[serde(rename = "incomplete_at")]
38 pub incomplete_at: i32,
39 #[serde(rename = "incomplete_details")]
40 pub incomplete_details: crate::models::MessageObjectIncompleteDetails,
41 #[serde(rename = "metadata")]
42 pub metadata: crate::models::Metadata,
43 /// The object type, which is always `thread.message`.
44 #[serde(rename = "object")]
45 pub object: String,
46 /// The entity that produced the message. One of `user` or `assistant`.
47 #[serde(rename = "role")]
48 pub role: String,
49 /// The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.
50 #[serde(rename = "run_id")]
51 pub run_id: String,
52 /// The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.
53 #[serde(rename = "status")]
54 pub status: String,
55 /// The [thread](/docs/api-reference/threads) ID that this message belongs to.
56 #[serde(rename = "thread_id")]
57 pub thread_id: String,
58}