objectiveai_sdk/agent/codex_sdk/
effort.rs1use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6#[derive(
12 Debug,
13 Clone,
14 Copy,
15 Default,
16 PartialEq,
17 Eq,
18 Hash,
19 Serialize,
20 Deserialize,
21 JsonSchema,
22 arbitrary::Arbitrary,
23)]
24#[schemars(rename = "agent.codex_sdk.Effort")]
25pub enum Effort {
26 #[schemars(title = "Minimal")]
28 #[serde(rename = "minimal")]
29 Minimal,
30 #[schemars(title = "Low")]
32 #[serde(rename = "low")]
33 Low,
34 #[schemars(title = "Medium")]
36 #[serde(rename = "medium")]
37 #[default]
38 Medium,
39 #[schemars(title = "High")]
41 #[serde(rename = "high")]
42 High,
43}
44
45impl Effort {
46 pub fn prepare(self) -> Option<Self> {
49 if let Effort::Medium = self {
50 None
51 } else {
52 Some(self)
53 }
54 }
55
56 pub fn validate(&self) -> Result<(), String> {
58 Ok(())
59 }
60
61 pub fn as_str(&self) -> &'static str {
63 match self {
64 Effort::Minimal => "minimal",
65 Effort::Low => "low",
66 Effort::Medium => "medium",
67 Effort::High => "high",
68 }
69 }
70}