langfuse_client_base/models/text_prompt.rs
1/*
2 * server
3 *
4 * ## Real-time data The only real-time path to get tracing data is to ingest via OpenTelemetry (`POST /api/public/otel/v1/traces`) and retrieve via Observations API v2 (`GET /api/public/v2/observations`) and Metrics API v2 (`GET /api/public/v2/metrics`). Other public API write and read endpoints can delay data by about 10 minutes. Direct OpenTelemetry exporters must send the `x-langfuse-ingestion-version: 4` header; current Python and JS SDKs already do. See the [Public API docs](https://langfuse.com/docs/api-and-data-platform/features/public-api) and [real-time ingestion](https://langfuse.com/integrations/native/opentelemetry.md#real-time-ingestion). ## 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 - Self-hosted deployments: interactive API reference at `/api/docs` and OpenAPI spec at `/api/openapi.yaml`
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 TextPrompt {
16 #[serde(rename = "name")]
17 pub name: String,
18 #[serde(rename = "version")]
19 pub version: i32,
20 #[serde(rename = "config", deserialize_with = "Option::deserialize")]
21 pub config: Option<serde_json::Value>,
22 /// List of deployment labels of this prompt version.
23 #[serde(rename = "labels")]
24 pub labels: Vec<String>,
25 /// List of tags. Used to filter via UI and API. The same across versions of a prompt.
26 #[serde(rename = "tags")]
27 pub tags: Vec<String>,
28 /// Commit message for this prompt version.
29 #[serde(
30 rename = "commitMessage",
31 default,
32 with = "::serde_with::rust::double_option",
33 skip_serializing_if = "Option::is_none"
34 )]
35 pub commit_message: Option<Option<String>>,
36 /// The dependency resolution graph for the current prompt. Null if the prompt has no dependencies or if `resolve=false` was used.
37 #[serde(
38 rename = "resolutionGraph",
39 default,
40 with = "::serde_with::rust::double_option",
41 skip_serializing_if = "Option::is_none"
42 )]
43 pub resolution_graph: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
44 #[serde(rename = "prompt")]
45 pub prompt: String,
46}
47
48impl TextPrompt {
49 pub fn new(
50 name: String,
51 version: i32,
52 config: Option<serde_json::Value>,
53 labels: Vec<String>,
54 tags: Vec<String>,
55 prompt: String,
56 ) -> TextPrompt {
57 TextPrompt {
58 name,
59 version,
60 config,
61 labels,
62 tags,
63 commit_message: None,
64 resolution_graph: None,
65 prompt,
66 }
67 }
68}