langfuse_client/models/
score_one_of.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 ScoreOneOf {
17    /// The numeric value of the score
18    #[serde(rename = "value")]
19    pub value: f64,
20    #[serde(rename = "id")]
21    pub id: String,
22    #[serde(rename = "traceId")]
23    pub trace_id: String,
24    #[serde(rename = "name")]
25    pub name: String,
26    #[serde(rename = "source")]
27    pub source: models::ScoreSource,
28    #[serde(rename = "observationId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub observation_id: Option<Option<String>>,
30    #[serde(rename = "timestamp")]
31    pub timestamp: String,
32    #[serde(rename = "createdAt")]
33    pub created_at: String,
34    #[serde(rename = "updatedAt")]
35    pub updated_at: String,
36    #[serde(rename = "authorUserId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub author_user_id: Option<Option<String>>,
38    #[serde(rename = "comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub comment: Option<Option<String>>,
40    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub metadata: Option<Option<serde_json::Value>>,
42    /// Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range
43    #[serde(rename = "configId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub config_id: Option<Option<String>>,
45    /// Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue.
46    #[serde(rename = "queueId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47    pub queue_id: Option<Option<String>>,
48    /// The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
49    #[serde(rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub environment: Option<Option<String>>,
51    #[serde(rename = "dataType")]
52    pub data_type: DataType,
53}
54
55impl ScoreOneOf {
56    pub fn new(value: f64, id: String, trace_id: String, name: String, source: models::ScoreSource, timestamp: String, created_at: String, updated_at: String, data_type: DataType) -> ScoreOneOf {
57        ScoreOneOf {
58            value,
59            id,
60            trace_id,
61            name,
62            source,
63            observation_id: None,
64            timestamp,
65            created_at,
66            updated_at,
67            author_user_id: None,
68            comment: None,
69            metadata: None,
70            config_id: None,
71            queue_id: None,
72            environment: None,
73            data_type,
74        }
75    }
76}
77/// 
78#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum DataType {
80    #[serde(rename = "NUMERIC")]
81    Numeric,
82}
83
84impl Default for DataType {
85    fn default() -> DataType {
86        Self::Numeric
87    }
88}
89