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