Skip to main content

printobserver_types/
assessment.rs

1//! What a supervision turn answers with.
2
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6/// How sure the agent is.
7///
8/// A closed vocabulary rather than a number, because a number invites a
9/// precision the agent does not have.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
11#[serde(rename_all = "snake_case", deny_unknown_fields)]
12pub enum Confidence {
13    /// Not sure.
14    Low,
15    /// Fairly sure.
16    Medium,
17    /// Sure.
18    High,
19}
20
21/// The agent's written record of one supervision turn.
22///
23/// This is deliberately not how the agent acts: acting is a
24/// [`PrintAction`](crate::PrintAction) that policy rules on.
25#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
26#[serde(deny_unknown_fields)]
27pub struct AgentAssessment {
28    /// One line saying what is happening.
29    pub summary: String,
30    /// How sure the agent is.
31    pub confidence: Confidence,
32    /// Whether the print should carry on.
33    pub should_continue: bool,
34    /// What the agent did.
35    pub did: String,
36    /// Why it did it.
37    pub why: String,
38    /// Whether the agent is escalating to a person.
39    pub escalating: bool,
40}