langfuse_client_base/models/create_dataset_run_item_request.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 CreateDatasetRunItemRequest {
16 #[serde(rename = "runName")]
17 pub run_name: String,
18 /// Description of the run. If run exists, description will be updated.
19 #[serde(
20 rename = "runDescription",
21 default,
22 with = "::serde_with::rust::double_option",
23 skip_serializing_if = "Option::is_none"
24 )]
25 pub run_description: Option<Option<String>>,
26 /// Metadata of the dataset run, updates run if run already exists
27 #[serde(
28 rename = "metadata",
29 default,
30 with = "::serde_with::rust::double_option",
31 skip_serializing_if = "Option::is_none"
32 )]
33 pub metadata: Option<Option<serde_json::Value>>,
34 #[serde(rename = "datasetItemId")]
35 pub dataset_item_id: String,
36 #[serde(
37 rename = "observationId",
38 default,
39 with = "::serde_with::rust::double_option",
40 skip_serializing_if = "Option::is_none"
41 )]
42 pub observation_id: Option<Option<String>>,
43 /// traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.
44 #[serde(
45 rename = "traceId",
46 default,
47 with = "::serde_with::rust::double_option",
48 skip_serializing_if = "Option::is_none"
49 )]
50 pub trace_id: Option<Option<String>>,
51 /// ISO 8601 timestamp (RFC 3339, Section 5.6) in UTC (e.g., \"2026-01-21T14:35:42Z\"). Specifies the dataset version to use for this experiment run. If provided, the experiment will use dataset items as they existed at or before this timestamp. If not provided, uses the latest version of dataset items.
52 #[serde(
53 rename = "datasetVersion",
54 default,
55 with = "::serde_with::rust::double_option",
56 skip_serializing_if = "Option::is_none"
57 )]
58 pub dataset_version: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
59 /// Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp.
60 #[serde(
61 rename = "createdAt",
62 default,
63 with = "::serde_with::rust::double_option",
64 skip_serializing_if = "Option::is_none"
65 )]
66 pub created_at: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
67}
68
69impl CreateDatasetRunItemRequest {
70 pub fn new(run_name: String, dataset_item_id: String) -> CreateDatasetRunItemRequest {
71 CreateDatasetRunItemRequest {
72 run_name,
73 run_description: None,
74 metadata: None,
75 dataset_item_id,
76 observation_id: None,
77 trace_id: None,
78 dataset_version: None,
79 created_at: None,
80 }
81 }
82}