langfuse_client/models/
prompt_one_of_1.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature="bon", derive(bon::Builder))]
16pub struct TextPromptModel {
17 #[serde(rename = "prompt")]
18 pub prompt: String,
19 #[serde(rename = "name")]
20 pub name: String,
21 #[serde(rename = "version")]
22 pub version: i32,
23 #[serde(rename = "config", deserialize_with = "Option::deserialize")]
24 pub config: Option<serde_json::Value>,
25 #[serde(rename = "labels")]
27 pub labels: Vec<String>,
28 #[serde(rename = "tags")]
30 pub tags: Vec<String>,
31 #[serde(rename = "commitMessage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33 pub commit_message: Option<Option<String>>,
34 #[serde(rename = "resolutionGraph", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36 pub resolution_graph: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
37 #[serde(rename = "type")]
38 pub r#type: Type,
39}
40
41impl TextPromptModel {
42 pub fn new(prompt: String, name: String, version: i32, config: Option<serde_json::Value>, labels: Vec<String>, tags: Vec<String>, r#type: Type) -> TextPromptModel {
43 TextPromptModel {
44 prompt,
45 name,
46 version,
47 config,
48 labels,
49 tags,
50 commit_message: None,
51 resolution_graph: None,
52 r#type,
53 }
54 }
55}
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Type {
59 #[serde(rename = "text")]
60 Text,
61}
62
63impl Default for Type {
64 fn default() -> Type {
65 Self::Text
66 }
67}
68