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
/*
* 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};
/// EvalSubject : What an eval run is executed against.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EvalSubject {
/// `agent` runs the ai_agent resource as it is deployed when the run opens, `agent_draft` the caller's unsaved edits of it as the editor holds them (carried in `draft`), and `agent_version` one past version named by `version`. The first and last are read server-side; all three are inlined into the run, so every case of a run executes one configuration: a deploy part-way through changes what the next run measures, never this one.
#[serde(rename = "kind")]
pub kind: Kind,
/// Path of the ai_agent resource.
#[serde(rename = "path")]
pub path: String,
/// The agent's per-path version number when the run opened: how many times the resource had been saved, not a resource_version row id. For `agent` and `agent_draft` it names the configuration the run read and every case executed. For `agent_version` it is the request's own, says which version to inline, and is required.
#[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub version: Option<Option<i64>>,
#[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
pub draft: Option<Box<models::AgentDraft>>,
/// Hash of the configuration a draft run executed, stamped server-side. A draft moves without the version moving, so this is what dates a run of one. It is also what recognises a draft run whose configuration was later deployed: when it matches the agent as deployed, the run's kind and version are rewritten to that version, once, and the hash is kept as what the resolution rests on.
#[serde(rename = "draft_hash", skip_serializing_if = "Option::is_none")]
pub draft_hash: Option<String>,
}
impl EvalSubject {
/// What an eval run is executed against.
pub fn new(kind: Kind, path: String) -> EvalSubject {
EvalSubject {
kind,
path,
version: None,
draft: None,
draft_hash: None,
}
}
}
/// `agent` runs the ai_agent resource as it is deployed when the run opens, `agent_draft` the caller's unsaved edits of it as the editor holds them (carried in `draft`), and `agent_version` one past version named by `version`. The first and last are read server-side; all three are inlined into the run, so every case of a run executes one configuration: a deploy part-way through changes what the next run measures, never this one.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
#[serde(rename = "agent")]
Agent,
#[serde(rename = "agent_draft")]
AgentDraft,
#[serde(rename = "agent_version")]
AgentVersion,
}
impl Default for Kind {
fn default() -> Kind {
Self::Agent
}
}