Skip to main content

windmill_api/models/
experiment_row.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.796.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ExperimentRow {
16    #[serde(rename = "case_id")]
17    pub case_id: uuid::Uuid,
18    #[serde(rename = "input")]
19    pub input: Box<models::EvalCaseInput>,
20    #[serde(rename = "expected", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub expected: Option<Option<serde_json::Value>>,
22    /// 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. 
23    #[serde(rename = "job_id", skip_serializing_if = "Option::is_none")]
24    pub job_id: Option<uuid::Uuid>,
25    /// 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. 
26    #[serde(rename = "status")]
27    pub status: Status,
28    /// The agent's answer. The full trajectory stays reachable through job_id.
29    #[serde(rename = "output", skip_serializing_if = "Option::is_none")]
30    pub output: Option<String>,
31    /// The agent version this cell ran against. Cells of one experiment can differ, which the table says rather than averaging two versions silently. 
32    #[serde(rename = "subject_version", skip_serializing_if = "Option::is_none")]
33    pub subject_version: Option<i64>,
34    /// 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. 
35    #[serde(rename = "subject_draft_hash", skip_serializing_if = "Option::is_none")]
36    pub subject_draft_hash: Option<String>,
37    /// One entry per scorer of the dataset, in column order.
38    #[serde(rename = "scores")]
39    pub scores: Vec<models::CellScore>,
40}
41
42impl ExperimentRow {
43    pub fn new(case_id: uuid::Uuid, input: models::EvalCaseInput, status: Status, scores: Vec<models::CellScore>) -> ExperimentRow {
44        ExperimentRow {
45            case_id,
46            input: Box::new(input),
47            expected: None,
48            job_id: None,
49            status,
50            output: None,
51            subject_version: None,
52            subject_draft_hash: None,
53            scores,
54        }
55    }
56}
57/// 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. 
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum Status {
60    #[serde(rename = "running")]
61    Running,
62    #[serde(rename = "success")]
63    Success,
64    #[serde(rename = "failure")]
65    Failure,
66    #[serde(rename = "canceled")]
67    Canceled,
68    #[serde(rename = "skipped")]
69    Skipped,
70    #[serde(rename = "unavailable")]
71    Unavailable,
72}
73
74impl Default for Status {
75    fn default() -> Status {
76        Self::Running
77    }
78}
79