Skip to main content

langfuse_client_base/models/
update_evaluation_rule_request.rs

1/*
2 * server
3 *
4 * ## Real-time data  The only real-time path to get tracing data is to ingest via OpenTelemetry (`POST /api/public/otel/v1/traces`) and retrieve via Observations API v2 (`GET /api/public/v2/observations`) and Metrics API v2 (`GET /api/public/v2/metrics`). Other public API write and read endpoints can delay data by about 10 minutes. Direct OpenTelemetry exporters must send the `x-langfuse-ingestion-version: 4` header; current Python and JS SDKs already do. See the [Public API docs](https://langfuse.com/docs/api-and-data-platform/features/public-api) and [real-time ingestion](https://langfuse.com/integrations/native/opentelemetry.md#real-time-ingestion).  ## 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 - Self-hosted deployments: interactive API reference at `/api/docs` and OpenAPI spec at `/api/openapi.yaml`
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/// UpdateEvaluationRuleRequest : At least one field must be provided.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
16pub struct UpdateEvaluationRuleRequest {
17    /// New human-readable rule 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    /// New desired live-execution state.
26    #[serde(
27        rename = "enabled",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub enabled: Option<Option<bool>>,
33    /// New fraction of matching observations to evaluate. Omit to keep the current value.
34    #[serde(
35        rename = "sampling",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub sampling: Option<Option<f64>>,
41    /// Complete replacement filter list. An empty list matches every incoming observation.
42    #[serde(
43        rename = "filter",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub filter: Option<Option<Vec<models::EvaluationRuleFilter>>>,
49    /// Complete replacement assignment list. An empty list disables the rule.
50    #[serde(
51        rename = "evaluatorAssignments",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub evaluator_assignments: Option<Option<Vec<models::EvaluationRuleEvaluatorAssignmentInput>>>,
57}
58
59impl UpdateEvaluationRuleRequest {
60    /// At least one field must be provided.
61    pub fn new() -> UpdateEvaluationRuleRequest {
62        UpdateEvaluationRuleRequest {
63            name: None,
64            enabled: None,
65            sampling: None,
66            filter: None,
67            evaluator_assignments: None,
68        }
69    }
70}