langfuse_client/models/
text_prompt.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
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature="bon", derive(bon::Builder))]
16pub struct TextPrompt {
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    /// List of deployment labels of this prompt version.
26    #[serde(rename = "labels")]
27    pub labels: Vec<String>,
28    /// List of tags. Used to filter via UI and API. The same across versions of a prompt.
29    #[serde(rename = "tags")]
30    pub tags: Vec<String>,
31    /// Commit message for this prompt version.
32    #[serde(rename = "commitMessage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub commit_message: Option<Option<String>>,
34    /// The dependency resolution graph for the current prompt. Null if prompt has no dependencies.
35    #[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}
38
39impl TextPrompt {
40    pub fn new(prompt: String, name: String, version: i32, config: Option<serde_json::Value>, labels: Vec<String>, tags: Vec<String>) -> TextPrompt {
41        TextPrompt {
42            prompt,
43            name,
44            version,
45            config,
46            labels,
47            tags,
48            commit_message: None,
49            resolution_graph: None,
50        }
51    }
52}
53