openai-client-base 0.12.0

Auto-generated Rust client for the OpenAI API
/*
 * OpenAI API
 *
 * The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
 *
 * The version of the OpenAPI document: 2.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// GraderMulti : A MultiGrader object combines the output of multiple graders to produce a single score.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct GraderMulti {
    /// The object type, which is always `multi`.
    #[serde(rename = "type")]
    pub r#type: Type,
    /// The name of the grader.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "graders")]
    pub graders: Box<models::GraderMultiGraders>,
    /// A formula to calculate the output based on grader results.
    #[serde(rename = "calculate_output")]
    pub calculate_output: String,
}

impl GraderMulti {
    /// A MultiGrader object combines the output of multiple graders to produce a single score.
    pub fn new(
        r#type: Type,
        name: String,
        graders: models::GraderMultiGraders,
        calculate_output: String,
    ) -> GraderMulti {
        GraderMulti {
            r#type,
            name,
            graders: Box::new(graders),
            calculate_output,
        }
    }
}
/// The object type, which is always `multi`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "multi")]
    Multi,
}

impl Default for Type {
    fn default() -> Type {
        Self::Multi
    }
}