langfuse_client_base/models/unstable_update_evaluation_rule_request.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
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/// UnstableUpdateEvaluationRuleRequest : Partial update body for an evaluation rule. Provide only the fields you want to change. An empty body is rejected. Practical guidance: - If you only want to rename the rule or change sampling, send just those fields. - If you change `evaluator`, send a fresh `mapping` unless you are certain the existing mapping still matches the evaluator variables. - If you change `target`, usually send both `filter` and `mapping` in the same request. - If you change an experiment `datasetId` filter, call `GET /api/public/v2/datasets` and use dataset `id` values from that response.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
16pub struct UnstableUpdateEvaluationRuleRequest {
17 /// Updated deployment name.
18 #[serde(
19 rename = "name",
20 default,
21 with = "::serde_with::rust::double_option",
22 skip_serializing_if = "Option::is_none"
23 )]
24 pub name: Option<Option<String>>,
25 #[serde(rename = "evaluator", skip_serializing_if = "Option::is_none")]
26 pub evaluator: Option<Box<models::UnstableEvaluationRuleEvaluatorReference>>,
27 #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
28 pub target: Option<models::UnstableEvaluationRuleTarget>,
29 /// Updated desired enabled state.
30 #[serde(
31 rename = "enabled",
32 default,
33 with = "::serde_with::rust::double_option",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub enabled: Option<Option<bool>>,
37 /// Updated sampling fraction.
38 #[serde(
39 rename = "sampling",
40 default,
41 with = "::serde_with::rust::double_option",
42 skip_serializing_if = "Option::is_none"
43 )]
44 pub sampling: Option<Option<f64>>,
45 /// Updated filter list. For `target=experiment`, `column=datasetId` expects dataset `id` values from `GET /api/public/v2/datasets`, not dataset names.
46 #[serde(
47 rename = "filter",
48 default,
49 with = "::serde_with::rust::double_option",
50 skip_serializing_if = "Option::is_none"
51 )]
52 pub filter: Option<Option<Vec<models::UnstableEvaluationRuleFilter>>>,
53 /// Updated variable mappings.
54 #[serde(
55 rename = "mapping",
56 default,
57 with = "::serde_with::rust::double_option",
58 skip_serializing_if = "Option::is_none"
59 )]
60 pub mapping: Option<Option<Vec<models::UnstableEvaluationRuleMapping>>>,
61}
62
63impl UnstableUpdateEvaluationRuleRequest {
64 /// Partial update body for an evaluation rule. Provide only the fields you want to change. An empty body is rejected. Practical guidance: - If you only want to rename the rule or change sampling, send just those fields. - If you change `evaluator`, send a fresh `mapping` unless you are certain the existing mapping still matches the evaluator variables. - If you change `target`, usually send both `filter` and `mapping` in the same request. - If you change an experiment `datasetId` filter, call `GET /api/public/v2/datasets` and use dataset `id` values from that response.
65 pub fn new() -> UnstableUpdateEvaluationRuleRequest {
66 UnstableUpdateEvaluationRuleRequest {
67 name: None,
68 evaluator: None,
69 target: None,
70 enabled: None,
71 sampling: None,
72 filter: None,
73 mapping: None,
74 }
75 }
76}