objectiveai_sdk/agent/
output_mode.rs1use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9
10#[derive(
18 Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Hash, JsonSchema,
19)]
20#[serde(rename_all = "snake_case")]
21#[schemars(rename = "agent.OutputMode")]
22pub enum OutputMode {
23 #[schemars(title = "Instruction")]
27 Instruction,
28 #[schemars(title = "JsonSchema")]
32 JsonSchema,
33 #[schemars(title = "ToolCall")]
37 ToolCall,
38}
39
40impl std::default::Default for OutputMode {
41 fn default() -> Self {
42 OutputMode::Instruction
43 }
44}
45
46impl From<super::openrouter::OutputMode> for OutputMode {
47 fn from(mode: super::openrouter::OutputMode) -> Self {
48 match mode {
49 super::openrouter::OutputMode::Instruction => {
50 OutputMode::Instruction
51 }
52 super::openrouter::OutputMode::JsonSchema => OutputMode::JsonSchema,
53 super::openrouter::OutputMode::ToolCall => OutputMode::ToolCall,
54 }
55 }
56}
57
58impl From<super::claude_agent_sdk::OutputMode> for OutputMode {
59 fn from(mode: super::claude_agent_sdk::OutputMode) -> Self {
60 match mode {
61 super::claude_agent_sdk::OutputMode::Instruction => {
62 OutputMode::Instruction
63 }
64 }
65 }
66}
67
68impl From<super::codex_sdk::OutputMode> for OutputMode {
69 fn from(mode: super::codex_sdk::OutputMode) -> Self {
70 match mode {
71 super::codex_sdk::OutputMode::Instruction => {
72 OutputMode::Instruction
73 }
74 }
75 }
76}
77
78impl From<super::mock::OutputMode> for OutputMode {
79 fn from(mode: super::mock::OutputMode) -> Self {
80 match mode {
81 super::mock::OutputMode::Instruction => OutputMode::Instruction,
82 super::mock::OutputMode::JsonSchema => OutputMode::JsonSchema,
83 super::mock::OutputMode::ToolCall => OutputMode::ToolCall,
84 }
85 }
86}