Skip to main content

langfuse_client_base/models/
dataset_run_item.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 DatasetRunItem {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "datasetRunId")]
19    pub dataset_run_id: String,
20    #[serde(rename = "datasetRunName")]
21    pub dataset_run_name: String,
22    #[serde(rename = "datasetItemId")]
23    pub dataset_item_id: String,
24    #[serde(rename = "traceId")]
25    pub trace_id: String,
26    /// The observation ID associated with this run item
27    #[serde(
28        rename = "observationId",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub observation_id: Option<Option<String>>,
34    #[serde(rename = "createdAt")]
35    pub created_at: chrono::DateTime<chrono::FixedOffset>,
36    #[serde(rename = "updatedAt")]
37    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
38}
39
40impl DatasetRunItem {
41    pub fn new(
42        id: String,
43        dataset_run_id: String,
44        dataset_run_name: String,
45        dataset_item_id: String,
46        trace_id: String,
47        created_at: chrono::DateTime<chrono::FixedOffset>,
48        updated_at: chrono::DateTime<chrono::FixedOffset>,
49    ) -> DatasetRunItem {
50        DatasetRunItem {
51            id,
52            dataset_run_id,
53            dataset_run_name,
54            dataset_item_id,
55            trace_id,
56            observation_id: None,
57            created_at,
58            updated_at,
59        }
60    }
61}