langfuse_client/models/
base_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#[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 BasePrompt {
21    #[serde(rename = "name")]
22    pub name: String,
23    #[serde(rename = "version")]
24    pub version: i32,
25    #[serde(rename = "config", deserialize_with = "Option::deserialize")]
26    pub config: Option<serde_json::Value>,
27    /// List of deployment labels of this prompt version.
28    #[serde(rename = "labels")]
29    pub labels: Vec<String>,
30    /// List of tags. Used to filter via UI and API. The same across versions of a prompt.
31    #[serde(rename = "tags")]
32    pub tags: Vec<String>,
33    /// Commit message for this prompt version.
34    #[serde(rename = "commitMessage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub commit_message: Option<Option<String>>,
36    /// The dependency resolution graph for the current prompt. Null if prompt has no dependencies.
37    #[serde(rename = "resolutionGraph", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub resolution_graph: Option<Option<HashMap<String, serde_json::Value>>>,
39}
40
41impl BasePrompt {
42    pub fn new(name: String, version: i32, config: Option<serde_json::Value>, labels: Vec<String>, tags: Vec<String>) -> BasePrompt {
43        BasePrompt {
44            name,
45            version,
46            config,
47            labels,
48            tags,
49            commit_message: None,
50            resolution_graph: None,
51        }
52    }
53}
54