langfuse-client-base 0.13.1

Auto-generated Langfuse API client from OpenAPI specification
Documentation
/*
 * 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};

/// UnstableCreateEvaluatorRequest : Request body for creating an evaluator.  If the same `name` already exists in your project, Langfuse creates the next version and returns it. Existing evaluation rules in the same project are then moved to that new latest version automatically.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UnstableCreateEvaluatorRequest {
    /// Evaluator name within the authenticated project.
    #[serde(rename = "name")]
    pub name: String,
    /// Prompt template used by the evaluator.
    #[serde(rename = "prompt")]
    pub prompt: String,
    #[serde(rename = "outputDefinition")]
    pub output_definition: Box<models::UnstableEvaluatorOutputDefinition>,
    #[serde(rename = "modelConfig", skip_serializing_if = "Option::is_none")]
    pub model_config: Option<Box<models::UnstableEvaluatorModelConfig>>,
}

impl UnstableCreateEvaluatorRequest {
    /// Request body for creating an evaluator.  If the same `name` already exists in your project, Langfuse creates the next version and returns it. Existing evaluation rules in the same project are then moved to that new latest version automatically.
    pub fn new(
        name: String,
        prompt: String,
        output_definition: models::UnstableEvaluatorOutputDefinition,
    ) -> UnstableCreateEvaluatorRequest {
        UnstableCreateEvaluatorRequest {
            name,
            prompt,
            output_definition: Box::new(output_definition),
            model_config: None,
        }
    }
}