Skip to main content

langfuse_client_base/models/
code_evaluator_source_code_language.rs

1#![allow(deprecated)]
2/*
3 * server
4 *
5 * ## 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`
6 *
7 * The version of the OpenAPI document:
8 *
9 * Generated by: https://openapi-generator.tech
10 */
11
12use serde::{Deserialize, Serialize};
13
14/// CodeEvaluatorSourceCodeLanguage : Code evaluator runtime language.
15/// Code evaluator runtime language.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum CodeEvaluatorSourceCodeLanguage {
18    #[serde(rename = "PYTHON")]
19    Python,
20    #[serde(rename = "TYPESCRIPT")]
21    Typescript,
22
23    /// A value this client does not know. It is not kept: this serializes as `"unknown"`, which the API does not list.
24    #[serde(rename = "unknown", other)]
25    Unknown,
26}
27
28impl std::fmt::Display for CodeEvaluatorSourceCodeLanguage {
29    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30        match self {
31            Self::Python => write!(f, "PYTHON"),
32            Self::Typescript => write!(f, "TYPESCRIPT"),
33            Self::Unknown => write!(f, "unknown"),
34        }
35    }
36}
37
38impl crate::models::validation::Validate for CodeEvaluatorSourceCodeLanguage {
39    fn validate_into(
40        &self,
41        _path: &crate::models::validation::Path<'_>,
42        _errors: &mut Vec<crate::models::validation::ValidationError>,
43    ) {
44    }
45}
46
47impl ::std::str::FromStr for CodeEvaluatorSourceCodeLanguage {
48    type Err = crate::models::ParseEnumError;
49
50    fn from_str(value: &str) -> ::std::result::Result<Self, crate::models::ParseEnumError> {
51        match value {
52            "PYTHON" => Ok(Self::Python),
53            "TYPESCRIPT" => Ok(Self::Typescript),
54            _ => Err(crate::models::ParseEnumError::new(
55                "CodeEvaluatorSourceCodeLanguage",
56                value,
57            )),
58        }
59    }
60}
61
62impl ::std::convert::TryFrom<&str> for CodeEvaluatorSourceCodeLanguage {
63    type Error = crate::models::ParseEnumError;
64
65    fn try_from(value: &str) -> ::std::result::Result<Self, crate::models::ParseEnumError> {
66        value.parse()
67    }
68}
69
70impl ::std::convert::TryFrom<&::std::string::String> for CodeEvaluatorSourceCodeLanguage {
71    type Error = crate::models::ParseEnumError;
72
73    fn try_from(
74        value: &::std::string::String,
75    ) -> ::std::result::Result<Self, crate::models::ParseEnumError> {
76        value.parse()
77    }
78}
79
80impl ::std::convert::TryFrom<::std::string::String> for CodeEvaluatorSourceCodeLanguage {
81    type Error = crate::models::ParseEnumError;
82
83    fn try_from(
84        value: ::std::string::String,
85    ) -> ::std::result::Result<Self, crate::models::ParseEnumError> {
86        value.parse()
87    }
88}