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 - 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 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}
52
53impl CreateDatasetRunItemRequest {
54    pub fn new(run_name: String, dataset_item_id: String) -> CreateDatasetRunItemRequest {
55        CreateDatasetRunItemRequest {
56            run_name,
57            run_description: None,
58            metadata: None,
59            dataset_item_id,
60            observation_id: None,
61            trace_id: None,
62        }
63    }
64}