1use crate::Rest;
7use serde::{Deserialize, Serialize};
8use std::collections::BTreeMap;
9
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
11#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
12#[derive(gproxy_protocol_macros::DeclaredFields)]
13#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
14pub struct ClientAdditionalTools {
15 #[serde(default, skip_serializing_if = "Option::is_none")]
16 pub id: Option<String>,
17 pub role: String,
18 pub tools: Vec<serde_json::Value>,
19
20 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
21 pub rest: Rest,
22}
23
24#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
25#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
26#[derive(gproxy_protocol_macros::DeclaredFields)]
27#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
28pub struct ClientMessage {
29 #[serde(default, skip_serializing_if = "Option::is_none")]
30 pub id: Option<String>,
31 pub role: String,
32 pub content: Vec<ContentItem>,
33
34 #[serde(default, skip_serializing_if = "Option::is_none")]
35 pub phase: Option<MessagePhase>,
36 #[serde(default, skip_serializing_if = "Option::is_none")]
37 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
38
39 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
40 pub rest: Rest,
41}
42
43#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
44#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
45#[derive(gproxy_protocol_macros::DeclaredFields)]
46#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
47pub struct ClientAgentMessage {
48 #[serde(default, skip_serializing_if = "Option::is_none")]
49 pub id: Option<String>,
50 pub author: String,
51 pub recipient: String,
52 pub content: Vec<AgentMessageInputContent>,
53 #[serde(default, skip_serializing_if = "Option::is_none")]
54 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
55
56 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
57 pub rest: Rest,
58}
59
60#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
61#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
62#[derive(gproxy_protocol_macros::DeclaredFields)]
63#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
64pub struct ClientReasoning {
65 #[serde(default, skip_serializing_if = "Option::is_none")]
66 pub id: Option<String>,
67 pub summary: Vec<ReasoningItemReasoningSummary>,
68 #[serde(
69 default,
70 deserialize_with = "super::super::responses::input::present_nullable",
71 skip_serializing_if = "Option::is_none"
72 )]
73 pub content: Option<Option<Vec<ReasoningItemContent>>>,
74 #[wire(required)]
75 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
76 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
77 pub encrypted_content: Option<String>,
78 #[serde(default, skip_serializing_if = "Option::is_none")]
79 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
80
81 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
82 pub rest: Rest,
83}
84
85#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
86#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
87#[derive(gproxy_protocol_macros::DeclaredFields)]
88#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
89pub struct ClientLocalShellCall {
90 #[serde(default, skip_serializing_if = "Option::is_none")]
91 pub id: Option<String>,
92
93 #[wire(required)]
94 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
95 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
96 pub call_id: Option<String>,
97 pub status: LocalShellStatus,
98 pub action: LocalShellAction,
99 #[serde(default, skip_serializing_if = "Option::is_none")]
100 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
101
102 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
103 pub rest: Rest,
104}
105
106#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
107#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
108#[derive(gproxy_protocol_macros::DeclaredFields)]
109#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
110pub struct ClientFunctionCall {
111 #[serde(default, skip_serializing_if = "Option::is_none")]
112 pub id: Option<String>,
113 pub name: String,
114 #[serde(default, skip_serializing_if = "Option::is_none")]
115 pub namespace: Option<String>,
116
117 pub arguments: String,
118 #[serde(default, skip_serializing_if = "Option::is_none")]
119 pub encrypted_function_args: Option<Vec<String>>,
120 pub call_id: String,
121 #[serde(default, skip_serializing_if = "Option::is_none")]
122 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
123
124 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
125 pub rest: Rest,
126}
127
128#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
129#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
130#[derive(gproxy_protocol_macros::DeclaredFields)]
131#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
132pub struct ClientToolSearchCall {
133 #[serde(default, skip_serializing_if = "Option::is_none")]
134 pub id: Option<String>,
135 #[wire(required)]
136 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
137 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
138 pub call_id: Option<String>,
139 #[serde(default, skip_serializing_if = "Option::is_none")]
140 pub status: Option<String>,
141 pub execution: String,
142 pub arguments: serde_json::Value,
143 #[serde(default, skip_serializing_if = "Option::is_none")]
144 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
145
146 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
147 pub rest: Rest,
148}
149
150#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
151#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
152#[derive(gproxy_protocol_macros::DeclaredFields)]
153#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
154pub struct ClientFunctionCallOutput {
155 #[serde(default, skip_serializing_if = "Option::is_none")]
156 pub id: Option<String>,
157 #[serde(default, skip_serializing_if = "Option::is_none")]
158 pub call_id: Option<String>,
159 #[serde(default, skip_serializing_if = "Option::is_none")]
160 pub name: Option<String>,
161 #[serde(default, skip_serializing_if = "Option::is_none")]
162 pub namespace: Option<String>,
163 pub output: FunctionCallOutputBody,
164 #[serde(default, skip_serializing_if = "Option::is_none")]
165 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
166
167 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
168 pub rest: Rest,
169}
170
171#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
172#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
173#[derive(gproxy_protocol_macros::DeclaredFields)]
174#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
175pub struct ClientCustomToolCall {
176 #[serde(default, skip_serializing_if = "Option::is_none")]
177 pub id: Option<String>,
178 #[serde(default, skip_serializing_if = "Option::is_none")]
179 pub status: Option<String>,
180
181 pub call_id: String,
182 pub name: String,
183 #[serde(default, skip_serializing_if = "Option::is_none")]
184 pub namespace: Option<String>,
185 pub input: String,
186 #[serde(default, skip_serializing_if = "Option::is_none")]
187 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
188
189 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
190 pub rest: Rest,
191}
192
193#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
194#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
195#[derive(gproxy_protocol_macros::DeclaredFields)]
196#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
197pub struct ClientCustomToolCallOutput {
198 #[serde(default, skip_serializing_if = "Option::is_none")]
199 pub id: Option<String>,
200 pub call_id: String,
201 #[serde(default, skip_serializing_if = "Option::is_none")]
202 pub name: Option<String>,
203 pub output: FunctionCallOutputBody,
204 #[serde(default, skip_serializing_if = "Option::is_none")]
205 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
206
207 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
208 pub rest: Rest,
209}
210
211#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
212#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
213#[derive(gproxy_protocol_macros::DeclaredFields)]
214#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
215pub struct ClientToolSearchOutput {
216 #[serde(default, skip_serializing_if = "Option::is_none")]
217 pub id: Option<String>,
218 #[wire(required)]
219 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
220 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
221 pub call_id: Option<String>,
222 pub status: String,
223 pub execution: String,
224 pub tools: Vec<serde_json::Value>,
225 #[serde(default, skip_serializing_if = "Option::is_none")]
226 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
227
228 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
229 pub rest: Rest,
230}
231
232#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
233#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
234#[derive(gproxy_protocol_macros::DeclaredFields)]
235#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
236pub struct ClientWebSearchCall {
237 #[serde(default, skip_serializing_if = "Option::is_none")]
238 pub id: Option<String>,
239 #[serde(default, skip_serializing_if = "Option::is_none")]
240 pub status: Option<String>,
241 #[serde(default, skip_serializing_if = "Option::is_none")]
242 pub action: Option<WebSearchAction>,
243 #[serde(default, skip_serializing_if = "Option::is_none")]
244 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
245
246 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
247 pub rest: Rest,
248}
249
250#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
251#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
252#[derive(gproxy_protocol_macros::DeclaredFields)]
253#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
254pub struct ClientImageGenerationCall {
255 #[serde(default, skip_serializing_if = "Option::is_none")]
256 pub id: Option<String>,
257 pub status: String,
258 #[serde(default, skip_serializing_if = "Option::is_none")]
259 pub revised_prompt: Option<String>,
260 pub result: String,
261 #[serde(default, skip_serializing_if = "Option::is_none")]
262 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
263
264 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
265 pub rest: Rest,
266}
267
268#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
269#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
270#[derive(gproxy_protocol_macros::DeclaredFields)]
271#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
272pub struct ClientCompaction {
273 #[serde(default, skip_serializing_if = "Option::is_none")]
274 pub id: Option<String>,
275 pub encrypted_content: String,
276 #[serde(default, skip_serializing_if = "Option::is_none")]
277 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
278
279 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
280 pub rest: Rest,
281}
282
283#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
284#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
285#[derive(gproxy_protocol_macros::DeclaredFields)]
286#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
287pub struct ClientConfigurationUpdate {
288 pub reasoning: ConfigurationReasoning,
289
290 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
291 pub rest: Rest,
292}
293
294#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
295#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
296#[derive(gproxy_protocol_macros::DeclaredFields)]
297#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
298pub struct ClientCompactionTrigger {
299 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
300 pub rest: Rest,
301}
302
303#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
304#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
305#[derive(gproxy_protocol_macros::DeclaredFields)]
306#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
307pub struct ClientContextCompaction {
308 #[serde(default, skip_serializing_if = "Option::is_none")]
309 pub id: Option<String>,
310 #[serde(default, skip_serializing_if = "Option::is_none")]
311 pub encrypted_content: Option<String>,
312 #[serde(default, skip_serializing_if = "Option::is_none")]
313 pub internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
314
315 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
316 pub rest: Rest,
317}
318
319#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
320#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
321#[derive(gproxy_protocol_macros::DeclaredFields)]
322#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
323pub struct ResponseItemOther {
324 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
325 pub rest: Rest,
326}
327
328#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
329#[serde(tag = "type", rename_all = "snake_case")]
330#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
331#[derive(gproxy_protocol_macros::DeclaredFields)]
332#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
333pub enum ClientResponseItem {
334 AdditionalTools(ClientAdditionalTools),
335 Message(ClientMessage),
336 AgentMessage(ClientAgentMessage),
337 Reasoning(ClientReasoning),
338 LocalShellCall(ClientLocalShellCall),
339 FunctionCall(ClientFunctionCall),
340 ToolSearchCall(ClientToolSearchCall),
341 FunctionCallOutput(ClientFunctionCallOutput),
342 CustomToolCall(ClientCustomToolCall),
343 CustomToolCallOutput(ClientCustomToolCallOutput),
344 ToolSearchOutput(ClientToolSearchOutput),
345 WebSearchCall(ClientWebSearchCall),
346 ImageGenerationCall(ClientImageGenerationCall),
347 #[serde(alias = "compaction_summary")]
348 Compaction(ClientCompaction),
349 ConfigurationUpdate(ClientConfigurationUpdate),
350 CompactionTrigger(ClientCompactionTrigger),
351 ContextCompaction(ClientContextCompaction),
352 Other(ResponseItemOther),
353}
354
355#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
356#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
357#[derive(gproxy_protocol_macros::DeclaredFields)]
358#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
359pub struct ContentItemInputText {
360 pub text: String,
361
362 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
363 pub rest: Rest,
364}
365
366#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
367#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
368#[derive(gproxy_protocol_macros::DeclaredFields)]
369#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
370pub struct ContentItemInputImage {
371 pub image_url: String,
372 #[serde(default, skip_serializing_if = "Option::is_none")]
373 pub detail: Option<ImageDetail>,
374
375 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
376 pub rest: Rest,
377}
378
379#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
381#[serde(untagged)]
382#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
383#[derive(gproxy_protocol_macros::DeclaredFields)]
384#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
385pub enum AudioReference {
386 Inline { audio_url: String },
387 File { file_id: String },
388}
389
390#[derive(Debug, Clone, PartialEq, Serialize, gproxy_protocol_macros::WireBuilder)]
391#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
392#[derive(gproxy_protocol_macros::DeclaredFields)]
393#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
394pub struct ContentItemInputAudio {
395 #[serde(flatten)]
396 pub audio: AudioReference,
397
398 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
399 pub rest: Rest,
400}
401
402impl<'de> Deserialize<'de> for ContentItemInputAudio {
406 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
407 let mut rest = Rest::deserialize(deserializer)?;
408 let audio = if rest
409 .get("audio_url")
410 .is_some_and(serde_json::Value::is_string)
411 {
412 AudioReference::Inline {
413 audio_url: serde_json::from_value(rest.remove("audio_url").unwrap())
414 .map_err(serde::de::Error::custom)?,
415 }
416 } else if rest
417 .get("file_id")
418 .is_some_and(serde_json::Value::is_string)
419 {
420 AudioReference::File {
421 file_id: serde_json::from_value(rest.remove("file_id").unwrap())
422 .map_err(serde::de::Error::custom)?,
423 }
424 } else {
425 return Err(serde::de::Error::custom("expected audio_url or file_id"));
426 };
427 Ok(Self { audio, rest })
428 }
429}
430
431#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
432#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
433#[derive(gproxy_protocol_macros::DeclaredFields)]
434#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
435pub struct ContentItemOutputText {
436 pub text: String,
437
438 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
439 pub rest: Rest,
440}
441
442#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
443#[serde(tag = "type", rename_all = "snake_case")]
444#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
445#[derive(gproxy_protocol_macros::DeclaredFields)]
446#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
447pub enum ContentItem {
448 InputText(ContentItemInputText),
449 InputImage(ContentItemInputImage),
450 InputAudio(ContentItemInputAudio),
451 OutputText(ContentItemOutputText),
452}
453
454#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
455#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
456#[derive(gproxy_protocol_macros::DeclaredFields)]
457#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
458pub struct AgentMessageInputContentInputText {
459 pub text: String,
460 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
461 pub rest: Rest,
462}
463
464#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
465#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
466#[derive(gproxy_protocol_macros::DeclaredFields)]
467#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
468pub struct AgentMessageInputContentEncryptedContent {
469 pub encrypted_content: String,
470 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
471 pub rest: Rest,
472}
473
474#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
475#[serde(tag = "type", rename_all = "snake_case")]
476#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
477#[derive(gproxy_protocol_macros::DeclaredFields)]
478#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
479pub enum AgentMessageInputContent {
480 InputText(AgentMessageInputContentInputText),
481 EncryptedContent(AgentMessageInputContentEncryptedContent),
482}
483
484#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
485#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
486#[derive(gproxy_protocol_macros::DeclaredFields)]
487#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
488pub struct WebSearchActionSearch {
489 #[serde(default, skip_serializing_if = "Option::is_none")]
490 pub query: Option<String>,
491 #[serde(default, skip_serializing_if = "Option::is_none")]
492 pub queries: Option<Vec<String>>,
493
494 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
495 pub rest: Rest,
496}
497
498#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
499#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
500#[derive(gproxy_protocol_macros::DeclaredFields)]
501#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
502pub struct WebSearchActionOpenPage {
503 #[serde(default, skip_serializing_if = "Option::is_none")]
504 pub url: Option<String>,
505
506 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
507 pub rest: Rest,
508}
509
510#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
511#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
512#[derive(gproxy_protocol_macros::DeclaredFields)]
513#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
514pub struct WebSearchActionFindInPage {
515 #[serde(default, skip_serializing_if = "Option::is_none")]
516 pub url: Option<String>,
517 #[serde(default, skip_serializing_if = "Option::is_none")]
518 pub pattern: Option<String>,
519
520 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
521 pub rest: Rest,
522}
523
524#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
525#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
526#[derive(gproxy_protocol_macros::DeclaredFields)]
527#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
528pub struct WebSearchActionOther {
529 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
530 pub rest: Rest,
531}
532
533#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
534#[serde(tag = "type", rename_all = "snake_case")]
535#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
536#[derive(gproxy_protocol_macros::DeclaredFields)]
537#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
538pub enum WebSearchAction {
539 Search(WebSearchActionSearch),
540 OpenPage(WebSearchActionOpenPage),
541 FindInPage(WebSearchActionFindInPage),
542 Other(WebSearchActionOther),
543}
544
545#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
546#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
547#[derive(gproxy_protocol_macros::DeclaredFields)]
548#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
549pub struct ReasoningItemReasoningSummarySummaryText {
550 pub text: String,
551 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
552 pub rest: Rest,
553}
554
555#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
556#[serde(tag = "type", rename_all = "snake_case")]
557#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
558#[derive(gproxy_protocol_macros::DeclaredFields)]
559#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
560pub enum ReasoningItemReasoningSummary {
561 SummaryText(ReasoningItemReasoningSummarySummaryText),
562}
563
564#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
565#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
566#[derive(gproxy_protocol_macros::DeclaredFields)]
567#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
568pub struct ReasoningItemContentReasoningText {
569 pub text: String,
570 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
571 pub rest: Rest,
572}
573
574#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
575#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
576#[derive(gproxy_protocol_macros::DeclaredFields)]
577#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
578pub struct ReasoningItemContentText {
579 pub text: String,
580 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
581 pub rest: Rest,
582}
583
584#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
585#[serde(tag = "type", rename_all = "snake_case")]
586#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
587#[derive(gproxy_protocol_macros::DeclaredFields)]
588#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
589pub enum ReasoningItemContent {
590 ReasoningText(ReasoningItemContentReasoningText),
591 Text(ReasoningItemContentText),
592}
593
594#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
595#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
596#[derive(gproxy_protocol_macros::DeclaredFields)]
597#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
598pub struct FunctionCallOutputContentItemInputText {
599 pub text: String,
600
601 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
602 pub rest: Rest,
603}
604
605#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
606#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
607#[derive(gproxy_protocol_macros::DeclaredFields)]
608#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
609pub struct FunctionCallOutputContentItemInputImage {
610 pub image_url: String,
611 #[serde(default, skip_serializing_if = "Option::is_none")]
612 pub detail: Option<ImageDetail>,
613
614 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
615 pub rest: Rest,
616}
617
618#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
619#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
620#[derive(gproxy_protocol_macros::DeclaredFields)]
621#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
622pub struct FunctionCallOutputContentItemInputAudio {
623 pub audio_url: String,
624
625 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
626 pub rest: Rest,
627}
628
629#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
630#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
631#[derive(gproxy_protocol_macros::DeclaredFields)]
632#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
633pub struct FunctionCallOutputContentItemEncryptedContent {
634 pub encrypted_content: String,
635
636 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
637 pub rest: Rest,
638}
639
640#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
641#[serde(tag = "type", rename_all = "snake_case")]
642#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
643#[derive(gproxy_protocol_macros::DeclaredFields)]
644#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
645pub enum FunctionCallOutputContentItem {
646 InputText(FunctionCallOutputContentItemInputText),
647 InputImage(FunctionCallOutputContentItemInputImage),
648 InputAudio(FunctionCallOutputContentItemInputAudio),
649 EncryptedContent(FunctionCallOutputContentItemEncryptedContent),
650}
651
652#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
653#[serde(rename_all = "snake_case")]
654#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
655#[derive(gproxy_protocol_macros::DeclaredFields)]
656#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
657pub enum ImageDetail {
658 Auto,
659 Low,
660 High,
661 Original,
662}
663
664#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
665#[serde(rename_all = "snake_case")]
666#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
667#[derive(gproxy_protocol_macros::DeclaredFields)]
668#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
669pub enum MessagePhase {
670 Commentary,
671
672 FinalAnswer,
673}
674
675#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
676#[serde(rename_all = "snake_case")]
677#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
678#[derive(gproxy_protocol_macros::DeclaredFields)]
679#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
680pub enum LocalShellStatus {
681 Completed,
682 InProgress,
683 Incomplete,
684}
685
686#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
687#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
688#[derive(gproxy_protocol_macros::DeclaredFields)]
689#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
690pub struct LocalShellExecAction {
691 pub command: Vec<String>,
692 #[wire(required)]
693 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
694 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
695 pub timeout_ms: Option<u64>,
696 #[wire(required)]
697 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
698 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
699 pub working_directory: Option<String>,
700 #[wire(required)]
701 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
702 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
703 pub env: Option<BTreeMap<String, String>>,
704 #[wire(required)]
705 #[cfg_attr(feature = "schema", schemars(extend("x-gproxy-required" = true)))]
706 #[serde(deserialize_with = "super::super::responses::input::required_nullable")]
707 pub user: Option<String>,
708
709 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
710 pub rest: Rest,
711}
712
713#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
714#[serde(tag = "type", rename_all = "snake_case")]
715#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
716#[derive(gproxy_protocol_macros::DeclaredFields)]
717#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
718pub enum LocalShellAction {
719 Exec(LocalShellExecAction),
720}
721
722#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
723#[serde(untagged)]
724#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
725#[derive(gproxy_protocol_macros::DeclaredFields)]
726#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
727pub enum FunctionCallOutputBody {
728 Text(String),
729 ContentItems(Vec<FunctionCallOutputContentItem>),
730}
731
732#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
733#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
734#[derive(gproxy_protocol_macros::DeclaredFields)]
735#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
736pub struct ConfigurationReasoning {
737 pub effort: String,
738 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
739 pub rest: Rest,
740}
741
742#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
743#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
744#[derive(gproxy_protocol_macros::DeclaredFields)]
745#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
746pub struct InternalChatMessageMetadataPassthrough {
747 #[serde(skip_serializing_if = "Option::is_none")]
748 pub turn_id: Option<String>,
749 #[serde(skip_serializing_if = "Option::is_none")]
750 pub create_time: Option<serde_json::Number>,
751 #[serde(skip_serializing_if = "Option::is_none")]
752 pub content_item_kinds: Option<Vec<String>>,
753 #[serde(skip_serializing_if = "Option::is_none")]
754 pub cell_id: Option<String>,
755 #[serde(skip_serializing_if = "Option::is_none")]
756 pub executed_tool_calls: Option<Vec<ExecutedToolCall>>,
757 #[serde(skip_serializing_if = "Option::is_none")]
758 pub tool_calls_complete: Option<bool>,
759 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
760 pub rest: Rest,
761}
762
763#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
764#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
765#[derive(gproxy_protocol_macros::DeclaredFields)]
766#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
767pub struct ExecutedToolCall {
768 pub name: String,
769 pub arguments: serde_json::Value,
770 #[serde(skip_serializing_if = "Option::is_none")]
771 pub tool_result_sources: Option<ToolResultSources>,
772 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
773 pub rest: Rest,
774}
775
776#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
777#[serde(untagged)]
778#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
779#[derive(gproxy_protocol_macros::DeclaredFields)]
780#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
781pub enum ToolResultSources {
782 Sources(Vec<ToolResultSource>),
783 ParseFailed(ParseFailed),
784}
785
786#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
787#[serde(rename_all = "snake_case")]
788#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
789#[derive(gproxy_protocol_macros::DeclaredFields)]
790#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
791pub enum ParseFailed {
792 ParseFailed,
793}
794
795#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
796#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
797#[derive(gproxy_protocol_macros::DeclaredFields)]
798#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
799pub struct ToolResultSource {
800 #[serde(rename = "type")]
801 pub type_: String,
802 pub id: String,
803 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
804 pub rest: Rest,
805}
806
807#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
808#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
809#[derive(gproxy_protocol_macros::DeclaredFields)]
810#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
811pub struct Reasoning {
812 #[serde(skip_serializing_if = "Option::is_none")]
813 pub effort: Option<String>,
814 #[serde(skip_serializing_if = "Option::is_none")]
815 pub summary: Option<ReasoningSummary>,
816 #[serde(skip_serializing_if = "Option::is_none")]
817 pub context: Option<ReasoningContext>,
818 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
819 pub rest: Rest,
820}
821
822#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
823#[serde(rename_all = "snake_case")]
824#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
825#[derive(gproxy_protocol_macros::DeclaredFields)]
826#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
827pub enum ReasoningSummary {
828 Auto,
829 Concise,
830 Detailed,
831 None,
832}
833
834#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
835#[serde(rename_all = "snake_case")]
836#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
837#[derive(gproxy_protocol_macros::DeclaredFields)]
838#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
839pub enum ReasoningContext {
840 Auto,
841 CurrentTurn,
842 AllTurns,
843}
844
845#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
846#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
847#[derive(gproxy_protocol_macros::DeclaredFields)]
848#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
849pub struct ClientTextControls {
850 #[serde(skip_serializing_if = "Option::is_none")]
851 pub verbosity: Option<ClientVerbosity>,
852 #[serde(skip_serializing_if = "Option::is_none")]
853 pub format: Option<ClientTextFormat>,
854 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
855 pub rest: Rest,
856}
857
858#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
859#[serde(rename_all = "snake_case")]
860#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
861#[derive(gproxy_protocol_macros::DeclaredFields)]
862#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
863pub enum ClientVerbosity {
864 Low,
865 Medium,
866 High,
867}
868
869#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
870#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
871#[derive(gproxy_protocol_macros::DeclaredFields)]
872#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
873pub struct ClientTextFormat {
874 #[serde(rename = "type")]
875 pub type_: ClientTextFormatType,
876 pub strict: bool,
877 pub schema: serde_json::Value,
878 pub name: String,
879 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
880 pub rest: Rest,
881}
882
883#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
884#[serde(rename_all = "snake_case")]
885#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
886#[derive(gproxy_protocol_macros::DeclaredFields)]
887#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
888pub enum ClientTextFormatType {
889 JsonSchema,
890}
891
892#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
893#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
894#[derive(gproxy_protocol_macros::DeclaredFields)]
895#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
896pub struct AccessPrograms {
897 pub cyber: CyberAccessProgram,
898 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
899 pub rest: Rest,
900}
901
902pub use super::super::responses::CyberAccessProgram;