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