/*
* langfuse
*
* ## 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
*
* The version of the OpenAPI document:
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// UnstableEvaluatorModelConfig : Optional explicit model configuration for an evaluator. If omitted, Langfuse uses the project's default evaluation model. If provided, the model must be available to the project when the evaluator or evaluation rule is enabled. To discover valid configured `provider` values for a project, call `GET /api/public/llm-connections` and read the `provider` field from the returned connections. Use a `provider` value that matches one of the connections already configured in the same project. Recovery guidance: - If evaluator creation returns `422` with `code=evaluator_preflight_failed`, either provide a valid explicit `modelConfig` here or configure the project's default evaluation model, then retry the same request.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UnstableEvaluatorModelConfig {
/// Provider identifier to use for this evaluator, for example `openai` or `anthropic`. To discover valid values for the current project, call `GET /api/public/llm-connections` and use one of the returned `provider` values.
#[serde(rename = "provider")]
pub provider: String,
/// Model identifier exposed by the provider, for example `gpt-4.1-mini`.
#[serde(rename = "model")]
pub model: String,
}
impl UnstableEvaluatorModelConfig {
/// Optional explicit model configuration for an evaluator. If omitted, Langfuse uses the project's default evaluation model. If provided, the model must be available to the project when the evaluator or evaluation rule is enabled. To discover valid configured `provider` values for a project, call `GET /api/public/llm-connections` and read the `provider` field from the returned connections. Use a `provider` value that matches one of the connections already configured in the same project. Recovery guidance: - If evaluator creation returns `422` with `code=evaluator_preflight_failed`, either provide a valid explicit `modelConfig` here or configure the project's default evaluation model, then retry the same request.
pub fn new(provider: String, model: String) -> UnstableEvaluatorModelConfig {
UnstableEvaluatorModelConfig { provider, model }
}
}