mistral_openapi_client/models/
output_content_chunks.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OutputContentChunks {
16 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
17 pub r#type: Option<Type>,
18 #[serde(rename = "text")]
19 pub text: String,
20 #[serde(rename = "image_url")]
21 pub image_url: Box<models::ImageUrl>,
22 #[serde(rename = "tool")]
23 pub tool: Box<models::Tool1>,
24 #[serde(rename = "file_id")]
25 pub file_id: String,
26 #[serde(rename = "file_name", skip_serializing_if = "Option::is_none")]
27 pub file_name: Option<String>,
28 #[serde(rename = "file_type", skip_serializing_if = "Option::is_none")]
29 pub file_type: Option<String>,
30 #[serde(rename = "document_url")]
31 pub document_url: String,
32 #[serde(rename = "document_name", skip_serializing_if = "Option::is_none")]
33 pub document_name: Option<String>,
34 #[serde(rename = "thinking")]
35 pub thinking: Vec<models::ThinkingInner>,
36 #[serde(rename = "closed", skip_serializing_if = "Option::is_none")]
38 pub closed: Option<bool>,
39 #[serde(rename = "title")]
40 pub title: String,
41 #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
42 pub url: Option<String>,
43 #[serde(rename = "favicon", skip_serializing_if = "Option::is_none")]
44 pub favicon: Option<String>,
45 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
46 pub description: Option<String>,
47}
48
49impl OutputContentChunks {
50 pub fn new(text: String, image_url: models::ImageUrl, tool: models::Tool1, file_id: String, document_url: String, thinking: Vec<models::ThinkingInner>, title: String) -> OutputContentChunks {
51 OutputContentChunks {
52 r#type: None,
53 text,
54 image_url: Box::new(image_url),
55 tool: Box::new(tool),
56 file_id,
57 file_name: None,
58 file_type: None,
59 document_url,
60 document_name: None,
61 thinking,
62 closed: None,
63 title,
64 url: None,
65 favicon: None,
66 description: None,
67 }
68 }
69}
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum Type {
73 #[serde(rename = "text")]
74 Text,
75 #[serde(rename = "image_url")]
76 ImageUrl,
77 #[serde(rename = "tool_file")]
78 ToolFile,
79 #[serde(rename = "document_url")]
80 DocumentUrl,
81 #[serde(rename = "thinking")]
82 Thinking,
83 #[serde(rename = "tool_reference")]
84 ToolReference,
85}
86
87impl Default for Type {
88 fn default() -> Type {
89 Self::Text
90 }
91}
92