mistral_openapi_client/models/
text_chunk.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct TextChunk {
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}
21
22impl TextChunk {
23 pub fn new(text: String) -> TextChunk {
24 TextChunk {
25 r#type: None,
26 text,
27 }
28 }
29}
30#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
32pub enum Type {
33 #[serde(rename = "text")]
34 Text,
35}
36
37impl Default for Type {
38 fn default() -> Type {
39 Self::Text
40 }
41}
42