Skip to main content

gproxy_protocol/wire/claude/
generate_content.rs

1use crate::Rest;
2use serde::{Deserialize, Serialize};
3
4use super::{
5    content::{self, Message},
6    count_tokens::{
7        ContextManagementConfig, JsonOutputFormat, McpServerUrlDefinition, OutputConfig, Speed,
8        SystemPrompt, ThinkingConfig, ToolChoice,
9    },
10    tools::ToolUnion,
11};
12
13#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
14#[serde(rename_all = "snake_case")]
15#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
16#[derive(gproxy_protocol_macros::DeclaredFields)]
17#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
18pub struct GenerateContentRequestBody {
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub compaction: Option<CompactionConfig>,
21
22    pub max_tokens: i64,
23    pub messages: Vec<Message>,
24    pub model: String,
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub cache_control: Option<super::content::CacheControl>,
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub container: Option<ContainerParam>,
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub context_management: Option<ContextManagementConfig>,
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub diagnostics: Option<DiagnosticsParam>,
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub fallback_credit_token: Option<FallbackCreditTokenParam>,
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub fallbacks: Option<FallbacksParam>,
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub inference_geo: Option<String>,
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub mcp_servers: Option<Vec<McpServerUrlDefinition>>,
41    #[serde(skip_serializing_if = "Option::is_none")]
42    pub metadata: Option<Metadata>,
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub output_config: Option<OutputConfig>,
45    #[serde(skip_serializing_if = "Option::is_none")]
46    pub output_format: Option<JsonOutputFormat>,
47    #[serde(skip_serializing_if = "Option::is_none")]
48    pub service_tier: Option<ServiceTier>,
49    #[serde(skip_serializing_if = "Option::is_none")]
50    pub speed: Option<Speed>,
51    #[serde(skip_serializing_if = "Option::is_none")]
52    pub stop_sequences: Option<Vec<String>>,
53    #[serde(skip_serializing_if = "Option::is_none")]
54    pub stream: Option<bool>,
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub system: Option<SystemPrompt>,
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub thinking: Option<ThinkingConfig>,
59    #[serde(skip_serializing_if = "Option::is_none")]
60    pub tool_choice: Option<ToolChoice>,
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub tools: Option<Vec<ToolUnion>>,
63    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
64    pub rest: Rest,
65}
66pub type GenerateContentRequest = crate::WireRequest<GenerateContentRequestBody>;
67#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
68#[serde(untagged)]
69#[derive(gproxy_protocol_macros::DeclaredFields)]
70#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
71pub enum ContainerParam {
72    Id(String),
73    Params(ContainerParams),
74}
75
76#[derive(
77    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
78)]
79#[serde(rename_all = "snake_case")]
80#[derive(gproxy_protocol_macros::DeclaredFields)]
81#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
82pub struct ContainerParams {
83    #[serde(skip_serializing_if = "Option::is_none")]
84    pub id: Option<String>,
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub skills: Option<Vec<SkillParam>>,
87    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
88    pub rest: Rest,
89}
90#[derive(
91    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
92)]
93#[serde(rename_all = "snake_case")]
94#[derive(gproxy_protocol_macros::DeclaredFields)]
95#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
96pub struct SkillParam {
97    pub skill_id: String,
98    #[serde(rename = "type")]
99    pub type_: SkillType,
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub version: Option<String>,
102    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
103    pub rest: Rest,
104}
105#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
106#[serde(rename_all = "snake_case")]
107#[derive(gproxy_protocol_macros::DeclaredFields)]
108#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
109pub enum SkillType {
110    Anthropic,
111    Custom,
112}
113#[derive(
114    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
115)]
116#[serde(rename_all = "snake_case")]
117#[derive(gproxy_protocol_macros::DeclaredFields)]
118#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
119pub struct DiagnosticsParam {
120    #[serde(
121        default,
122        deserialize_with = "present_nullable",
123        skip_serializing_if = "Option::is_none"
124    )]
125    pub previous_message_id: Option<Option<String>>,
126    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
127    pub rest: Rest,
128}
129#[derive(
130    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
131)]
132#[serde(rename_all = "snake_case")]
133#[derive(gproxy_protocol_macros::DeclaredFields)]
134#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
135pub struct FallbackCreditToken {
136    pub token: String,
137    #[serde(skip_serializing_if = "Option::is_none")]
138    pub mode: Option<FallbackCreditMode>,
139    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
140    pub rest: Rest,
141}
142#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
143#[serde(rename_all = "snake_case")]
144#[derive(gproxy_protocol_macros::DeclaredFields)]
145#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
146pub enum FallbackCreditMode {
147    Strict,
148    BestEffort,
149}
150#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
151#[serde(rename_all = "snake_case")]
152#[derive(gproxy_protocol_macros::DeclaredFields)]
153#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
154pub struct FallbackParam {
155    pub model: String,
156    #[serde(skip_serializing_if = "Option::is_none")]
157    pub max_tokens: Option<i64>,
158    #[serde(skip_serializing_if = "Option::is_none")]
159    pub output_config: Option<OutputConfig>,
160    #[serde(skip_serializing_if = "Option::is_none")]
161    pub speed: Option<Speed>,
162    #[serde(skip_serializing_if = "Option::is_none")]
163    pub thinking: Option<ThinkingConfig>,
164    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
165    pub rest: Rest,
166}
167#[derive(
168    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
169)]
170#[serde(rename_all = "snake_case")]
171#[derive(gproxy_protocol_macros::DeclaredFields)]
172#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
173pub struct Metadata {
174    #[serde(skip_serializing_if = "Option::is_none")]
175    pub user_id: Option<String>,
176    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
177    pub rest: Rest,
178}
179#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
180#[serde(rename_all = "snake_case")]
181#[derive(gproxy_protocol_macros::DeclaredFields)]
182#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
183pub enum ServiceTier {
184    Auto,
185    StandardOnly,
186}
187
188// Response nullability follows the official SDK where the generated reference
189// omits it: anthropics/anthropic-sdk-python, src/anthropic/types/beta/.
190// Keep absent fields distinct from explicit null (for example, pending diagnostics).
191fn present_nullable<'de, D, T>(deserializer: D) -> Result<Option<Option<T>>, D::Error>
192where
193    D: serde::Deserializer<'de>,
194    T: Deserialize<'de>,
195{
196    Option::<T>::deserialize(deserializer).map(Some)
197}
198
199#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
200#[serde(untagged)]
201#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
202#[derive(gproxy_protocol_macros::DeclaredFields)]
203#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
204pub enum FallbackCreditTokenParam {
205    Token(String),
206    Params(FallbackCreditToken),
207}
208
209#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
210#[serde(untagged)]
211#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
212#[derive(gproxy_protocol_macros::DeclaredFields)]
213#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
214pub enum FallbacksParam {
215    Models(Vec<FallbackParam>),
216    Default(DefaultFallbacks),
217}
218
219#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
220#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
221#[derive(gproxy_protocol_macros::DeclaredFields)]
222#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
223pub enum DefaultFallbacks {
224    #[serde(rename = "default")]
225    Default,
226}
227
228#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
229#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
230#[derive(gproxy_protocol_macros::DeclaredFields)]
231#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
232pub enum GenerateContentResponseBodyType {
233    #[serde(rename = "message")]
234    Tag,
235}
236
237#[derive(
238    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
239)]
240#[serde(rename_all = "snake_case")]
241#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
242#[derive(gproxy_protocol_macros::DeclaredFields)]
243#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
244pub struct GenerateContentResponseBody {
245    #[serde(
246        default,
247        deserialize_with = "present_nullable",
248        skip_serializing_if = "Option::is_none"
249    )]
250    pub input_transformations: Option<Option<Vec<InputTransformation>>>,
251
252    #[serde(rename = "type")]
253    pub type_: GenerateContentResponseBodyType,
254    pub id: String,
255    #[serde(
256        default,
257        deserialize_with = "present_nullable",
258        skip_serializing_if = "Option::is_none"
259    )]
260    pub container: Option<Option<ResponseContainer>>,
261    pub content: Vec<ResponseContentBlock>,
262    #[serde(
263        default,
264        deserialize_with = "present_nullable",
265        skip_serializing_if = "Option::is_none"
266    )]
267    pub context_management: Option<Option<ContextManagementResponse>>,
268    #[serde(
269        default,
270        deserialize_with = "present_nullable",
271        skip_serializing_if = "Option::is_none"
272    )]
273    pub diagnostics: Option<Option<DiagnosticsResponse>>,
274    pub model: String,
275    pub role: ResponseRole,
276    #[serde(
277        default,
278        deserialize_with = "present_nullable",
279        skip_serializing_if = "Option::is_none"
280    )]
281    pub stop_details: Option<Option<RefusalStopDetails>>,
282    pub stop_reason: StopReason,
283    #[serde(
284        default,
285        deserialize_with = "present_nullable",
286        skip_serializing_if = "Option::is_none"
287    )]
288    pub stop_sequence: Option<Option<String>>,
289    pub usage: Usage,
290    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
291    pub rest: Rest,
292}
293
294pub type GenerateContentResponse = crate::WireResponse<GenerateContentResponseBody>;
295pub type ResponseType = GenerateContentResponseBodyType;
296#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
297#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
298#[derive(gproxy_protocol_macros::DeclaredFields)]
299#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
300pub enum ResponseRole {
301    #[serde(rename = "assistant")]
302    Assistant,
303}
304
305#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
306#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
307#[derive(gproxy_protocol_macros::DeclaredFields)]
308#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
309pub enum StopReason {
310    #[serde(rename = "end_turn")]
311    EndTurn,
312    #[serde(rename = "max_tokens")]
313    MaxTokens,
314    #[serde(rename = "stop_sequence")]
315    StopSequence,
316    #[serde(rename = "tool_use")]
317    ToolUse,
318    #[serde(rename = "pause_turn")]
319    PauseTurn,
320    #[serde(rename = "compaction")]
321    Compaction,
322    #[serde(rename = "refusal")]
323    Refusal,
324    #[serde(rename = "model_context_window_exceeded")]
325    ModelContextWindowExceeded,
326}
327
328#[derive(
329    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
330)]
331#[serde(rename_all = "snake_case")]
332#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
333#[derive(gproxy_protocol_macros::DeclaredFields)]
334#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
335pub struct ResponseContainer {
336    pub id: String,
337    pub expires_at: String,
338    #[serde(
339        default,
340        deserialize_with = "present_nullable",
341        skip_serializing_if = "Option::is_none"
342    )]
343    pub skills: Option<Option<Vec<ResponseSkill>>>,
344    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
345    pub rest: Rest,
346}
347
348#[derive(
349    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
350)]
351#[serde(rename_all = "snake_case")]
352#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
353#[derive(gproxy_protocol_macros::DeclaredFields)]
354#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
355pub struct ResponseSkill {
356    pub skill_id: String,
357    #[serde(rename = "type")]
358    pub type_: SkillType,
359    pub version: String,
360    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
361    pub rest: Rest,
362}
363
364#[derive(
365    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
366)]
367#[serde(rename_all = "snake_case")]
368#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
369#[derive(gproxy_protocol_macros::DeclaredFields)]
370#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
371pub struct ContextManagementResponse {
372    pub applied_edits: Vec<ContextEditResponse>,
373    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
374    pub rest: Rest,
375}
376
377#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
378#[serde(untagged)]
379#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
380#[derive(gproxy_protocol_macros::DeclaredFields)]
381#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
382pub enum ContextEditResponse {
383    Tools(ClearedTools),
384    Thinking(ClearedThinking),
385}
386
387#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
388#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
389#[derive(gproxy_protocol_macros::DeclaredFields)]
390#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
391pub enum ClearedToolsType {
392    #[serde(rename = "clear_tool_uses_20250919")]
393    Tag,
394}
395
396#[derive(
397    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
398)]
399#[serde(rename_all = "snake_case")]
400#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
401#[derive(gproxy_protocol_macros::DeclaredFields)]
402#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
403pub struct ClearedTools {
404    #[serde(rename = "type")]
405    pub type_: ClearedToolsType,
406    pub cleared_input_tokens: i64,
407    pub cleared_tool_uses: i64,
408    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
409    pub rest: Rest,
410}
411
412#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
413#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
414#[derive(gproxy_protocol_macros::DeclaredFields)]
415#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
416pub enum ClearedThinkingType {
417    #[serde(rename = "clear_thinking_20251015")]
418    Tag,
419}
420
421#[derive(
422    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
423)]
424#[serde(rename_all = "snake_case")]
425#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
426#[derive(gproxy_protocol_macros::DeclaredFields)]
427#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
428pub struct ClearedThinking {
429    #[serde(rename = "type")]
430    pub type_: ClearedThinkingType,
431    pub cleared_input_tokens: i64,
432    pub cleared_thinking_turns: i64,
433    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
434    pub rest: Rest,
435}
436
437#[derive(
438    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
439)]
440#[serde(rename_all = "snake_case")]
441#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
442#[derive(gproxy_protocol_macros::DeclaredFields)]
443#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
444pub struct DiagnosticsResponse {
445    #[serde(
446        default,
447        deserialize_with = "present_nullable",
448        skip_serializing_if = "Option::is_none"
449    )]
450    pub cache_miss_reason: Option<Option<CacheMissReason>>,
451    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
452    pub rest: Rest,
453}
454
455#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
456#[serde(untagged)]
457#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
458#[derive(gproxy_protocol_macros::DeclaredFields)]
459#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
460pub enum CacheMissReason {
461    ModelChanged(CacheMissModelChanged),
462    SystemChanged(CacheMissSystemChanged),
463    ToolsChanged(CacheMissToolsChanged),
464    MessagesChanged(CacheMissMessagesChanged),
465    PreviousMessageNotFound(CacheMissPreviousMessageNotFound),
466    Unavailable(CacheMissUnavailable),
467}
468
469#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
470#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
471#[derive(gproxy_protocol_macros::DeclaredFields)]
472#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
473pub enum CacheMissModelChangedType {
474    #[serde(rename = "model_changed")]
475    Tag,
476}
477
478#[derive(
479    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
480)]
481#[serde(rename_all = "snake_case")]
482#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
483#[derive(gproxy_protocol_macros::DeclaredFields)]
484#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
485pub struct CacheMissModelChanged {
486    #[serde(rename = "type")]
487    pub type_: CacheMissModelChangedType,
488    pub cache_missed_input_tokens: i64,
489    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
490    pub rest: Rest,
491}
492
493#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
494#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
495#[derive(gproxy_protocol_macros::DeclaredFields)]
496#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
497pub enum CacheMissSystemChangedType {
498    #[serde(rename = "system_changed")]
499    Tag,
500}
501
502#[derive(
503    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
504)]
505#[serde(rename_all = "snake_case")]
506#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
507#[derive(gproxy_protocol_macros::DeclaredFields)]
508#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
509pub struct CacheMissSystemChanged {
510    #[serde(rename = "type")]
511    pub type_: CacheMissSystemChangedType,
512    pub cache_missed_input_tokens: i64,
513    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
514    pub rest: Rest,
515}
516
517#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
518#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
519#[derive(gproxy_protocol_macros::DeclaredFields)]
520#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
521pub enum CacheMissToolsChangedType {
522    #[serde(rename = "tools_changed")]
523    Tag,
524}
525
526#[derive(
527    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
528)]
529#[serde(rename_all = "snake_case")]
530#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
531#[derive(gproxy_protocol_macros::DeclaredFields)]
532#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
533pub struct CacheMissToolsChanged {
534    #[serde(rename = "type")]
535    pub type_: CacheMissToolsChangedType,
536    pub cache_missed_input_tokens: i64,
537    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
538    pub rest: Rest,
539}
540
541#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
542#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
543#[derive(gproxy_protocol_macros::DeclaredFields)]
544#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
545pub enum CacheMissMessagesChangedType {
546    #[serde(rename = "messages_changed")]
547    Tag,
548}
549
550#[derive(
551    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
552)]
553#[serde(rename_all = "snake_case")]
554#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
555#[derive(gproxy_protocol_macros::DeclaredFields)]
556#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
557pub struct CacheMissMessagesChanged {
558    #[serde(rename = "type")]
559    pub type_: CacheMissMessagesChangedType,
560    pub cache_missed_input_tokens: i64,
561    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
562    pub rest: Rest,
563}
564
565#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
566#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
567#[derive(gproxy_protocol_macros::DeclaredFields)]
568#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
569pub enum CacheMissPreviousMessageNotFoundType {
570    #[serde(rename = "previous_message_not_found")]
571    Tag,
572}
573
574#[derive(
575    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
576)]
577#[serde(rename_all = "snake_case")]
578#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
579#[derive(gproxy_protocol_macros::DeclaredFields)]
580#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
581pub struct CacheMissPreviousMessageNotFound {
582    #[serde(rename = "type")]
583    pub type_: CacheMissPreviousMessageNotFoundType,
584    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
585    pub rest: Rest,
586}
587
588#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
589#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
590#[derive(gproxy_protocol_macros::DeclaredFields)]
591#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
592pub enum CacheMissUnavailableType {
593    #[serde(rename = "unavailable")]
594    Tag,
595}
596
597#[derive(
598    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
599)]
600#[serde(rename_all = "snake_case")]
601#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
602#[derive(gproxy_protocol_macros::DeclaredFields)]
603#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
604pub struct CacheMissUnavailable {
605    #[serde(rename = "type")]
606    pub type_: CacheMissUnavailableType,
607    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
608    pub rest: Rest,
609}
610
611#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
612#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
613#[derive(gproxy_protocol_macros::DeclaredFields)]
614#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
615pub enum RefusalCategory {
616    #[serde(rename = "cyber")]
617    Cyber,
618    #[serde(rename = "bio")]
619    Bio,
620    #[serde(rename = "frontier_llm")]
621    FrontierLlm,
622    #[serde(rename = "reasoning_extraction")]
623    ReasoningExtraction,
624    #[serde(rename = "general_harms")]
625    GeneralHarms,
626}
627
628#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
629#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
630#[derive(gproxy_protocol_macros::DeclaredFields)]
631#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
632pub enum RefusalStopDetailsType {
633    #[serde(rename = "refusal")]
634    Tag,
635}
636
637#[derive(
638    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
639)]
640#[serde(rename_all = "snake_case")]
641#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
642#[derive(gproxy_protocol_macros::DeclaredFields)]
643#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
644pub struct RefusalStopDetails {
645    #[serde(rename = "type")]
646    pub type_: RefusalStopDetailsType,
647    #[serde(
648        default,
649        deserialize_with = "present_nullable",
650        skip_serializing_if = "Option::is_none"
651    )]
652    pub category: Option<Option<RefusalCategory>>,
653    #[serde(
654        default,
655        deserialize_with = "present_nullable",
656        skip_serializing_if = "Option::is_none"
657    )]
658    pub explanation: Option<Option<String>>,
659    #[serde(
660        default,
661        deserialize_with = "present_nullable",
662        skip_serializing_if = "Option::is_none"
663    )]
664    pub fallback_credit_token: Option<Option<String>>,
665    #[serde(
666        default,
667        deserialize_with = "present_nullable",
668        skip_serializing_if = "Option::is_none"
669    )]
670    pub fallback_has_prefill_claim: Option<Option<bool>>,
671    #[serde(
672        default,
673        deserialize_with = "present_nullable",
674        skip_serializing_if = "Option::is_none"
675    )]
676    pub recommended_model: Option<Option<String>>,
677    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
678    pub rest: Rest,
679}
680
681#[derive(
682    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
683)]
684#[serde(rename_all = "snake_case")]
685#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
686#[derive(gproxy_protocol_macros::DeclaredFields)]
687#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
688pub struct CacheCreation {
689    pub ephemeral_1h_input_tokens: i64,
690    pub ephemeral_5m_input_tokens: i64,
691    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
692    pub rest: Rest,
693}
694
695#[derive(
696    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
697)]
698#[serde(rename_all = "snake_case")]
699#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
700#[derive(gproxy_protocol_macros::DeclaredFields)]
701#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
702pub struct Usage {
703    #[serde(
704        default,
705        deserialize_with = "present_nullable",
706        skip_serializing_if = "Option::is_none"
707    )]
708    pub cache_creation: Option<Option<CacheCreation>>,
709    #[serde(
710        default,
711        deserialize_with = "present_nullable",
712        skip_serializing_if = "Option::is_none"
713    )]
714    pub cache_creation_input_tokens: Option<Option<i64>>,
715    #[serde(
716        default,
717        deserialize_with = "present_nullable",
718        skip_serializing_if = "Option::is_none"
719    )]
720    pub cache_read_input_tokens: Option<Option<i64>>,
721    #[serde(
722        default,
723        deserialize_with = "present_nullable",
724        skip_serializing_if = "Option::is_none"
725    )]
726    pub fallback_credit: Option<Option<FallbackCreditUsage>>,
727    #[serde(
728        default,
729        deserialize_with = "present_nullable",
730        skip_serializing_if = "Option::is_none"
731    )]
732    pub inference_geo: Option<Option<String>>,
733    pub input_tokens: i64,
734    #[serde(
735        default,
736        deserialize_with = "present_nullable",
737        skip_serializing_if = "Option::is_none"
738    )]
739    pub iterations: Option<Option<Vec<IterationUsage>>>,
740    pub output_tokens: i64,
741    #[serde(
742        default,
743        deserialize_with = "present_nullable",
744        skip_serializing_if = "Option::is_none"
745    )]
746    pub output_tokens_details: Option<Option<OutputTokensDetails>>,
747    #[serde(
748        default,
749        deserialize_with = "present_nullable",
750        skip_serializing_if = "Option::is_none"
751    )]
752    pub server_tool_use: Option<Option<ServerToolUsage>>,
753    #[serde(
754        default,
755        deserialize_with = "present_nullable",
756        skip_serializing_if = "Option::is_none"
757    )]
758    pub service_tier: Option<Option<ResponseServiceTier>>,
759    #[serde(
760        default,
761        deserialize_with = "present_nullable",
762        skip_serializing_if = "Option::is_none"
763    )]
764    pub speed: Option<Option<Speed>>,
765    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
766    pub rest: Rest,
767}
768
769#[derive(
770    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
771)]
772#[serde(rename_all = "snake_case")]
773#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
774#[derive(gproxy_protocol_macros::DeclaredFields)]
775#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
776pub struct OutputTokensDetails {
777    pub thinking_tokens: i64,
778    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
779    pub rest: Rest,
780}
781
782#[derive(
783    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
784)]
785#[serde(rename_all = "snake_case")]
786#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
787#[derive(gproxy_protocol_macros::DeclaredFields)]
788#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
789pub struct ServerToolUsage {
790    pub web_fetch_requests: i64,
791    pub web_search_requests: i64,
792    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
793    pub rest: Rest,
794}
795
796#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
797#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
798#[derive(gproxy_protocol_macros::DeclaredFields)]
799#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
800pub enum ResponseServiceTier {
801    #[serde(rename = "standard")]
802    Standard,
803    #[serde(rename = "priority")]
804    Priority,
805    #[serde(rename = "batch")]
806    Batch,
807}
808
809#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
810#[serde(untagged)]
811#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
812#[derive(gproxy_protocol_macros::DeclaredFields)]
813#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
814pub enum IterationUsage {
815    Message(MessageIterationUsage),
816    Compaction(CompactionIterationUsage),
817    Advisor(AdvisorMessageIterationUsage),
818    Fallback(FallbackMessageIterationUsage),
819}
820
821#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
822#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
823#[derive(gproxy_protocol_macros::DeclaredFields)]
824#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
825pub enum MessageIterationUsageType {
826    #[serde(rename = "message")]
827    Tag,
828}
829
830#[derive(
831    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
832)]
833#[serde(rename_all = "snake_case")]
834#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
835#[derive(gproxy_protocol_macros::DeclaredFields)]
836#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
837pub struct MessageIterationUsage {
838    #[serde(rename = "type")]
839    pub type_: MessageIterationUsageType,
840    #[serde(
841        default,
842        deserialize_with = "present_nullable",
843        skip_serializing_if = "Option::is_none"
844    )]
845    pub cache_creation: Option<Option<CacheCreation>>,
846    pub cache_creation_input_tokens: i64,
847    pub cache_read_input_tokens: i64,
848    pub input_tokens: i64,
849    pub model: String,
850    pub output_tokens: i64,
851    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
852    pub rest: Rest,
853}
854
855#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
856#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
857#[derive(gproxy_protocol_macros::DeclaredFields)]
858#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
859pub enum CompactionIterationUsageType {
860    #[serde(rename = "compaction")]
861    Tag,
862}
863
864#[derive(
865    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
866)]
867#[serde(rename_all = "snake_case")]
868#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
869#[derive(gproxy_protocol_macros::DeclaredFields)]
870#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
871pub struct CompactionIterationUsage {
872    #[serde(rename = "type")]
873    pub type_: CompactionIterationUsageType,
874    #[serde(
875        default,
876        deserialize_with = "present_nullable",
877        skip_serializing_if = "Option::is_none"
878    )]
879    pub cache_creation: Option<Option<CacheCreation>>,
880    pub cache_creation_input_tokens: i64,
881    pub cache_read_input_tokens: i64,
882    pub input_tokens: i64,
883    pub output_tokens: i64,
884    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
885    pub rest: Rest,
886}
887
888#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
889#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
890#[derive(gproxy_protocol_macros::DeclaredFields)]
891#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
892pub enum AdvisorMessageIterationUsageType {
893    #[serde(rename = "advisor_message")]
894    Tag,
895}
896
897#[derive(
898    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
899)]
900#[serde(rename_all = "snake_case")]
901#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
902#[derive(gproxy_protocol_macros::DeclaredFields)]
903#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
904pub struct AdvisorMessageIterationUsage {
905    #[serde(rename = "type")]
906    pub type_: AdvisorMessageIterationUsageType,
907    #[serde(
908        default,
909        deserialize_with = "present_nullable",
910        skip_serializing_if = "Option::is_none"
911    )]
912    pub cache_creation: Option<Option<CacheCreation>>,
913    pub cache_creation_input_tokens: i64,
914    pub cache_read_input_tokens: i64,
915    pub input_tokens: i64,
916    pub model: String,
917    pub output_tokens: i64,
918    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
919    pub rest: Rest,
920}
921
922#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
923#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
924#[derive(gproxy_protocol_macros::DeclaredFields)]
925#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
926pub enum FallbackMessageIterationUsageType {
927    #[serde(rename = "fallback_message")]
928    Tag,
929}
930
931#[derive(
932    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
933)]
934#[serde(rename_all = "snake_case")]
935#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
936#[derive(gproxy_protocol_macros::DeclaredFields)]
937#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
938pub struct FallbackMessageIterationUsage {
939    #[serde(rename = "type")]
940    pub type_: FallbackMessageIterationUsageType,
941    #[serde(
942        default,
943        deserialize_with = "present_nullable",
944        skip_serializing_if = "Option::is_none"
945    )]
946    pub cache_creation: Option<Option<CacheCreation>>,
947    pub cache_creation_input_tokens: i64,
948    pub cache_read_input_tokens: i64,
949    pub input_tokens: i64,
950    pub model: String,
951    pub output_tokens: i64,
952    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
953    pub rest: Rest,
954}
955
956#[derive(
957    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
958)]
959#[serde(rename_all = "snake_case")]
960#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
961#[derive(gproxy_protocol_macros::DeclaredFields)]
962#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
963pub struct FallbackCreditUsage {
964    pub status: FallbackCreditStatus,
965    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
966    pub rest: Rest,
967}
968
969#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
970#[serde(untagged)]
971#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
972#[derive(gproxy_protocol_macros::DeclaredFields)]
973#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
974pub enum FallbackCreditStatus {
975    Redeemed(FallbackRedeemed),
976    NotApplied(FallbackNotApplied),
977}
978
979#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
980#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
981#[derive(gproxy_protocol_macros::DeclaredFields)]
982#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
983pub enum FallbackRedeemedType {
984    #[serde(rename = "redeemed")]
985    Tag,
986}
987
988#[derive(
989    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
990)]
991#[serde(rename_all = "snake_case")]
992#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
993#[derive(gproxy_protocol_macros::DeclaredFields)]
994#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
995pub struct FallbackRedeemed {
996    #[serde(rename = "type")]
997    pub type_: FallbackRedeemedType,
998    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
999    pub rest: Rest,
1000}
1001
1002#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1003#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1004#[derive(gproxy_protocol_macros::DeclaredFields)]
1005#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1006pub enum FallbackNotAppliedType {
1007    #[serde(rename = "not_applied")]
1008    Tag,
1009}
1010
1011#[derive(
1012    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1013)]
1014#[serde(rename_all = "snake_case")]
1015#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1016#[derive(gproxy_protocol_macros::DeclaredFields)]
1017#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1018pub struct FallbackNotApplied {
1019    #[serde(rename = "type")]
1020    pub type_: FallbackNotAppliedType,
1021    pub reason: FallbackNotAppliedReason,
1022    #[serde(skip_serializing_if = "Option::is_none")]
1023    pub remove_to_redeem: Option<Vec<String>>,
1024    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1025    pub rest: Rest,
1026}
1027
1028#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1029#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1030#[derive(gproxy_protocol_macros::DeclaredFields)]
1031#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1032pub enum FallbackNotAppliedReason {
1033    #[serde(rename = "body_mismatch")]
1034    BodyMismatch,
1035    #[serde(rename = "continuation_excluded")]
1036    ContinuationExcluded,
1037    #[serde(rename = "continuation_only")]
1038    ContinuationOnly,
1039    #[serde(rename = "expired")]
1040    Expired,
1041    #[serde(rename = "invalid_target_model")]
1042    InvalidTargetModel,
1043    #[serde(rename = "not_enabled")]
1044    NotEnabled,
1045    #[serde(rename = "reprice_unavailable")]
1046    RepriceUnavailable,
1047    #[serde(rename = "temporarily_unavailable")]
1048    TemporarilyUnavailable,
1049    #[serde(rename = "variant_fields_present")]
1050    VariantFieldsPresent,
1051    #[serde(rename = "wrong_organization")]
1052    WrongOrganization,
1053    #[serde(rename = "wrong_platform")]
1054    WrongPlatform,
1055    #[serde(rename = "wrong_workspace")]
1056    WrongWorkspace,
1057}
1058
1059// The response union deliberately excludes request-only image/document/tool-result
1060// and conversation-edit blocks. Shared leaves below have identical wire contracts.
1061#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1062#[serde(untagged)]
1063#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1064#[derive(gproxy_protocol_macros::DeclaredFields)]
1065#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1066pub enum ResponseContentBlock {
1067    Text(ResponseTextBlock),
1068    Thinking(content::ThinkingBlock),
1069    RedactedThinking(content::RedactedThinkingBlock),
1070    ToolUse(ResponseToolUseBlock),
1071    ServerToolUse(ResponseServerToolUseBlock),
1072    WebSearchToolResult(ResponseWebSearchToolResultBlock),
1073    WebFetchToolResult(ResponseWebFetchToolResultBlock),
1074    AdvisorToolResult(ResponseAdvisorToolResultBlock),
1075    CodeExecutionToolResult(ResponseCodeExecutionToolResultBlock),
1076    BashCodeExecutionToolResult(ResponseBashCodeExecutionToolResultBlock),
1077    TextEditorCodeExecutionToolResult(ResponseTextEditorCodeExecutionToolResultBlock),
1078    ToolSearchToolResult(ResponseToolSearchToolResultBlock),
1079    McpToolListing(content::McpToolListingBlock),
1080    McpToolUse(ResponseMcpToolUseBlock),
1081    McpToolResult(ResponseMcpToolResultBlock),
1082    ContainerUpload(ResponseContainerUploadBlock),
1083    Compaction(ResponseCompactionBlock),
1084    Fallback(ResponseFallbackBlock),
1085}
1086
1087#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1088#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1089#[derive(gproxy_protocol_macros::DeclaredFields)]
1090#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1091pub enum ResponseTextBlockType {
1092    #[serde(rename = "text")]
1093    Tag,
1094}
1095
1096#[derive(
1097    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1098)]
1099#[serde(rename_all = "snake_case")]
1100#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1101#[derive(gproxy_protocol_macros::DeclaredFields)]
1102#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1103pub struct ResponseTextBlock {
1104    #[serde(rename = "type")]
1105    pub type_: ResponseTextBlockType,
1106    #[serde(
1107        default,
1108        deserialize_with = "present_nullable",
1109        skip_serializing_if = "Option::is_none"
1110    )]
1111    pub citations: Option<Option<Vec<ResponseTextCitation>>>,
1112    pub text: String,
1113    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1114    pub rest: Rest,
1115}
1116
1117#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1118#[serde(untagged)]
1119#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1120#[derive(gproxy_protocol_macros::DeclaredFields)]
1121#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1122pub enum ResponseTextCitation {
1123    Char(ResponseCharCitation),
1124    Page(ResponsePageCitation),
1125    ContentBlock(ResponseContentBlockCitation),
1126    Web(ResponseWebCitation),
1127    Search(ResponseSearchCitation),
1128}
1129
1130#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1131#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1132#[derive(gproxy_protocol_macros::DeclaredFields)]
1133#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1134pub enum ResponseCharCitationType {
1135    #[serde(rename = "char_location")]
1136    Tag,
1137}
1138
1139#[derive(
1140    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1141)]
1142#[serde(rename_all = "snake_case")]
1143#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1144#[derive(gproxy_protocol_macros::DeclaredFields)]
1145#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1146pub struct ResponseCharCitation {
1147    #[serde(rename = "type")]
1148    pub type_: ResponseCharCitationType,
1149    pub cited_text: String,
1150    pub document_index: i64,
1151    #[serde(
1152        default,
1153        deserialize_with = "present_nullable",
1154        skip_serializing_if = "Option::is_none"
1155    )]
1156    pub document_title: Option<Option<String>>,
1157    #[serde(
1158        default,
1159        deserialize_with = "present_nullable",
1160        skip_serializing_if = "Option::is_none"
1161    )]
1162    pub file_id: Option<Option<String>>,
1163    pub end_char_index: i64,
1164    pub start_char_index: i64,
1165    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1166    pub rest: Rest,
1167}
1168
1169#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1170#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1171#[derive(gproxy_protocol_macros::DeclaredFields)]
1172#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1173pub enum ResponsePageCitationType {
1174    #[serde(rename = "page_location")]
1175    Tag,
1176}
1177
1178#[derive(
1179    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1180)]
1181#[serde(rename_all = "snake_case")]
1182#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1183#[derive(gproxy_protocol_macros::DeclaredFields)]
1184#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1185pub struct ResponsePageCitation {
1186    #[serde(rename = "type")]
1187    pub type_: ResponsePageCitationType,
1188    pub cited_text: String,
1189    pub document_index: i64,
1190    #[serde(
1191        default,
1192        deserialize_with = "present_nullable",
1193        skip_serializing_if = "Option::is_none"
1194    )]
1195    pub document_title: Option<Option<String>>,
1196    #[serde(
1197        default,
1198        deserialize_with = "present_nullable",
1199        skip_serializing_if = "Option::is_none"
1200    )]
1201    pub file_id: Option<Option<String>>,
1202    pub end_page_number: i64,
1203    pub start_page_number: i64,
1204    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1205    pub rest: Rest,
1206}
1207
1208#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1209#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1210#[derive(gproxy_protocol_macros::DeclaredFields)]
1211#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1212pub enum ResponseContentBlockCitationType {
1213    #[serde(rename = "content_block_location")]
1214    Tag,
1215}
1216
1217#[derive(
1218    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1219)]
1220#[serde(rename_all = "snake_case")]
1221#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1222#[derive(gproxy_protocol_macros::DeclaredFields)]
1223#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1224pub struct ResponseContentBlockCitation {
1225    #[serde(rename = "type")]
1226    pub type_: ResponseContentBlockCitationType,
1227    pub cited_text: String,
1228    pub document_index: i64,
1229    #[serde(
1230        default,
1231        deserialize_with = "present_nullable",
1232        skip_serializing_if = "Option::is_none"
1233    )]
1234    pub document_title: Option<Option<String>>,
1235    #[serde(
1236        default,
1237        deserialize_with = "present_nullable",
1238        skip_serializing_if = "Option::is_none"
1239    )]
1240    pub file_id: Option<Option<String>>,
1241    pub end_block_index: i64,
1242    pub start_block_index: i64,
1243    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1244    pub rest: Rest,
1245}
1246
1247#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1248#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1249#[derive(gproxy_protocol_macros::DeclaredFields)]
1250#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1251pub enum ResponseWebCitationType {
1252    #[serde(rename = "web_search_result_location")]
1253    Tag,
1254}
1255
1256#[derive(
1257    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1258)]
1259#[serde(rename_all = "snake_case")]
1260#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1261#[derive(gproxy_protocol_macros::DeclaredFields)]
1262#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1263pub struct ResponseWebCitation {
1264    #[serde(rename = "type")]
1265    pub type_: ResponseWebCitationType,
1266    pub cited_text: String,
1267    pub encrypted_index: String,
1268    #[serde(
1269        default,
1270        deserialize_with = "present_nullable",
1271        skip_serializing_if = "Option::is_none"
1272    )]
1273    pub title: Option<Option<String>>,
1274    pub url: String,
1275    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1276    pub rest: Rest,
1277}
1278
1279#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1280#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1281#[derive(gproxy_protocol_macros::DeclaredFields)]
1282#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1283pub enum ResponseSearchCitationType {
1284    #[serde(rename = "search_result_location")]
1285    Tag,
1286}
1287
1288#[derive(
1289    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1290)]
1291#[serde(rename_all = "snake_case")]
1292#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1293#[derive(gproxy_protocol_macros::DeclaredFields)]
1294#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1295pub struct ResponseSearchCitation {
1296    #[serde(rename = "type")]
1297    pub type_: ResponseSearchCitationType,
1298    pub cited_text: String,
1299    pub end_block_index: i64,
1300    pub search_result_index: i64,
1301    pub source: String,
1302    pub start_block_index: i64,
1303    #[serde(
1304        default,
1305        deserialize_with = "present_nullable",
1306        skip_serializing_if = "Option::is_none"
1307    )]
1308    pub title: Option<Option<String>>,
1309    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1310    pub rest: Rest,
1311}
1312
1313#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1314#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1315#[derive(gproxy_protocol_macros::DeclaredFields)]
1316#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1317pub enum ResponseToolUseBlockType {
1318    #[serde(rename = "tool_use")]
1319    Tag,
1320}
1321
1322#[derive(
1323    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1324)]
1325#[serde(rename_all = "snake_case")]
1326#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1327#[derive(gproxy_protocol_macros::DeclaredFields)]
1328#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1329pub struct ResponseToolUseBlock {
1330    #[serde(
1331        default,
1332        deserialize_with = "present_nullable",
1333        skip_serializing_if = "Option::is_none"
1334    )]
1335    pub toolset_name: Option<Option<String>>,
1336
1337    #[serde(rename = "type")]
1338    pub type_: ResponseToolUseBlockType,
1339    pub id: String,
1340    pub input: serde_json::Map<String, serde_json::Value>,
1341    pub name: String,
1342    #[serde(
1343        default,
1344        deserialize_with = "present_nullable",
1345        skip_serializing_if = "Option::is_none"
1346    )]
1347    pub caller: Option<Option<content::Caller>>,
1348    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1349    pub rest: Rest,
1350}
1351
1352#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1353#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1354#[derive(gproxy_protocol_macros::DeclaredFields)]
1355#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1356pub enum ResponseServerToolUseBlockType {
1357    #[serde(rename = "server_tool_use")]
1358    Tag,
1359}
1360
1361#[derive(
1362    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1363)]
1364#[serde(rename_all = "snake_case")]
1365#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1366#[derive(gproxy_protocol_macros::DeclaredFields)]
1367#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1368pub struct ResponseServerToolUseBlock {
1369    #[serde(rename = "type")]
1370    pub type_: ResponseServerToolUseBlockType,
1371    pub id: String,
1372    pub input: serde_json::Map<String, serde_json::Value>,
1373    pub name: content::ServerToolName,
1374    #[serde(
1375        default,
1376        deserialize_with = "present_nullable",
1377        skip_serializing_if = "Option::is_none"
1378    )]
1379    pub caller: Option<Option<content::Caller>>,
1380    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1381    pub rest: Rest,
1382}
1383
1384#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1385#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1386#[derive(gproxy_protocol_macros::DeclaredFields)]
1387#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1388pub enum ResponseWebSearchToolResultBlockType {
1389    #[serde(rename = "web_search_tool_result")]
1390    Tag,
1391}
1392
1393#[derive(
1394    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1395)]
1396#[serde(rename_all = "snake_case")]
1397#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1398#[derive(gproxy_protocol_macros::DeclaredFields)]
1399#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1400pub struct ResponseWebSearchToolResultBlock {
1401    #[serde(rename = "type")]
1402    pub type_: ResponseWebSearchToolResultBlockType,
1403    pub content: ResponseWebSearchResultContent,
1404    pub tool_use_id: String,
1405    #[serde(
1406        default,
1407        deserialize_with = "present_nullable",
1408        skip_serializing_if = "Option::is_none"
1409    )]
1410    pub caller: Option<Option<content::Caller>>,
1411    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1412    pub rest: Rest,
1413}
1414
1415#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1416#[serde(untagged)]
1417#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1418#[derive(gproxy_protocol_macros::DeclaredFields)]
1419#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1420pub enum ResponseWebSearchResultContent {
1421    Error(content::WebSearchError),
1422    Results(Vec<ResponseWebSearchResult>),
1423}
1424
1425#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1426#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1427#[derive(gproxy_protocol_macros::DeclaredFields)]
1428#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1429pub enum ResponseWebSearchResultType {
1430    #[serde(rename = "web_search_result")]
1431    Tag,
1432}
1433
1434#[derive(
1435    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1436)]
1437#[serde(rename_all = "snake_case")]
1438#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1439#[derive(gproxy_protocol_macros::DeclaredFields)]
1440#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1441pub struct ResponseWebSearchResult {
1442    #[serde(rename = "type")]
1443    pub type_: ResponseWebSearchResultType,
1444    pub encrypted_content: String,
1445    #[serde(
1446        default,
1447        deserialize_with = "present_nullable",
1448        skip_serializing_if = "Option::is_none"
1449    )]
1450    pub page_age: Option<Option<String>>,
1451    pub title: String,
1452    pub url: String,
1453    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1454    pub rest: Rest,
1455}
1456
1457#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1458#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1459#[derive(gproxy_protocol_macros::DeclaredFields)]
1460#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1461pub enum ResponseWebFetchToolResultBlockType {
1462    #[serde(rename = "web_fetch_tool_result")]
1463    Tag,
1464}
1465
1466#[derive(
1467    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1468)]
1469#[serde(rename_all = "snake_case")]
1470#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1471#[derive(gproxy_protocol_macros::DeclaredFields)]
1472#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1473pub struct ResponseWebFetchToolResultBlock {
1474    #[serde(rename = "type")]
1475    pub type_: ResponseWebFetchToolResultBlockType,
1476    pub content: ResponseWebFetchResultContent,
1477    pub tool_use_id: String,
1478    #[serde(
1479        default,
1480        deserialize_with = "present_nullable",
1481        skip_serializing_if = "Option::is_none"
1482    )]
1483    pub caller: Option<Option<content::Caller>>,
1484    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1485    pub rest: Rest,
1486}
1487
1488#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1489#[serde(untagged)]
1490#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1491#[derive(gproxy_protocol_macros::DeclaredFields)]
1492#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1493pub enum ResponseWebFetchResultContent {
1494    Error(content::WebFetchError),
1495    Result(ResponseWebFetchResult),
1496}
1497
1498#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1499#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1500#[derive(gproxy_protocol_macros::DeclaredFields)]
1501#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1502pub enum ResponseWebFetchResultType {
1503    #[serde(rename = "web_fetch_result")]
1504    Tag,
1505}
1506
1507#[derive(
1508    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1509)]
1510#[serde(rename_all = "snake_case")]
1511#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1512#[derive(gproxy_protocol_macros::DeclaredFields)]
1513#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1514pub struct ResponseWebFetchResult {
1515    #[serde(rename = "type")]
1516    pub type_: ResponseWebFetchResultType,
1517    pub content: ResponseDocumentBlock,
1518    #[serde(
1519        default,
1520        deserialize_with = "present_nullable",
1521        skip_serializing_if = "Option::is_none"
1522    )]
1523    pub retrieved_at: Option<Option<String>>,
1524    pub url: String,
1525    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1526    pub rest: Rest,
1527}
1528
1529#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1530#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1531#[derive(gproxy_protocol_macros::DeclaredFields)]
1532#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1533pub enum ResponseDocumentBlockType {
1534    #[serde(rename = "document")]
1535    Tag,
1536}
1537
1538#[derive(
1539    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1540)]
1541#[serde(rename_all = "snake_case")]
1542#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1543#[derive(gproxy_protocol_macros::DeclaredFields)]
1544#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1545pub struct ResponseDocumentBlock {
1546    #[serde(rename = "type")]
1547    pub type_: ResponseDocumentBlockType,
1548    #[serde(
1549        default,
1550        deserialize_with = "present_nullable",
1551        skip_serializing_if = "Option::is_none"
1552    )]
1553    pub citations: Option<Option<ResponseCitationConfig>>,
1554    pub source: ResponseDocumentSource,
1555    #[serde(
1556        default,
1557        deserialize_with = "present_nullable",
1558        skip_serializing_if = "Option::is_none"
1559    )]
1560    pub title: Option<Option<String>>,
1561    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1562    pub rest: Rest,
1563}
1564
1565#[derive(
1566    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1567)]
1568#[serde(rename_all = "snake_case")]
1569#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1570#[derive(gproxy_protocol_macros::DeclaredFields)]
1571#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1572pub struct ResponseCitationConfig {
1573    pub enabled: bool,
1574    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1575    pub rest: Rest,
1576}
1577
1578#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1579#[serde(tag = "type")]
1580#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1581#[derive(gproxy_protocol_macros::DeclaredFields)]
1582#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1583pub enum ResponseDocumentSource {
1584    #[serde(rename = "base64")]
1585    Base64(content::PdfBase64Source),
1586    #[serde(rename = "text")]
1587    Text(content::PlainTextSource),
1588}
1589
1590#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1591#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1592#[derive(gproxy_protocol_macros::DeclaredFields)]
1593#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1594pub enum ResponseAdvisorToolResultBlockType {
1595    #[serde(rename = "advisor_tool_result")]
1596    Tag,
1597}
1598
1599#[derive(
1600    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1601)]
1602#[serde(rename_all = "snake_case")]
1603#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1604#[derive(gproxy_protocol_macros::DeclaredFields)]
1605#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1606pub struct ResponseAdvisorToolResultBlock {
1607    #[serde(rename = "type")]
1608    pub type_: ResponseAdvisorToolResultBlockType,
1609    pub content: ResponseAdvisorResultContent,
1610    pub tool_use_id: String,
1611    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1612    pub rest: Rest,
1613}
1614
1615#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1616#[serde(untagged)]
1617#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1618#[derive(gproxy_protocol_macros::DeclaredFields)]
1619#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1620pub enum ResponseAdvisorResultContent {
1621    Error(content::AdvisorError),
1622    Result(ResponseAdvisorResult),
1623    Redacted(ResponseAdvisorRedactedResult),
1624}
1625
1626#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1627#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1628#[derive(gproxy_protocol_macros::DeclaredFields)]
1629#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1630pub enum ResponseAdvisorResultType {
1631    #[serde(rename = "advisor_result")]
1632    Tag,
1633}
1634
1635#[derive(
1636    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1637)]
1638#[serde(rename_all = "snake_case")]
1639#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1640#[derive(gproxy_protocol_macros::DeclaredFields)]
1641#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1642pub struct ResponseAdvisorResult {
1643    #[serde(rename = "type")]
1644    pub type_: ResponseAdvisorResultType,
1645    #[serde(
1646        default,
1647        deserialize_with = "present_nullable",
1648        skip_serializing_if = "Option::is_none"
1649    )]
1650    pub stop_reason: Option<Option<String>>,
1651    pub text: String,
1652    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1653    pub rest: Rest,
1654}
1655
1656#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1657#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1658#[derive(gproxy_protocol_macros::DeclaredFields)]
1659#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1660pub enum ResponseAdvisorRedactedResultType {
1661    #[serde(rename = "advisor_redacted_result")]
1662    Tag,
1663}
1664
1665#[derive(
1666    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1667)]
1668#[serde(rename_all = "snake_case")]
1669#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1670#[derive(gproxy_protocol_macros::DeclaredFields)]
1671#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1672pub struct ResponseAdvisorRedactedResult {
1673    #[serde(rename = "type")]
1674    pub type_: ResponseAdvisorRedactedResultType,
1675    pub encrypted_content: String,
1676    #[serde(
1677        default,
1678        deserialize_with = "present_nullable",
1679        skip_serializing_if = "Option::is_none"
1680    )]
1681    pub stop_reason: Option<Option<String>>,
1682    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1683    pub rest: Rest,
1684}
1685
1686#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1687#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1688#[derive(gproxy_protocol_macros::DeclaredFields)]
1689#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1690pub enum ResponseCodeExecutionToolResultBlockType {
1691    #[serde(rename = "code_execution_tool_result")]
1692    Tag,
1693}
1694
1695#[derive(
1696    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1697)]
1698#[serde(rename_all = "snake_case")]
1699#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1700#[derive(gproxy_protocol_macros::DeclaredFields)]
1701#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1702pub struct ResponseCodeExecutionToolResultBlock {
1703    #[serde(rename = "type")]
1704    pub type_: ResponseCodeExecutionToolResultBlockType,
1705    pub content: content::CodeExecutionResultContent,
1706    pub tool_use_id: String,
1707    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1708    pub rest: Rest,
1709}
1710
1711#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1712#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1713#[derive(gproxy_protocol_macros::DeclaredFields)]
1714#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1715pub enum ResponseBashCodeExecutionToolResultBlockType {
1716    #[serde(rename = "bash_code_execution_tool_result")]
1717    Tag,
1718}
1719
1720#[derive(
1721    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1722)]
1723#[serde(rename_all = "snake_case")]
1724#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1725#[derive(gproxy_protocol_macros::DeclaredFields)]
1726#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1727pub struct ResponseBashCodeExecutionToolResultBlock {
1728    #[serde(rename = "type")]
1729    pub type_: ResponseBashCodeExecutionToolResultBlockType,
1730    pub content: content::BashCodeExecutionResultContent,
1731    pub tool_use_id: String,
1732    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1733    pub rest: Rest,
1734}
1735
1736#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1737#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1738#[derive(gproxy_protocol_macros::DeclaredFields)]
1739#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1740pub enum ResponseTextEditorCodeExecutionToolResultBlockType {
1741    #[serde(rename = "text_editor_code_execution_tool_result")]
1742    Tag,
1743}
1744
1745#[derive(
1746    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1747)]
1748#[serde(rename_all = "snake_case")]
1749#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1750#[derive(gproxy_protocol_macros::DeclaredFields)]
1751#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1752pub struct ResponseTextEditorCodeExecutionToolResultBlock {
1753    #[serde(rename = "type")]
1754    pub type_: ResponseTextEditorCodeExecutionToolResultBlockType,
1755    pub content: ResponseTextEditorResultContent,
1756    pub tool_use_id: String,
1757    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1758    pub rest: Rest,
1759}
1760
1761#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1762#[serde(untagged)]
1763#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1764#[derive(gproxy_protocol_macros::DeclaredFields)]
1765#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1766pub enum ResponseTextEditorResultContent {
1767    Error(ResponseTextEditorError),
1768    View(ResponseTextEditorViewResult),
1769    Create(content::TextEditorCreateResult),
1770    Replace(ResponseTextEditorReplaceResult),
1771}
1772
1773#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1774#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1775#[derive(gproxy_protocol_macros::DeclaredFields)]
1776#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1777pub enum ResponseTextEditorErrorType {
1778    #[serde(rename = "text_editor_code_execution_tool_result_error")]
1779    Tag,
1780}
1781
1782#[derive(
1783    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1784)]
1785#[serde(rename_all = "snake_case")]
1786#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1787#[derive(gproxy_protocol_macros::DeclaredFields)]
1788#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1789pub struct ResponseTextEditorError {
1790    #[serde(rename = "type")]
1791    pub type_: ResponseTextEditorErrorType,
1792    pub error_code: content::TextEditorErrorCode,
1793    #[serde(
1794        default,
1795        deserialize_with = "present_nullable",
1796        skip_serializing_if = "Option::is_none"
1797    )]
1798    pub error_message: Option<Option<String>>,
1799    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1800    pub rest: Rest,
1801}
1802
1803#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1804#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1805#[derive(gproxy_protocol_macros::DeclaredFields)]
1806#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1807pub enum ResponseTextEditorViewResultType {
1808    #[serde(rename = "text_editor_code_execution_view_result")]
1809    Tag,
1810}
1811
1812#[derive(
1813    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1814)]
1815#[serde(rename_all = "snake_case")]
1816#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1817#[derive(gproxy_protocol_macros::DeclaredFields)]
1818#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1819pub struct ResponseTextEditorViewResult {
1820    #[serde(rename = "type")]
1821    pub type_: ResponseTextEditorViewResultType,
1822    pub content: String,
1823    pub file_type: content::TextEditorFileType,
1824    #[serde(
1825        default,
1826        deserialize_with = "present_nullable",
1827        skip_serializing_if = "Option::is_none"
1828    )]
1829    pub num_lines: Option<Option<i64>>,
1830    #[serde(
1831        default,
1832        deserialize_with = "present_nullable",
1833        skip_serializing_if = "Option::is_none"
1834    )]
1835    pub start_line: Option<Option<i64>>,
1836    #[serde(
1837        default,
1838        deserialize_with = "present_nullable",
1839        skip_serializing_if = "Option::is_none"
1840    )]
1841    pub total_lines: Option<Option<i64>>,
1842    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1843    pub rest: Rest,
1844}
1845
1846#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1847#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1848#[derive(gproxy_protocol_macros::DeclaredFields)]
1849#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1850pub enum ResponseTextEditorReplaceResultType {
1851    #[serde(rename = "text_editor_code_execution_str_replace_result")]
1852    Tag,
1853}
1854
1855#[derive(
1856    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1857)]
1858#[serde(rename_all = "snake_case")]
1859#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1860#[derive(gproxy_protocol_macros::DeclaredFields)]
1861#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1862pub struct ResponseTextEditorReplaceResult {
1863    #[serde(rename = "type")]
1864    pub type_: ResponseTextEditorReplaceResultType,
1865    #[serde(
1866        default,
1867        deserialize_with = "present_nullable",
1868        skip_serializing_if = "Option::is_none"
1869    )]
1870    pub lines: Option<Option<Vec<String>>>,
1871    #[serde(
1872        default,
1873        deserialize_with = "present_nullable",
1874        skip_serializing_if = "Option::is_none"
1875    )]
1876    pub new_lines: Option<Option<i64>>,
1877    #[serde(
1878        default,
1879        deserialize_with = "present_nullable",
1880        skip_serializing_if = "Option::is_none"
1881    )]
1882    pub new_start: Option<Option<i64>>,
1883    #[serde(
1884        default,
1885        deserialize_with = "present_nullable",
1886        skip_serializing_if = "Option::is_none"
1887    )]
1888    pub old_lines: Option<Option<i64>>,
1889    #[serde(
1890        default,
1891        deserialize_with = "present_nullable",
1892        skip_serializing_if = "Option::is_none"
1893    )]
1894    pub old_start: Option<Option<i64>>,
1895    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1896    pub rest: Rest,
1897}
1898
1899#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1900#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1901#[derive(gproxy_protocol_macros::DeclaredFields)]
1902#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1903pub enum ResponseToolSearchToolResultBlockType {
1904    #[serde(rename = "tool_search_tool_result")]
1905    Tag,
1906}
1907
1908#[derive(
1909    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1910)]
1911#[serde(rename_all = "snake_case")]
1912#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1913#[derive(gproxy_protocol_macros::DeclaredFields)]
1914#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1915pub struct ResponseToolSearchToolResultBlock {
1916    #[serde(rename = "type")]
1917    pub type_: ResponseToolSearchToolResultBlockType,
1918    pub content: ResponseToolSearchResultContent,
1919    pub tool_use_id: String,
1920    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1921    pub rest: Rest,
1922}
1923
1924#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
1925#[serde(untagged)]
1926#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1927#[derive(gproxy_protocol_macros::DeclaredFields)]
1928#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1929pub enum ResponseToolSearchResultContent {
1930    Error(ResponseToolSearchError),
1931    Search(ResponseToolSearchResults),
1932}
1933
1934#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1935#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1936#[derive(gproxy_protocol_macros::DeclaredFields)]
1937#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1938pub enum ResponseToolSearchErrorType {
1939    #[serde(rename = "tool_search_tool_result_error")]
1940    Tag,
1941}
1942
1943#[derive(
1944    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1945)]
1946#[serde(rename_all = "snake_case")]
1947#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1948#[derive(gproxy_protocol_macros::DeclaredFields)]
1949#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1950pub struct ResponseToolSearchError {
1951    #[serde(rename = "type")]
1952    pub type_: ResponseToolSearchErrorType,
1953    pub error_code: content::ToolSearchErrorCode,
1954    #[serde(
1955        default,
1956        deserialize_with = "present_nullable",
1957        skip_serializing_if = "Option::is_none"
1958    )]
1959    pub error_message: Option<Option<String>>,
1960    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1961    pub rest: Rest,
1962}
1963
1964#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1965#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1966#[derive(gproxy_protocol_macros::DeclaredFields)]
1967#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1968pub enum ResponseToolSearchResultsType {
1969    #[serde(rename = "tool_search_tool_search_result")]
1970    Tag,
1971}
1972
1973#[derive(
1974    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1975)]
1976#[serde(rename_all = "snake_case")]
1977#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1978#[derive(gproxy_protocol_macros::DeclaredFields)]
1979#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1980pub struct ResponseToolSearchResults {
1981    #[serde(rename = "type")]
1982    pub type_: ResponseToolSearchResultsType,
1983    pub tool_references: Vec<ResponseToolReferenceBlock>,
1984    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1985    pub rest: Rest,
1986}
1987
1988#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
1989#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
1990#[derive(gproxy_protocol_macros::DeclaredFields)]
1991#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
1992pub enum ResponseToolReferenceBlockType {
1993    #[serde(rename = "tool_reference")]
1994    Tag,
1995}
1996
1997#[derive(
1998    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
1999)]
2000#[serde(rename_all = "snake_case")]
2001#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2002#[derive(gproxy_protocol_macros::DeclaredFields)]
2003#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2004pub struct ResponseToolReferenceBlock {
2005    #[serde(rename = "type")]
2006    pub type_: ResponseToolReferenceBlockType,
2007    pub tool_name: String,
2008    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2009    pub rest: Rest,
2010}
2011
2012#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
2013#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2014#[derive(gproxy_protocol_macros::DeclaredFields)]
2015#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2016pub enum ResponseMcpToolUseBlockType {
2017    #[serde(rename = "mcp_tool_use")]
2018    Tag,
2019}
2020
2021#[derive(
2022    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
2023)]
2024#[serde(rename_all = "snake_case")]
2025#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2026#[derive(gproxy_protocol_macros::DeclaredFields)]
2027#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2028pub struct ResponseMcpToolUseBlock {
2029    #[serde(rename = "type")]
2030    pub type_: ResponseMcpToolUseBlockType,
2031    pub id: String,
2032    pub input: serde_json::Map<String, serde_json::Value>,
2033    pub name: String,
2034    pub server_name: String,
2035    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2036    pub rest: Rest,
2037}
2038
2039#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
2040#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2041#[derive(gproxy_protocol_macros::DeclaredFields)]
2042#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2043pub enum ResponseMcpToolResultBlockType {
2044    #[serde(rename = "mcp_tool_result")]
2045    Tag,
2046}
2047
2048#[derive(
2049    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
2050)]
2051#[serde(rename_all = "snake_case")]
2052#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2053#[derive(gproxy_protocol_macros::DeclaredFields)]
2054#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2055pub struct ResponseMcpToolResultBlock {
2056    #[serde(rename = "type")]
2057    pub type_: ResponseMcpToolResultBlockType,
2058    pub content: ResponseMcpResultContent,
2059    pub is_error: bool,
2060    pub tool_use_id: String,
2061    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2062    pub rest: Rest,
2063}
2064
2065#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
2066#[serde(untagged)]
2067#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2068#[derive(gproxy_protocol_macros::DeclaredFields)]
2069#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2070pub enum ResponseMcpResultContent {
2071    Text(String),
2072    Blocks(Vec<ResponseTextBlock>),
2073}
2074
2075#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
2076#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2077#[derive(gproxy_protocol_macros::DeclaredFields)]
2078#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2079pub enum ResponseContainerUploadBlockType {
2080    #[serde(rename = "container_upload")]
2081    Tag,
2082}
2083
2084#[derive(
2085    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
2086)]
2087#[serde(rename_all = "snake_case")]
2088#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2089#[derive(gproxy_protocol_macros::DeclaredFields)]
2090#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2091pub struct ResponseContainerUploadBlock {
2092    #[serde(rename = "type")]
2093    pub type_: ResponseContainerUploadBlockType,
2094    pub file_id: String,
2095    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2096    pub rest: Rest,
2097}
2098
2099#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
2100#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2101#[derive(gproxy_protocol_macros::DeclaredFields)]
2102#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2103pub enum ResponseCompactionBlockType {
2104    #[serde(rename = "compaction")]
2105    Tag,
2106}
2107
2108#[derive(
2109    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
2110)]
2111#[serde(rename_all = "snake_case")]
2112#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2113#[derive(gproxy_protocol_macros::DeclaredFields)]
2114#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2115pub struct ResponseCompactionBlock {
2116    #[serde(
2117        default,
2118        deserialize_with = "present_nullable",
2119        skip_serializing_if = "Option::is_none"
2120    )]
2121    pub signature: Option<Option<String>>,
2122
2123    #[serde(rename = "type")]
2124    pub type_: ResponseCompactionBlockType,
2125    #[serde(
2126        default,
2127        deserialize_with = "present_nullable",
2128        skip_serializing_if = "Option::is_none"
2129    )]
2130    pub content: Option<Option<String>>,
2131    #[serde(
2132        default,
2133        deserialize_with = "present_nullable",
2134        skip_serializing_if = "Option::is_none"
2135    )]
2136    pub encrypted_content: Option<Option<String>>,
2137    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2138    pub rest: Rest,
2139}
2140
2141#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
2142#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2143#[derive(gproxy_protocol_macros::DeclaredFields)]
2144#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2145pub enum ResponseFallbackBlockType {
2146    #[serde(rename = "fallback")]
2147    Tag,
2148}
2149
2150#[derive(
2151    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
2152)]
2153#[serde(rename_all = "snake_case")]
2154#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2155#[derive(gproxy_protocol_macros::DeclaredFields)]
2156#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2157pub struct ResponseFallbackBlock {
2158    #[serde(rename = "type")]
2159    pub type_: ResponseFallbackBlockType,
2160    pub from: content::FallbackInfo,
2161    pub to: content::FallbackInfo,
2162    pub trigger: FallbackRefusalTrigger,
2163    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2164    pub rest: Rest,
2165}
2166
2167#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
2168#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2169#[derive(gproxy_protocol_macros::DeclaredFields)]
2170#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2171pub enum FallbackRefusalTriggerType {
2172    #[serde(rename = "refusal")]
2173    Tag,
2174}
2175
2176#[derive(
2177    Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
2178)]
2179#[serde(rename_all = "snake_case")]
2180#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2181#[derive(gproxy_protocol_macros::DeclaredFields)]
2182#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2183pub struct FallbackRefusalTrigger {
2184    #[serde(rename = "type")]
2185    pub type_: FallbackRefusalTriggerType,
2186    #[serde(
2187        default,
2188        deserialize_with = "present_nullable",
2189        skip_serializing_if = "Option::is_none"
2190    )]
2191    pub category: Option<Option<RefusalCategory>>,
2192    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2193    pub rest: Rest,
2194}
2195
2196#[derive(
2197    Debug,
2198    Clone,
2199    Copy,
2200    PartialEq,
2201    Eq,
2202    Serialize,
2203    Deserialize,
2204    gproxy_protocol_macros::DeclaredFields,
2205)]
2206#[serde(rename_all = "snake_case")]
2207#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2208#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2209pub enum CompactionConfigType {
2210    Summarize,
2211}
2212
2213#[derive(
2214    Debug,
2215    Clone,
2216    PartialEq,
2217    Eq,
2218    Serialize,
2219    Deserialize,
2220    gproxy_protocol_macros::WireBuilder,
2221    gproxy_protocol_macros::DeclaredFields,
2222)]
2223#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2224#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2225pub struct CompactionConfig {
2226    #[serde(rename = "type")]
2227    pub type_: CompactionConfigType,
2228    #[serde(skip_serializing_if = "Option::is_none")]
2229    pub instructions: Option<String>,
2230    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2231    pub rest: Rest,
2232}
2233
2234#[derive(
2235    Debug,
2236    Clone,
2237    PartialEq,
2238    Eq,
2239    Serialize,
2240    Deserialize,
2241    gproxy_protocol_macros::WireBuilder,
2242    gproxy_protocol_macros::DeclaredFields,
2243)]
2244#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2245#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2246pub struct InputTransformation {
2247    #[serde(rename = "type")]
2248    pub type_: InputTransformationType,
2249    pub path: String,
2250    pub reason: ThinkingBindingMismatchReason,
2251    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2252    pub rest: Rest,
2253}
2254
2255#[derive(
2256    Debug,
2257    Clone,
2258    Copy,
2259    PartialEq,
2260    Eq,
2261    Serialize,
2262    Deserialize,
2263    gproxy_protocol_macros::DeclaredFields,
2264)]
2265#[serde(rename_all = "snake_case")]
2266#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2267#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2268pub enum InputTransformationType {
2269    ThinkingDropped,
2270    ThinkingMismatchAllowed,
2271    #[serde(other)]
2272    Unknown,
2273}
2274
2275#[derive(
2276    Debug,
2277    Clone,
2278    Copy,
2279    PartialEq,
2280    Eq,
2281    Serialize,
2282    Deserialize,
2283    gproxy_protocol_macros::DeclaredFields,
2284)]
2285#[serde(rename_all = "snake_case")]
2286#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
2287#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
2288pub enum ThinkingBindingMismatchReason {
2289    ModelBindingMismatch,
2290    PrefixBindingMismatch,
2291    OrganizationBindingMismatch,
2292    EndUserBindingMismatch,
2293    #[serde(other)]
2294    Unknown,
2295}