openai_struct/models/
eval_score_model_grader.rs

1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub EvalScoreModelGrader : A ScoreModelGrader object that uses a model to assign a score to the input.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16#[derive(Debug, Serialize, Deserialize)]
17pub struct EvalScoreModelGrader {
18    /// The input text. This may include template strings.
19    #[serde(rename = "input")]
20    pub input: Vec<crate::models::EvalItem>,
21    /// The model to use for the evaluation.
22    #[serde(rename = "model")]
23    pub model: String,
24    /// The name of the grader.
25    #[serde(rename = "name")]
26    pub name: String,
27    /// The threshold for the score.
28    #[serde(rename = "pass_threshold")]
29    pub pass_threshold: Option<f32>,
30    /// The range of the score. Defaults to `[0, 1]`.
31    #[serde(rename = "range")]
32    #[serde(default = "default_range")]
33    pub range: Option<Vec<f32>>,
34    /// The sampling parameters for the model.
35    #[serde(rename = "sampling_params")]
36    pub sampling_params: Option<Value>,
37    /// The object type, which is always `score_model`.
38    #[serde(rename = "type")]
39    #[serde(default = "default_type")]
40    pub _type: String,
41}
42
43fn default_type() -> String {
44    "score_model".into()
45}
46
47fn default_range() -> Option<Vec<f32>> {
48    Some(vec![0f32, 1f32])
49}