Skip to main content

langfuse_client_base/models/
unstable_evaluation_rule_mapping_source.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/// UnstableEvaluationRuleMappingSource : Source field used to populate a prompt variable.  Use these values when mapping evaluator prompt variables to live data.  Target-specific rules: - `target=observation` supports `input`, `output`, and `metadata` - `target=experiment` supports `input`, `output`, `metadata`, and `expected_output`  Source semantics: - `input`: the observation or experiment input payload - `output`: the observation or experiment output payload - `metadata`: the metadata object for the target. Combine with `jsonPath` when you need one nested field instead of the whole object. - `expected_output`: the experiment item's expected output. Only valid for `target=experiment`.
15/// Source field used to populate a prompt variable.  Use these values when mapping evaluator prompt variables to live data.  Target-specific rules: - `target=observation` supports `input`, `output`, and `metadata` - `target=experiment` supports `input`, `output`, `metadata`, and `expected_output`  Source semantics: - `input`: the observation or experiment input payload - `output`: the observation or experiment output payload - `metadata`: the metadata object for the target. Combine with `jsonPath` when you need one nested field instead of the whole object. - `expected_output`: the experiment item's expected output. Only valid for `target=experiment`.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum UnstableEvaluationRuleMappingSource {
18    #[serde(rename = "input")]
19    Input,
20    #[serde(rename = "output")]
21    Output,
22    #[serde(rename = "metadata")]
23    Metadata,
24    #[serde(rename = "expected_output")]
25    ExpectedOutput,
26}
27
28impl std::fmt::Display for UnstableEvaluationRuleMappingSource {
29    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30        match self {
31            Self::Input => write!(f, "input"),
32            Self::Output => write!(f, "output"),
33            Self::Metadata => write!(f, "metadata"),
34            Self::ExpectedOutput => write!(f, "expected_output"),
35        }
36    }
37}
38
39impl Default for UnstableEvaluationRuleMappingSource {
40    fn default() -> UnstableEvaluationRuleMappingSource {
41        Self::Input
42    }
43}