langfuse_client_base/models/
prompt_meta.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, bon::Builder)]
15pub struct PromptMeta {
16    #[serde(rename = "name")]
17    pub name: String,
18    #[serde(rename = "type")]
19    pub r#type: models::PromptType,
20    #[serde(rename = "versions")]
21    pub versions: Vec<i32>,
22    #[serde(rename = "labels")]
23    pub labels: Vec<String>,
24    #[serde(rename = "tags")]
25    pub tags: Vec<String>,
26    #[serde(rename = "lastUpdatedAt")]
27    pub last_updated_at: String,
28    /// Config object of the most recent prompt version that matches the filters (if any are provided)
29    #[serde(rename = "lastConfig", deserialize_with = "Option::deserialize")]
30    pub last_config: Option<serde_json::Value>,
31}
32
33impl PromptMeta {
34    pub fn new(
35        name: String,
36        r#type: models::PromptType,
37        versions: Vec<i32>,
38        labels: Vec<String>,
39        tags: Vec<String>,
40        last_updated_at: String,
41        last_config: Option<serde_json::Value>,
42    ) -> PromptMeta {
43        PromptMeta {
44            name,
45            r#type,
46            versions,
47            labels,
48            tags,
49            last_updated_at,
50            last_config,
51        }
52    }
53}