1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* server
*
* ## 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`
*
* The version of the OpenAPI document:
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UnstableCreateLlmAsJudgeEvaluationRuleRequest {
/// Human-readable deployment name.
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "evaluator")]
pub evaluator: Box<models::UnstableLlmAsJudgeEvaluationRuleEvaluatorReference>,
#[serde(rename = "target")]
pub target: models::UnstableEvaluationRuleTarget,
/// Whether the deployment should be active immediately after creation.
#[serde(rename = "enabled")]
pub enabled: bool,
/// Optional sampling fraction. Defaults to `1`.
#[serde(
rename = "sampling",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub sampling: Option<Option<f64>>,
/// Optional filter list. Omit or pass an empty list to evaluate all matching targets for the selected `target`. Each filter object must use a column that is valid for that `target`. For `target=experiment`, `column=datasetId` expects dataset `id` values from `GET /api/public/v2/datasets`, not dataset names.
#[serde(
rename = "filter",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub filter: Option<Option<Vec<models::UnstableEvaluationRuleFilter>>>,
/// LLM-as-judge variable mappings. Every prompt variable must appear exactly once. Build this list from the evaluator's `variables` array.
#[serde(rename = "mapping")]
pub mapping: Vec<models::UnstablePromptVariableMappingInput>,
}
impl UnstableCreateLlmAsJudgeEvaluationRuleRequest {
pub fn new(
name: String,
evaluator: models::UnstableLlmAsJudgeEvaluationRuleEvaluatorReference,
target: models::UnstableEvaluationRuleTarget,
enabled: bool,
mapping: Vec<models::UnstablePromptVariableMappingInput>,
) -> UnstableCreateLlmAsJudgeEvaluationRuleRequest {
UnstableCreateLlmAsJudgeEvaluationRuleRequest {
name,
evaluator: Box::new(evaluator),
target,
enabled,
sampling: None,
filter: None,
mapping,
}
}
}