Skip to main content

langfuse_client_base/models/
create_dataset_run_item_request.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
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<String>>,
59}
60
61impl CreateDatasetRunItemRequest {
62    pub fn new(run_name: String, dataset_item_id: String) -> CreateDatasetRunItemRequest {
63        CreateDatasetRunItemRequest {
64            run_name,
65            run_description: None,
66            metadata: None,
67            dataset_item_id,
68            observation_id: None,
69            trace_id: None,
70            dataset_version: None,
71        }
72    }
73}