Skip to main content

langfuse_client_base/models/
dataset.rs

1/*
2 * server
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 Dataset {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "name")]
19    pub name: String,
20    /// Description of the dataset
21    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
22    pub description: Option<String>,
23    /// Metadata associated with the dataset
24    #[serde(rename = "metadata", deserialize_with = "Option::deserialize")]
25    pub metadata: Option<serde_json::Value>,
26    /// JSON Schema for validating dataset item inputs
27    #[serde(rename = "inputSchema", deserialize_with = "Option::deserialize")]
28    pub input_schema: Option<serde_json::Value>,
29    /// JSON Schema for validating dataset item expected outputs
30    #[serde(
31        rename = "expectedOutputSchema",
32        deserialize_with = "Option::deserialize"
33    )]
34    pub expected_output_schema: Option<serde_json::Value>,
35    #[serde(rename = "projectId")]
36    pub project_id: String,
37    #[serde(rename = "createdAt")]
38    pub created_at: chrono::DateTime<chrono::FixedOffset>,
39    #[serde(rename = "updatedAt")]
40    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
41}
42
43impl Dataset {
44    pub fn new(
45        id: String,
46        name: String,
47        description: Option<String>,
48        metadata: Option<serde_json::Value>,
49        input_schema: Option<serde_json::Value>,
50        expected_output_schema: Option<serde_json::Value>,
51        project_id: String,
52        created_at: chrono::DateTime<chrono::FixedOffset>,
53        updated_at: chrono::DateTime<chrono::FixedOffset>,
54    ) -> Dataset {
55        Dataset {
56            id,
57            name,
58            description,
59            metadata,
60            input_schema,
61            expected_output_schema,
62            project_id,
63            created_at,
64            updated_at,
65        }
66    }
67}