langfuse_client/models/
prompt_one_of.rs

1/*
2 * langfuse
3 *
4 * ## Authentication  Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings:  - username: Langfuse Public Key - password: Langfuse Secret Key  ## Exports  - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
5 *
6 * The version of the OpenAPI document: 
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13#[cfg(not(feature = "ahash"))]
14use std::collections::HashMap;
15#[cfg(feature = "ahash")]
16use ahash::HashMap;
17
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19#[cfg_attr(feature="bon", derive(bon::Builder))]
20pub struct ChatPromptModel {
21    #[serde(rename = "prompt")]
22    pub prompt: Vec<models::ChatMessage>,
23    #[serde(rename = "name")]
24    pub name: String,
25    #[serde(rename = "version")]
26    pub version: i32,
27    #[serde(rename = "config", deserialize_with = "Option::deserialize")]
28    pub config: Option<serde_json::Value>,
29    /// List of deployment labels of this prompt version.
30    #[serde(rename = "labels")]
31    pub labels: Vec<String>,
32    /// List of tags. Used to filter via UI and API. The same across versions of a prompt.
33    #[serde(rename = "tags")]
34    pub tags: Vec<String>,
35    /// Commit message for this prompt version.
36    #[serde(rename = "commitMessage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub commit_message: Option<Option<String>>,
38    /// The dependency resolution graph for the current prompt. Null if prompt has no dependencies.
39    #[serde(rename = "resolutionGraph", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub resolution_graph: Option<Option<HashMap<String, serde_json::Value>>>,
41    #[serde(rename = "type")]
42    pub r#type: Type,
43}
44
45impl ChatPromptModel {
46    pub fn new(prompt: Vec<models::ChatMessage>, name: String, version: i32, config: Option<serde_json::Value>, labels: Vec<String>, tags: Vec<String>, r#type: Type) -> ChatPromptModel {
47        ChatPromptModel {
48            prompt,
49            name,
50            version,
51            config,
52            labels,
53            tags,
54            commit_message: None,
55            resolution_graph: None,
56            r#type,
57        }
58    }
59}
60/// 
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Type {
63    #[serde(rename = "chat")]
64    Chat,
65}
66
67impl Default for Type {
68    fn default() -> Type {
69        Self::Chat
70    }
71}
72