langfuse_client/models/
boolean_score.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 BooleanScore {
17    /// The numeric value of the score. Equals 1 for \"True\" and 0 for \"False\"
18    #[serde(rename = "value")]
19    pub value: f64,
20    /// The string representation of the score value. Is inferred from the numeric value and equals \"True\" or \"False\"
21    #[serde(rename = "stringValue")]
22    pub string_value: String,
23    #[serde(rename = "id")]
24    pub id: String,
25    #[serde(rename = "traceId")]
26    pub trace_id: String,
27    #[serde(rename = "name")]
28    pub name: String,
29    #[serde(rename = "source")]
30    pub source: models::ScoreSource,
31    #[serde(rename = "observationId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub observation_id: Option<Option<String>>,
33    #[serde(rename = "timestamp")]
34    pub timestamp: String,
35    #[serde(rename = "createdAt")]
36    pub created_at: String,
37    #[serde(rename = "updatedAt")]
38    pub updated_at: String,
39    #[serde(rename = "authorUserId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub author_user_id: Option<Option<String>>,
41    #[serde(rename = "comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub comment: Option<Option<String>>,
43    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub metadata: Option<Option<serde_json::Value>>,
45    /// 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
46    #[serde(rename = "configId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47    pub config_id: Option<Option<String>>,
48    /// Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue.
49    #[serde(rename = "queueId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub queue_id: Option<Option<String>>,
51    /// The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
52    #[serde(rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
53    pub environment: Option<Option<String>>,
54}
55
56impl BooleanScore {
57    pub fn new(value: f64, string_value: String, id: String, trace_id: String, name: String, source: models::ScoreSource, timestamp: String, created_at: String, updated_at: String) -> BooleanScore {
58        BooleanScore {
59            value,
60            string_value,
61            id,
62            trace_id,
63            name,
64            source,
65            observation_id: None,
66            timestamp,
67            created_at,
68            updated_at,
69            author_user_id: None,
70            comment: None,
71            metadata: None,
72            config_id: None,
73            queue_id: None,
74            environment: None,
75        }
76    }
77}
78