1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.796.0
* Contact: contact@windmill.dev
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Scorer : A scorer is a column of the results table, and it is always a runnable: an ai_agent resource sent the run to grade, or a script handed the run as an argument. `id` is assigned when the scorer is added to a dataset and never reused: it is what makes a column the same column across experiments when the scorer is renamed, and a delta is only ever computed between two scores carrying the same id. A scorer sent without an id is given one.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Scorer {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Column header. Defaults to the last segment of the path.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// A score at or above this counts as a pass, and the column reports a pass rate beside its mean. Applied when results are read rather than when they are produced, so moving the line re-reads every score already recorded instead of invalidating them.
#[serde(rename = "pass_if", skip_serializing_if = "Option::is_none")]
pub pass_if: Option<f64>,
#[serde(rename = "kind")]
pub kind: Kind,
/// The script, or the ai_agent resource used as a judge.
#[serde(rename = "path")]
pub path: String,
}
impl Scorer {
/// A scorer is a column of the results table, and it is always a runnable: an ai_agent resource sent the run to grade, or a script handed the run as an argument. `id` is assigned when the scorer is added to a dataset and never reused: it is what makes a column the same column across experiments when the scorer is renamed, and a delta is only ever computed between two scores carrying the same id. A scorer sent without an id is given one.
pub fn new(kind: Kind, path: String) -> Scorer {
Scorer {
id: None,
name: None,
pass_if: None,
kind,
path,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
#[serde(rename = "script")]
Script,
#[serde(rename = "agent")]
Agent,
}
impl Default for Kind {
fn default() -> Kind {
Self::Script
}
}