Skip to main content

gproxy_protocol/wire/openai/responses/
response.rs

1//! OpenAI Responses response, Create a model response.md:5768-14778.
2//! Nullable usage/user also follow the native created/in_progress examples at
3//! Create a model response.md:15512-15515 and Responses.md:33257-33260.
4use super::generate;
5use super::input::{self, present_nullable, present_optional, required_nullable};
6use super::tools;
7use crate::Rest;
8use serde::{Deserialize, Serialize};
9use std::collections::BTreeMap;
10
11pub type GenerateContentResponse = crate::WireResponse<GenerateContentResponseBody>;
12/// Returned instructions have the complete native input union, including history.
13pub type ResponseInstructions = input::Input;
14
15#[derive(
16    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
17)]
18#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
19#[derive(gproxy_protocol_macros::DeclaredFields)]
20#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
21pub struct GenerateContentResponseBody {
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub prompt_cache_diagnostics: Option<super::diagnostics::PromptCacheDiagnostics>,
24
25    pub id: String,
26    pub created_at: i64,
27    #[wire(required)]
28    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
29    #[serde(deserialize_with = "required_nullable")]
30    pub error: Option<ResponseError>,
31    #[wire(required)]
32    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
33    #[serde(deserialize_with = "required_nullable")]
34    pub incomplete_details: Option<ResponseIncompleteDetails>,
35    #[wire(required)]
36    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
37    #[serde(deserialize_with = "required_nullable")]
38    pub instructions: Option<ResponseInstructions>,
39    #[wire(required)]
40    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
41    #[serde(deserialize_with = "required_nullable")]
42    pub metadata: Option<BTreeMap<String, String>>,
43    pub model: String,
44    pub object: ResponseObject,
45    pub output: Vec<ResponseOutputItem>,
46    pub parallel_tool_calls: bool,
47    #[wire(required)]
48    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
49    #[serde(deserialize_with = "required_nullable")]
50    pub temperature: Option<serde_json::Number>,
51    pub tool_choice: input::ToolChoice,
52    pub tools: Vec<tools::Tool>,
53    #[wire(required)]
54    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
55    #[serde(deserialize_with = "required_nullable")]
56    pub top_p: Option<serde_json::Number>,
57    #[serde(
58        default,
59        deserialize_with = "present_nullable",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub background: Option<Option<bool>>,
63    #[serde(
64        default,
65        deserialize_with = "present_nullable",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub completed_at: Option<Option<i64>>,
69    #[serde(
70        default,
71        deserialize_with = "present_nullable",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub conversation: Option<Option<input::ResponseConversationParam>>,
75    #[serde(
76        default,
77        deserialize_with = "present_nullable",
78        skip_serializing_if = "Option::is_none"
79    )]
80    pub max_output_tokens: Option<Option<i64>>,
81    #[serde(
82        default,
83        deserialize_with = "present_nullable",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub max_tool_calls: Option<Option<i64>>,
87    #[serde(
88        default,
89        deserialize_with = "present_nullable",
90        skip_serializing_if = "Option::is_none"
91    )]
92    pub moderation: Option<Option<ResponseModerationReport>>,
93    #[serde(
94        default,
95        deserialize_with = "present_nullable",
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub output_text: Option<Option<String>>,
99    #[serde(
100        default,
101        deserialize_with = "present_nullable",
102        skip_serializing_if = "Option::is_none"
103    )]
104    pub previous_response_id: Option<Option<String>>,
105    #[serde(
106        default,
107        deserialize_with = "present_nullable",
108        skip_serializing_if = "Option::is_none"
109    )]
110    pub prompt: Option<Option<generate::ResponsePrompt>>,
111    #[serde(
112        default,
113        deserialize_with = "present_nullable",
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub prompt_cache_key: Option<Option<String>>,
117    #[serde(
118        default,
119        deserialize_with = "present_optional",
120        skip_serializing_if = "Option::is_none"
121    )]
122    pub prompt_cache_options: Option<ResponsePromptCacheOptions>,
123    #[serde(
124        default,
125        deserialize_with = "present_nullable",
126        skip_serializing_if = "Option::is_none"
127    )]
128    pub prompt_cache_retention: Option<Option<generate::PromptCacheRetention>>,
129    #[serde(
130        default,
131        deserialize_with = "present_nullable",
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub reasoning: Option<Option<input::ReasoningConfig>>,
135    #[serde(
136        default,
137        deserialize_with = "present_nullable",
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub safety_identifier: Option<Option<String>>,
141    #[serde(
142        default,
143        deserialize_with = "present_nullable",
144        skip_serializing_if = "Option::is_none"
145    )]
146    pub service_tier: Option<Option<generate::ServiceTier>>,
147    #[serde(
148        default,
149        deserialize_with = "present_optional",
150        skip_serializing_if = "Option::is_none"
151    )]
152    pub status: Option<ResponseStatus>,
153    #[serde(
154        default,
155        deserialize_with = "present_optional",
156        skip_serializing_if = "Option::is_none"
157    )]
158    pub text: Option<input::TextConfig>,
159    #[serde(
160        default,
161        deserialize_with = "present_nullable",
162        skip_serializing_if = "Option::is_none"
163    )]
164    pub top_logprobs: Option<Option<i64>>,
165    #[serde(
166        default,
167        deserialize_with = "present_nullable",
168        skip_serializing_if = "Option::is_none"
169    )]
170    pub truncation: Option<Option<generate::GenerateTruncation>>,
171    #[serde(
172        default,
173        deserialize_with = "present_nullable",
174        skip_serializing_if = "Option::is_none"
175    )]
176    pub usage: Option<Option<ResponseUsage>>,
177    #[serde(
178        default,
179        deserialize_with = "present_nullable",
180        skip_serializing_if = "Option::is_none"
181    )]
182    pub user: Option<Option<String>>,
183    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
184    pub rest: Rest,
185}
186
187#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
188#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
189#[derive(gproxy_protocol_macros::DeclaredFields)]
190#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
191pub enum ResponseObject {
192    #[serde(rename = "response")]
193    Response,
194}
195
196#[derive(
197    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
198)]
199#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
200#[derive(gproxy_protocol_macros::DeclaredFields)]
201#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
202pub struct ResponseError {
203    #[serde(skip_serializing_if = "Option::is_none")]
204    pub misalignment: Option<MisalignmentDetails>,
205
206    pub code: ResponseErrorCode,
207    pub message: String,
208    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
209    pub rest: Rest,
210}
211
212#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
213#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
214#[derive(gproxy_protocol_macros::DeclaredFields)]
215#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
216pub enum ResponseErrorCode {
217    #[serde(rename = "server_error")]
218    ServerError,
219    #[serde(rename = "rate_limit_exceeded")]
220    RateLimitExceeded,
221    #[serde(rename = "invalid_prompt")]
222    InvalidPrompt,
223    #[serde(rename = "data_residency_mismatch")]
224    DataResidencyMismatch,
225    #[serde(rename = "bio_policy")]
226    BioPolicy,
227    #[serde(rename = "vector_store_timeout")]
228    VectorStoreTimeout,
229    #[serde(rename = "invalid_image")]
230    InvalidImage,
231    #[serde(rename = "invalid_image_format")]
232    InvalidImageFormat,
233    #[serde(rename = "invalid_base64_image")]
234    InvalidBase64Image,
235    #[serde(rename = "invalid_image_url")]
236    InvalidImageUrl,
237    #[serde(rename = "image_too_large")]
238    ImageTooLarge,
239    #[serde(rename = "image_too_small")]
240    ImageTooSmall,
241    #[serde(rename = "image_parse_error")]
242    ImageParseError,
243    #[serde(rename = "image_content_policy_violation")]
244    ImageContentPolicyViolation,
245    #[serde(rename = "invalid_image_mode")]
246    InvalidImageMode,
247    #[serde(rename = "image_file_too_large")]
248    ImageFileTooLarge,
249    #[serde(rename = "unsupported_image_media_type")]
250    UnsupportedImageMediaType,
251    #[serde(rename = "empty_image_file")]
252    EmptyImageFile,
253    #[serde(rename = "failed_to_download_image")]
254    FailedToDownloadImage,
255    #[serde(rename = "image_file_not_found")]
256    ImageFileNotFound,
257}
258
259#[derive(
260    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
261)]
262#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
263#[derive(gproxy_protocol_macros::DeclaredFields)]
264#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
265pub struct ResponseIncompleteDetails {
266    #[serde(
267        default,
268        deserialize_with = "present_optional",
269        skip_serializing_if = "Option::is_none"
270    )]
271    pub reason: Option<ResponseIncompleteReason>,
272    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
273    pub rest: Rest,
274}
275
276#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
277#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
278#[derive(gproxy_protocol_macros::DeclaredFields)]
279#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
280pub enum ResponseIncompleteReason {
281    #[serde(rename = "max_messages")]
282    MaxMessages,
283    #[serde(rename = "steered")]
284    Steered,
285    #[serde(rename = "interrupted")]
286    Interrupted,
287    #[serde(rename = "max_output_tokens")]
288    MaxOutputTokens,
289    #[serde(rename = "content_filter")]
290    ContentFilter,
291}
292
293#[derive(
294    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
295)]
296#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
297#[derive(gproxy_protocol_macros::DeclaredFields)]
298#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
299pub struct ResponsePromptCacheOptions {
300    #[serde(
301        default,
302        deserialize_with = "present_nullable",
303        skip_serializing_if = "Option::is_none"
304    )]
305    pub comparison_response_id: Option<Option<String>>,
306
307    pub mode: generate::PromptCachingMode,
308    pub ttl: generate::PromptCacheTtl,
309    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
310    pub rest: Rest,
311}
312
313#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
314#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
315#[derive(gproxy_protocol_macros::DeclaredFields)]
316#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
317pub enum ResponseStatus {
318    #[serde(rename = "completed")]
319    Completed,
320    #[serde(rename = "failed")]
321    Failed,
322    #[serde(rename = "in_progress")]
323    InProgress,
324    #[serde(rename = "cancelled")]
325    Cancelled,
326    #[serde(rename = "queued")]
327    Queued,
328    #[serde(rename = "incomplete")]
329    Incomplete,
330}
331
332#[derive(
333    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
334)]
335#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
336#[derive(gproxy_protocol_macros::DeclaredFields)]
337#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
338pub struct ResponseModerationReport {
339    pub input: ResponseModerationOutcome,
340    pub output: ResponseModerationOutcome,
341    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
342    pub rest: Rest,
343}
344
345#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
346#[serde(untagged)]
347#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
348#[derive(gproxy_protocol_macros::DeclaredFields)]
349#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
350pub enum ResponseModerationOutcome {
351    Result(ResponseModerationResult),
352    Error(ResponseModerationError),
353}
354
355#[derive(
356    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
357)]
358#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
359#[derive(gproxy_protocol_macros::DeclaredFields)]
360#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
361pub struct ResponseModerationResult {
362    pub categories: BTreeMap<String, bool>,
363    pub category_applied_input_types: BTreeMap<String, Vec<ResponseModerationInputType>>,
364    pub category_scores: BTreeMap<String, serde_json::Number>,
365    pub flagged: bool,
366    pub model: String,
367    #[serde(rename = "type")]
368    pub type_: ResponseModerationResultType,
369    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
370    pub rest: Rest,
371}
372
373#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
374#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
375#[derive(gproxy_protocol_macros::DeclaredFields)]
376#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
377pub enum ResponseModerationInputType {
378    #[serde(rename = "text")]
379    Text,
380    #[serde(rename = "image")]
381    Image,
382}
383
384#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
385#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
386#[derive(gproxy_protocol_macros::DeclaredFields)]
387#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
388pub enum ResponseModerationResultType {
389    #[serde(rename = "moderation_result")]
390    ModerationResult,
391}
392
393#[derive(
394    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
395)]
396#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
397#[derive(gproxy_protocol_macros::DeclaredFields)]
398#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
399pub struct ResponseModerationError {
400    pub code: String,
401    pub message: String,
402    #[serde(rename = "type")]
403    pub type_: ResponseModerationErrorType,
404    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
405    pub rest: Rest,
406}
407
408#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
409#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
410#[derive(gproxy_protocol_macros::DeclaredFields)]
411#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
412pub enum ResponseModerationErrorType {
413    #[serde(rename = "error")]
414    Error,
415}
416
417#[derive(
418    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
419)]
420#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
421#[derive(gproxy_protocol_macros::DeclaredFields)]
422#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
423pub struct ResponseUsage {
424    pub input_tokens: i64,
425    pub input_tokens_details: ResponseInputTokensDetails,
426    pub output_tokens: i64,
427    pub output_tokens_details: ResponseOutputTokensDetails,
428    pub total_tokens: i64,
429    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
430    pub rest: Rest,
431}
432
433#[derive(
434    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
435)]
436#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
437#[derive(gproxy_protocol_macros::DeclaredFields)]
438#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
439pub struct ResponseInputTokensDetails {
440    pub cache_write_tokens: i64,
441    pub cached_tokens: i64,
442    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
443    pub rest: Rest,
444}
445
446#[derive(
447    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
448)]
449#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
450#[derive(gproxy_protocol_macros::DeclaredFields)]
451#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
452pub struct ResponseOutputTokensDetails {
453    pub reasoning_tokens: i64,
454    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
455    pub rest: Rest,
456}
457
458/// Native output items; input-only messages/references/triggers are excluded.
459/// Same-shape items are reused; response-specific required fields use separate structs.
460#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
461#[serde(untagged)]
462#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
463#[derive(gproxy_protocol_macros::DeclaredFields)]
464#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
465pub enum ResponseOutputItem {
466    MultiAgentCall(super::multi_agent::ResponseMultiAgentCall),
467    MultiAgentCallOutput(super::multi_agent::ResponseMultiAgentCallOutput),
468    AgentMessage(super::multi_agent::ResponseAgentMessage),
469    ConfigurationUpdate(input::ConfigurationUpdate),
470    Message(input::ResponseOutputMessage),
471    FileSearchCall(input::FileSearchCall),
472    FunctionCall(input::FunctionCall),
473    FunctionCallOutput(ResponseFunctionCallOutput),
474    WebSearchCall(input::WebSearchCall),
475    ComputerCall(input::ComputerCall),
476    ComputerCallOutput(ResponseComputerCallOutput),
477    Reasoning(input::ReasoningItem),
478    Program(input::Program),
479    ProgramOutput(input::ProgramOutput),
480    ToolSearchCall(ResponseToolSearchCall),
481    ToolSearchOutput(ResponseToolSearchOutput),
482    AdditionalTools(ResponseAdditionalTools),
483    Compaction(ResponseCompaction),
484    ImageGenerationCall(input::ImageGenerationCall),
485    CodeInterpreterCall(input::CodeInterpreterCall),
486    LocalShellCall(input::LocalShellCall),
487    LocalShellCallOutput(input::LocalShellCallOutput),
488    ShellCall(ResponseShellCall),
489    ShellCallOutput(ResponseShellCallOutput),
490    ApplyPatchCall(ResponseApplyPatchCall),
491    ApplyPatchCallOutput(ResponseApplyPatchCallOutput),
492    McpCall(input::McpCall),
493    McpListTools(input::McpListTools),
494    McpApprovalRequest(input::McpApprovalRequest),
495    McpApprovalResponse(ResponseMcpApprovalResponse),
496    CustomToolCall(input::CustomToolCall),
497    CustomToolCallOutput(ResponseCustomToolCallOutput),
498}
499
500#[derive(
501    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
502)]
503#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
504#[derive(gproxy_protocol_macros::DeclaredFields)]
505#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
506pub struct ResponseFunctionCallOutput {
507    #[serde(
508        default,
509        deserialize_with = "super::input::present_nullable",
510        skip_serializing_if = "Option::is_none"
511    )]
512    pub agent: Option<Option<super::multi_agent::Agent>>,
513    pub id: String,
514    pub call_id: String,
515    pub output: input::CustomOutput,
516    pub status: input::ItemStatus,
517    #[serde(rename = "type")]
518    pub type_: input::FunctionCallOutputType,
519    #[serde(
520        default,
521        deserialize_with = "present_nullable",
522        skip_serializing_if = "Option::is_none"
523    )]
524    pub caller: Option<Option<input::Caller>>,
525    #[serde(
526        default,
527        deserialize_with = "present_optional",
528        skip_serializing_if = "Option::is_none"
529    )]
530    pub created_by: Option<String>,
531    #[serde(
532        default,
533        deserialize_with = "present_optional",
534        skip_serializing_if = "Option::is_none"
535    )]
536    pub name: Option<String>,
537    #[serde(
538        default,
539        deserialize_with = "present_optional",
540        skip_serializing_if = "Option::is_none"
541    )]
542    pub namespace: Option<String>,
543    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
544    pub rest: Rest,
545}
546
547#[derive(
548    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
549)]
550#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
551#[derive(gproxy_protocol_macros::DeclaredFields)]
552#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
553pub struct ResponseComputerCallOutput {
554    #[serde(
555        default,
556        deserialize_with = "super::input::present_nullable",
557        skip_serializing_if = "Option::is_none"
558    )]
559    pub agent: Option<Option<super::multi_agent::Agent>>,
560    pub id: String,
561    pub call_id: String,
562    pub output: input::ComputerScreenshot,
563    pub status: ResponseComputerOutputStatus,
564    #[serde(rename = "type")]
565    pub type_: input::ComputerCallOutputType,
566    #[serde(
567        default,
568        deserialize_with = "present_optional",
569        skip_serializing_if = "Option::is_none"
570    )]
571    pub acknowledged_safety_checks: Option<Vec<input::PendingSafetyCheck>>,
572    #[serde(
573        default,
574        deserialize_with = "present_optional",
575        skip_serializing_if = "Option::is_none"
576    )]
577    pub created_by: Option<String>,
578    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
579    pub rest: Rest,
580}
581
582#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
583#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
584#[derive(gproxy_protocol_macros::DeclaredFields)]
585#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
586pub enum ResponseComputerOutputStatus {
587    #[serde(rename = "completed")]
588    Completed,
589    #[serde(rename = "incomplete")]
590    Incomplete,
591    #[serde(rename = "failed")]
592    Failed,
593    #[serde(rename = "in_progress")]
594    InProgress,
595}
596
597#[derive(
598    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
599)]
600#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
601#[derive(gproxy_protocol_macros::DeclaredFields)]
602#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
603pub struct ResponseToolSearchCall {
604    #[serde(
605        default,
606        deserialize_with = "super::input::present_nullable",
607        skip_serializing_if = "Option::is_none"
608    )]
609    pub agent: Option<Option<super::multi_agent::Agent>>,
610    pub id: String,
611    // Source line 10675 explicitly permits unknown (arbitrary JSON) arguments.
612    pub arguments: serde_json::Value,
613    #[wire(required)]
614    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
615    #[serde(deserialize_with = "required_nullable")]
616    pub call_id: Option<String>,
617    pub execution: tools::ToolExecution,
618    pub status: input::ItemStatus,
619    #[serde(rename = "type")]
620    pub type_: input::ToolSearchCallType,
621    #[serde(
622        default,
623        deserialize_with = "present_optional",
624        skip_serializing_if = "Option::is_none"
625    )]
626    pub created_by: Option<String>,
627    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
628    pub rest: Rest,
629}
630
631#[derive(
632    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
633)]
634#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
635#[derive(gproxy_protocol_macros::DeclaredFields)]
636#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
637pub struct ResponseToolSearchOutput {
638    #[serde(
639        default,
640        deserialize_with = "super::input::present_nullable",
641        skip_serializing_if = "Option::is_none"
642    )]
643    pub agent: Option<Option<super::multi_agent::Agent>>,
644    pub id: String,
645    #[wire(required)]
646    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
647    #[serde(deserialize_with = "required_nullable")]
648    pub call_id: Option<String>,
649    pub execution: tools::ToolExecution,
650    pub status: input::ItemStatus,
651    pub tools: Vec<tools::Tool>,
652    #[serde(rename = "type")]
653    pub type_: input::ToolSearchOutputType,
654    #[serde(
655        default,
656        deserialize_with = "present_optional",
657        skip_serializing_if = "Option::is_none"
658    )]
659    pub created_by: Option<String>,
660    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
661    pub rest: Rest,
662}
663
664#[derive(
665    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
666)]
667#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
668#[derive(gproxy_protocol_macros::DeclaredFields)]
669#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
670pub struct ResponseAdditionalTools {
671    #[serde(
672        default,
673        deserialize_with = "super::input::present_nullable",
674        skip_serializing_if = "Option::is_none"
675    )]
676    pub agent: Option<Option<super::multi_agent::Agent>>,
677    pub id: String,
678    pub role: ResponseAdditionalToolsRole,
679    pub tools: Vec<tools::Tool>,
680    #[serde(rename = "type")]
681    pub type_: input::AdditionalToolsType,
682    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
683    pub rest: Rest,
684}
685
686#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
687#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
688#[derive(gproxy_protocol_macros::DeclaredFields)]
689#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
690pub enum ResponseAdditionalToolsRole {
691    #[serde(rename = "unknown")]
692    Unknown,
693    #[serde(rename = "user")]
694    User,
695    #[serde(rename = "assistant")]
696    Assistant,
697    #[serde(rename = "system")]
698    System,
699    #[serde(rename = "critic")]
700    Critic,
701    #[serde(rename = "discriminator")]
702    Discriminator,
703    #[serde(rename = "developer")]
704    Developer,
705    #[serde(rename = "tool")]
706    Tool,
707}
708
709#[derive(
710    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
711)]
712#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
713#[derive(gproxy_protocol_macros::DeclaredFields)]
714#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
715pub struct ResponseCompaction {
716    #[serde(
717        default,
718        deserialize_with = "super::input::present_nullable",
719        skip_serializing_if = "Option::is_none"
720    )]
721    pub agent: Option<Option<super::multi_agent::Agent>>,
722    pub id: String,
723    pub encrypted_content: String,
724    #[serde(rename = "type")]
725    pub type_: input::CompactionType,
726    #[serde(
727        default,
728        deserialize_with = "present_optional",
729        skip_serializing_if = "Option::is_none"
730    )]
731    pub created_by: Option<String>,
732    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
733    pub rest: Rest,
734}
735
736#[derive(
737    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
738)]
739#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
740#[derive(gproxy_protocol_macros::DeclaredFields)]
741#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
742pub struct ResponseShellCall {
743    #[serde(
744        default,
745        deserialize_with = "super::input::present_nullable",
746        skip_serializing_if = "Option::is_none"
747    )]
748    pub agent: Option<Option<super::multi_agent::Agent>>,
749    pub id: String,
750    pub action: ResponseShellAction,
751    pub call_id: String,
752    #[wire(required)]
753    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
754    #[serde(deserialize_with = "required_nullable")]
755    pub environment: Option<ResponseShellEnvironment>,
756    pub status: input::ItemStatus,
757    #[serde(rename = "type")]
758    pub type_: input::ShellCallType,
759    #[serde(
760        default,
761        deserialize_with = "present_nullable",
762        skip_serializing_if = "Option::is_none"
763    )]
764    pub caller: Option<Option<input::Caller>>,
765    #[serde(
766        default,
767        deserialize_with = "present_optional",
768        skip_serializing_if = "Option::is_none"
769    )]
770    pub created_by: Option<String>,
771    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
772    pub rest: Rest,
773}
774
775#[derive(
776    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
777)]
778#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
779#[derive(gproxy_protocol_macros::DeclaredFields)]
780#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
781pub struct ResponseShellAction {
782    pub commands: Vec<String>,
783    #[wire(required)]
784    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
785    #[serde(deserialize_with = "required_nullable")]
786    pub max_output_length: Option<i64>,
787    #[wire(required)]
788    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
789    #[serde(deserialize_with = "required_nullable")]
790    pub timeout_ms: Option<i64>,
791    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
792    pub rest: Rest,
793}
794
795#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
796#[serde(untagged)]
797#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
798#[derive(gproxy_protocol_macros::DeclaredFields)]
799#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
800pub enum ResponseShellEnvironment {
801    Local(ResponseLocalEnvironment),
802    Reference(tools::ShellContainerReference),
803}
804
805#[derive(
806    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
807)]
808#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
809#[derive(gproxy_protocol_macros::DeclaredFields)]
810#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
811pub struct ResponseLocalEnvironment {
812    #[serde(rename = "type")]
813    pub type_: tools::ShellLocalType,
814    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
815    pub rest: Rest,
816}
817
818#[derive(
819    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
820)]
821#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
822#[derive(gproxy_protocol_macros::DeclaredFields)]
823#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
824pub struct ResponseShellCallOutput {
825    #[serde(
826        default,
827        deserialize_with = "super::input::present_nullable",
828        skip_serializing_if = "Option::is_none"
829    )]
830    pub agent: Option<Option<super::multi_agent::Agent>>,
831    pub id: String,
832    pub call_id: String,
833    #[wire(required)]
834    #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
835    #[serde(deserialize_with = "required_nullable")]
836    pub max_output_length: Option<i64>,
837    pub output: Vec<ResponseShellOutputContent>,
838    pub status: input::ItemStatus,
839    #[serde(rename = "type")]
840    pub type_: input::ShellCallOutputType,
841    #[serde(
842        default,
843        deserialize_with = "present_nullable",
844        skip_serializing_if = "Option::is_none"
845    )]
846    pub caller: Option<Option<input::Caller>>,
847    #[serde(
848        default,
849        deserialize_with = "present_optional",
850        skip_serializing_if = "Option::is_none"
851    )]
852    pub created_by: Option<String>,
853    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
854    pub rest: Rest,
855}
856
857#[derive(
858    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
859)]
860#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
861#[derive(gproxy_protocol_macros::DeclaredFields)]
862#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
863pub struct ResponseShellOutputContent {
864    pub outcome: input::ShellOutputOutcome,
865    pub stderr: String,
866    pub stdout: String,
867    #[serde(
868        default,
869        deserialize_with = "present_optional",
870        skip_serializing_if = "Option::is_none"
871    )]
872    pub created_by: Option<String>,
873    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
874    pub rest: Rest,
875}
876
877#[derive(
878    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
879)]
880#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
881#[derive(gproxy_protocol_macros::DeclaredFields)]
882#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
883pub struct ResponseApplyPatchCall {
884    #[serde(
885        default,
886        deserialize_with = "super::input::present_nullable",
887        skip_serializing_if = "Option::is_none"
888    )]
889    pub agent: Option<Option<super::multi_agent::Agent>>,
890    pub id: String,
891    pub call_id: String,
892    pub operation: input::ApplyPatchOperation,
893    pub status: input::ApplyPatchStatus,
894    #[serde(rename = "type")]
895    pub type_: input::ApplyPatchCallType,
896    #[serde(
897        default,
898        deserialize_with = "present_nullable",
899        skip_serializing_if = "Option::is_none"
900    )]
901    pub caller: Option<Option<input::Caller>>,
902    #[serde(
903        default,
904        deserialize_with = "present_optional",
905        skip_serializing_if = "Option::is_none"
906    )]
907    pub created_by: Option<String>,
908    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
909    pub rest: Rest,
910}
911
912#[derive(
913    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
914)]
915#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
916#[derive(gproxy_protocol_macros::DeclaredFields)]
917#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
918pub struct ResponseApplyPatchCallOutput {
919    #[serde(
920        default,
921        deserialize_with = "super::input::present_nullable",
922        skip_serializing_if = "Option::is_none"
923    )]
924    pub agent: Option<Option<super::multi_agent::Agent>>,
925    pub id: String,
926    pub call_id: String,
927    pub status: input::ApplyPatchOutputStatus,
928    #[serde(rename = "type")]
929    pub type_: input::ApplyPatchCallOutputType,
930    #[serde(
931        default,
932        deserialize_with = "present_nullable",
933        skip_serializing_if = "Option::is_none"
934    )]
935    pub caller: Option<Option<input::Caller>>,
936    #[serde(
937        default,
938        deserialize_with = "present_optional",
939        skip_serializing_if = "Option::is_none"
940    )]
941    pub created_by: Option<String>,
942    #[serde(
943        default,
944        deserialize_with = "present_nullable",
945        skip_serializing_if = "Option::is_none"
946    )]
947    pub output: Option<Option<String>>,
948    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
949    pub rest: Rest,
950}
951
952#[derive(
953    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
954)]
955#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
956#[derive(gproxy_protocol_macros::DeclaredFields)]
957#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
958pub struct ResponseMcpApprovalResponse {
959    #[serde(
960        default,
961        deserialize_with = "super::input::present_nullable",
962        skip_serializing_if = "Option::is_none"
963    )]
964    pub agent: Option<Option<super::multi_agent::Agent>>,
965    pub id: String,
966    pub approval_request_id: String,
967    pub approve: bool,
968    #[serde(rename = "type")]
969    pub type_: input::McpApprovalResponseType,
970    #[serde(
971        default,
972        deserialize_with = "present_nullable",
973        skip_serializing_if = "Option::is_none"
974    )]
975    pub reason: Option<Option<String>>,
976    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
977    pub rest: Rest,
978}
979
980#[derive(
981    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
982)]
983#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
984#[derive(gproxy_protocol_macros::DeclaredFields)]
985#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
986pub struct ResponseCustomToolCallOutput {
987    #[serde(
988        default,
989        deserialize_with = "super::input::present_nullable",
990        skip_serializing_if = "Option::is_none"
991    )]
992    pub agent: Option<Option<super::multi_agent::Agent>>,
993    pub id: String,
994    pub call_id: String,
995    pub output: input::CustomOutput,
996    pub status: input::ItemStatus,
997    #[serde(rename = "type")]
998    pub type_: input::CustomToolCallOutputType,
999    #[serde(
1000        default,
1001        deserialize_with = "present_nullable",
1002        skip_serializing_if = "Option::is_none"
1003    )]
1004    pub caller: Option<Option<input::Caller>>,
1005    #[serde(
1006        default,
1007        deserialize_with = "present_optional",
1008        skip_serializing_if = "Option::is_none"
1009    )]
1010    pub created_by: Option<String>,
1011    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1012    pub rest: Rest,
1013}
1014
1015#[derive(
1016    Debug,
1017    Clone,
1018    PartialEq,
1019    Eq,
1020    Serialize,
1021    Deserialize,
1022    gproxy_protocol_macros::WireBuilder,
1023    gproxy_protocol_macros::DeclaredFields,
1024)]
1025#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1026#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1027pub struct MisalignmentDetails {
1028    #[serde(skip_serializing_if = "Option::is_none")]
1029    pub detailed_explanation: Option<String>,
1030    #[serde(skip_serializing_if = "Option::is_none")]
1031    pub error_type: Option<String>,
1032    #[serde(skip_serializing_if = "Option::is_none")]
1033    pub steer: Option<MisalignmentSteer>,
1034    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1035    pub rest: Rest,
1036}
1037
1038#[derive(
1039    Debug,
1040    Clone,
1041    PartialEq,
1042    Eq,
1043    Serialize,
1044    Deserialize,
1045    gproxy_protocol_macros::WireBuilder,
1046    gproxy_protocol_macros::DeclaredFields,
1047)]
1048#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1049#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1050pub struct MisalignmentSteer {
1051    pub message: String,
1052    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1053    pub rest: Rest,
1054}
1055
1056impl ResponseOutputItem {
1057    pub fn agent(&self) -> Option<&super::multi_agent::Agent> {
1058        match self {
1059            Self::ConfigurationUpdate(v) => v.agent.as_ref().and_then(Option::as_ref),
1060            Self::Message(v) => v.agent.as_ref().and_then(Option::as_ref),
1061            Self::FileSearchCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1062            Self::FunctionCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1063            Self::FunctionCallOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1064            Self::WebSearchCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1065            Self::ComputerCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1066            Self::ComputerCallOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1067            Self::Reasoning(v) => v.agent.as_ref().and_then(Option::as_ref),
1068            Self::Program(v) => v.agent.as_ref().and_then(Option::as_ref),
1069            Self::ProgramOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1070            Self::ToolSearchCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1071            Self::ToolSearchOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1072            Self::AdditionalTools(v) => v.agent.as_ref().and_then(Option::as_ref),
1073            Self::Compaction(v) => v.agent.as_ref().and_then(Option::as_ref),
1074            Self::ImageGenerationCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1075            Self::CodeInterpreterCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1076            Self::LocalShellCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1077            Self::LocalShellCallOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1078            Self::ShellCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1079            Self::ShellCallOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1080            Self::ApplyPatchCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1081            Self::ApplyPatchCallOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1082            Self::McpCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1083            Self::McpListTools(v) => v.agent.as_ref().and_then(Option::as_ref),
1084            Self::McpApprovalRequest(v) => v.agent.as_ref().and_then(Option::as_ref),
1085            Self::McpApprovalResponse(v) => v.agent.as_ref().and_then(Option::as_ref),
1086            Self::CustomToolCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1087            Self::CustomToolCallOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1088            Self::MultiAgentCall(v) => v.agent.as_ref().and_then(Option::as_ref),
1089            Self::MultiAgentCallOutput(v) => v.agent.as_ref().and_then(Option::as_ref),
1090            Self::AgentMessage(v) => v.agent.as_ref().and_then(Option::as_ref),
1091        }
1092    }
1093}
1094
1095impl ResponseOutputItem {
1096    pub(crate) fn set_agent(&mut self, agent: super::multi_agent::Agent) {
1097        match self {
1098            Self::MultiAgentCall(v) => v.agent = Some(Some(agent)),
1099            Self::MultiAgentCallOutput(v) => v.agent = Some(Some(agent)),
1100            Self::AgentMessage(v) => v.agent = Some(Some(agent)),
1101            Self::ConfigurationUpdate(v) => v.agent = Some(Some(agent)),
1102            Self::Message(v) => v.agent = Some(Some(agent)),
1103            Self::FileSearchCall(v) => v.agent = Some(Some(agent)),
1104            Self::FunctionCall(v) => v.agent = Some(Some(agent)),
1105            Self::FunctionCallOutput(v) => v.agent = Some(Some(agent)),
1106            Self::WebSearchCall(v) => v.agent = Some(Some(agent)),
1107            Self::ComputerCall(v) => v.agent = Some(Some(agent)),
1108            Self::ComputerCallOutput(v) => v.agent = Some(Some(agent)),
1109            Self::Reasoning(v) => v.agent = Some(Some(agent)),
1110            Self::Program(v) => v.agent = Some(Some(agent)),
1111            Self::ProgramOutput(v) => v.agent = Some(Some(agent)),
1112            Self::ToolSearchCall(v) => v.agent = Some(Some(agent)),
1113            Self::ToolSearchOutput(v) => v.agent = Some(Some(agent)),
1114            Self::AdditionalTools(v) => v.agent = Some(Some(agent)),
1115            Self::Compaction(v) => v.agent = Some(Some(agent)),
1116            Self::ImageGenerationCall(v) => v.agent = Some(Some(agent)),
1117            Self::CodeInterpreterCall(v) => v.agent = Some(Some(agent)),
1118            Self::LocalShellCall(v) => v.agent = Some(Some(agent)),
1119            Self::LocalShellCallOutput(v) => v.agent = Some(Some(agent)),
1120            Self::ShellCall(v) => v.agent = Some(Some(agent)),
1121            Self::ShellCallOutput(v) => v.agent = Some(Some(agent)),
1122            Self::ApplyPatchCall(v) => v.agent = Some(Some(agent)),
1123            Self::ApplyPatchCallOutput(v) => v.agent = Some(Some(agent)),
1124            Self::McpCall(v) => v.agent = Some(Some(agent)),
1125            Self::McpListTools(v) => v.agent = Some(Some(agent)),
1126            Self::McpApprovalRequest(v) => v.agent = Some(Some(agent)),
1127            Self::McpApprovalResponse(v) => v.agent = Some(Some(agent)),
1128            Self::CustomToolCall(v) => v.agent = Some(Some(agent)),
1129            Self::CustomToolCallOutput(v) => v.agent = Some(Some(agent)),
1130        }
1131    }
1132}