langfuse_rs/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(
31		rename = "observationId",
32		default,
33		with = "::serde_with::rust::double_option",
34		skip_serializing_if = "Option::is_none"
35	)]
36	pub observation_id: Option<Option<String>>,
37	#[serde(rename = "timestamp")]
38	pub timestamp: String,
39	#[serde(rename = "createdAt")]
40	pub created_at: String,
41	#[serde(rename = "updatedAt")]
42	pub updated_at: String,
43	#[serde(
44		rename = "authorUserId",
45		default,
46		with = "::serde_with::rust::double_option",
47		skip_serializing_if = "Option::is_none"
48	)]
49	pub author_user_id: Option<Option<String>>,
50	#[serde(
51		rename = "comment",
52		default,
53		with = "::serde_with::rust::double_option",
54		skip_serializing_if = "Option::is_none"
55	)]
56	pub comment: Option<Option<String>>,
57	/// 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
58	#[serde(
59		rename = "configId",
60		default,
61		with = "::serde_with::rust::double_option",
62		skip_serializing_if = "Option::is_none"
63	)]
64	pub config_id: Option<Option<String>>,
65	/// Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue.
66	#[serde(
67		rename = "queueId",
68		default,
69		with = "::serde_with::rust::double_option",
70		skip_serializing_if = "Option::is_none"
71	)]
72	pub queue_id: Option<Option<String>>,
73}
74
75impl BooleanScore {
76	pub fn new(
77		value: f64,
78		string_value: String,
79		id: String,
80		trace_id: String,
81		name: String,
82		source: models::ScoreSource,
83		timestamp: String,
84		created_at: String,
85		updated_at: String,
86	) -> BooleanScore {
87		BooleanScore {
88			value,
89			string_value,
90			id,
91			trace_id,
92			name,
93			source,
94			observation_id: None,
95			timestamp,
96			created_at,
97			updated_at,
98			author_user_id: None,
99			comment: None,
100			config_id: None,
101			queue_id: None,
102		}
103	}
104}