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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.798.1
* Contact: contact@windmill.dev
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExperimentRow {
#[serde(rename = "case_id")]
pub case_id: uuid::Uuid,
#[serde(rename = "input")]
pub input: Box<models::EvalCaseInput>,
#[serde(rename = "expected", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub expected: Option<Option<serde_json::Value>>,
/// The iteration that ran this case. Absent between a run being recorded and its flow reaching this case, which reads as a case still to run.
#[serde(rename = "job_id", skip_serializing_if = "Option::is_none")]
pub job_id: Option<uuid::Uuid>,
/// The case's status; `running` until its iteration completes, and `unavailable` for a case whose job was retained away before anything read what it produced.
#[serde(rename = "status")]
pub status: Status,
/// The agent's answer. The full trajectory stays reachable through job_id.
#[serde(rename = "output", skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
/// The agent version this cell ran against. Cells of one experiment can differ, which the table says rather than averaging two versions silently.
#[serde(rename = "subject_version", skip_serializing_if = "Option::is_none")]
pub subject_version: Option<i64>,
/// For a run of unsaved edits, the hash of the configuration this cell ran. Edits move without a version changing, so this is what identifies what ran, and what recognises a run whose edits were later saved as a run of that version.
#[serde(rename = "subject_draft_hash", skip_serializing_if = "Option::is_none")]
pub subject_draft_hash: Option<String>,
/// One entry per scorer of the dataset, in column order.
#[serde(rename = "scores")]
pub scores: Vec<models::CellScore>,
}
impl ExperimentRow {
pub fn new(case_id: uuid::Uuid, input: models::EvalCaseInput, status: Status, scores: Vec<models::CellScore>) -> ExperimentRow {
ExperimentRow {
case_id,
input: Box::new(input),
expected: None,
job_id: None,
status,
output: None,
subject_version: None,
subject_draft_hash: None,
scores,
}
}
}
/// The case's status; `running` until its iteration completes, and `unavailable` for a case whose job was retained away before anything read what it produced.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "running")]
Running,
#[serde(rename = "success")]
Success,
#[serde(rename = "failure")]
Failure,
#[serde(rename = "canceled")]
Canceled,
#[serde(rename = "skipped")]
Skipped,
#[serde(rename = "unavailable")]
Unavailable,
}
impl Default for Status {
fn default() -> Status {
Self::Running
}
}