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