langfuse_client/models/
create_chat_prompt_request.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 CreateChatPromptRequest {
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "prompt")]
20    pub prompt: Vec<models::ChatMessage>,
21    #[serde(rename = "config", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub config: Option<Option<serde_json::Value>>,
23    /// List of deployment labels of this prompt version.
24    #[serde(rename = "labels", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub labels: Option<Option<Vec<String>>>,
26    /// List of tags to apply to all versions of this prompt.
27    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub tags: Option<Option<Vec<String>>>,
29    /// Commit message for this prompt version.
30    #[serde(rename = "commitMessage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub commit_message: Option<Option<String>>,
32}
33
34impl CreateChatPromptRequest {
35    pub fn new(name: String, prompt: Vec<models::ChatMessage>) -> CreateChatPromptRequest {
36        CreateChatPromptRequest {
37            name,
38            prompt,
39            config: None,
40            labels: None,
41            tags: None,
42            commit_message: None,
43        }
44    }
45}
46