windmill_api/models/eval_experiment.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/// EvalExperiment : One run of a dataset: written once when the dataset is run, and only ever read afterwards. The case set it executed is returned by the results endpoint, not here: a listing would otherwise send the whole dataset back once per experiment.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EvalExperiment {
17 #[serde(rename = "id")]
18 pub id: uuid::Uuid,
19 #[serde(rename = "dataset")]
20 pub dataset: String,
21 #[serde(rename = "subject")]
22 pub subject: Box<models::EvalSubject>,
23 /// This agent's nth run of this dataset, allocated once and never reused. What a run is called. Numbered per agent rather than per subject kind: runs of what is deployed and runs of its draft are the same agent's history.
24 #[serde(rename = "run_number")]
25 pub run_number: i32,
26 /// The flow executing the run: one job holding every case and its scores.
27 #[serde(rename = "run_job_id")]
28 pub run_job_id: uuid::Uuid,
29 #[serde(rename = "case_count")]
30 pub case_count: i32,
31 /// What the run scored, one entry per scorer that produced a number. Carried on the run itself so a list of runs can say what each one scored without reading every cell of every one of them. Empty on a run whose scores have not been read yet.
32 #[serde(rename = "scores", skip_serializing_if = "Option::is_none")]
33 pub scores: Option<Vec<models::ExperimentScore>>,
34 /// Whether the flow executing this run is still going. What makes a list of runs worth watching rather than worth reloading.
35 #[serde(rename = "running", skip_serializing_if = "Option::is_none")]
36 pub running: Option<bool>,
37 #[serde(rename = "created_at")]
38 pub created_at: String,
39 #[serde(rename = "created_by")]
40 pub created_by: String,
41}
42
43impl EvalExperiment {
44 /// One run of a dataset: written once when the dataset is run, and only ever read afterwards. The case set it executed is returned by the results endpoint, not here: a listing would otherwise send the whole dataset back once per experiment.
45 pub fn new(id: uuid::Uuid, dataset: String, subject: models::EvalSubject, run_number: i32, run_job_id: uuid::Uuid, case_count: i32, created_at: String, created_by: String) -> EvalExperiment {
46 EvalExperiment {
47 id,
48 dataset,
49 subject: Box::new(subject),
50 run_number,
51 run_job_id,
52 case_count,
53 scores: None,
54 running: None,
55 created_at,
56 created_by,
57 }
58 }
59}
60