langfuse_client/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 - 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 CreateDatasetRunItemRequest {
17    #[serde(rename = "runName")]
18    pub run_name: String,
19    /// Description of the run. If run exists, description will be updated.
20    #[serde(rename = "runDescription", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub run_description: Option<Option<String>>,
22    /// Metadata of the dataset run, updates run if run already exists
23    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub metadata: Option<Option<serde_json::Value>>,
25    #[serde(rename = "datasetItemId")]
26    pub dataset_item_id: String,
27    #[serde(rename = "observationId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub observation_id: Option<Option<String>>,
29    /// traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.
30    #[serde(rename = "traceId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub trace_id: Option<Option<String>>,
32}
33
34impl CreateDatasetRunItemRequest {
35    pub fn new(run_name: String, dataset_item_id: String) -> CreateDatasetRunItemRequest {
36        CreateDatasetRunItemRequest {
37            run_name,
38            run_description: None,
39            metadata: None,
40            dataset_item_id,
41            observation_id: None,
42            trace_id: None,
43        }
44    }
45}
46