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