1use super::wire::present_nullable;
6use super::{
7 ConversationItem, Metadata, RealtimeAudioFormats, RealtimeFunctionTool, RealtimeReasoning,
8 ResponsePrompt, ToolChoiceFunction, ToolChoiceMcp, ToolChoiceOptions,
9};
10use crate::Rest;
11use serde::{Deserialize, Serialize};
12
13#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
15#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
16#[derive(gproxy_protocol_macros::DeclaredFields)]
17#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
18pub struct RealtimeResponseCreateParams {
19 #[serde(
20 default,
21 deserialize_with = "present_nullable",
22 skip_serializing_if = "Option::is_none"
23 )]
24 pub audio: Option<Option<RealtimeResponseCreateAudioOutput>>,
25 #[serde(
26 default,
27 deserialize_with = "present_nullable",
28 skip_serializing_if = "Option::is_none"
29 )]
30 pub conversation: Option<Option<String>>,
31 #[serde(
32 default,
33 deserialize_with = "present_nullable",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub input: Option<Option<Vec<ConversationItem>>>,
37 #[serde(
38 default,
39 deserialize_with = "present_nullable",
40 skip_serializing_if = "Option::is_none"
41 )]
42 pub instructions: Option<Option<String>>,
43 #[serde(
44 default,
45 deserialize_with = "present_nullable",
46 skip_serializing_if = "Option::is_none"
47 )]
48 pub max_output_tokens: Option<Option<RealtimeResponseCreateParamsMaxOutputTokens>>,
49 #[serde(
50 default,
51 deserialize_with = "present_nullable",
52 skip_serializing_if = "Option::is_none"
53 )]
54 pub metadata: Option<Option<Metadata>>,
55 #[serde(
56 default,
57 deserialize_with = "present_nullable",
58 skip_serializing_if = "Option::is_none"
59 )]
60 pub output_modalities: Option<Option<Vec<RealtimeResponseCreateParamsOutputModalitiesItem>>>,
61 #[serde(
62 default,
63 deserialize_with = "present_nullable",
64 skip_serializing_if = "Option::is_none"
65 )]
66 pub parallel_tool_calls: Option<Option<bool>>,
67 #[serde(
68 default,
69 deserialize_with = "present_nullable",
70 skip_serializing_if = "Option::is_none"
71 )]
72 pub prompt: Option<Option<ResponsePrompt>>,
73 #[serde(
74 default,
75 deserialize_with = "present_nullable",
76 skip_serializing_if = "Option::is_none"
77 )]
78 pub reasoning: Option<Option<RealtimeReasoning>>,
79 #[serde(
80 default,
81 deserialize_with = "present_nullable",
82 skip_serializing_if = "Option::is_none"
83 )]
84 pub tool_choice: Option<Option<RealtimeResponseCreateParamsToolChoice>>,
85 #[serde(
86 default,
87 deserialize_with = "present_nullable",
88 skip_serializing_if = "Option::is_none"
89 )]
90 pub tools: Option<Option<Vec<RealtimeResponseCreateParamsTool>>>,
91 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
92 pub rest: Rest,
93}
94
95#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
97#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
98#[derive(gproxy_protocol_macros::DeclaredFields)]
99#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
100pub struct RealtimeResponseCreateAudioOutput {
101 #[serde(
102 default,
103 deserialize_with = "present_nullable",
104 skip_serializing_if = "Option::is_none"
105 )]
106 pub output: Option<Option<RealtimeResponseCreateAudioOutputOutput>>,
107 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
108 pub rest: Rest,
109}
110
111#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
113#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
114#[serde(untagged)]
115#[derive(gproxy_protocol_macros::DeclaredFields)]
116#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
117pub enum RealtimeResponseCreateParamsToolChoice {
118 ToolChoiceOptions(ToolChoiceOptions),
119 ToolChoiceFunction(ToolChoiceFunction),
120 ToolChoiceMcp(ToolChoiceMcp),
121}
122
123#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
125#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
126#[serde(untagged)]
127#[allow(clippy::large_enum_variant)]
128#[derive(gproxy_protocol_macros::DeclaredFields)]
129#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
130pub enum RealtimeResponseCreateParamsTool {
131 RealtimeFunctionTool(RealtimeFunctionTool),
132 RealtimeResponseCreateMcpTool(RealtimeResponseCreateMcpTool),
133}
134
135#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
137#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
138#[derive(gproxy_protocol_macros::DeclaredFields)]
139#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
140pub struct RealtimeResponseCreateAudioOutputOutput {
141 #[serde(
142 default,
143 deserialize_with = "present_nullable",
144 skip_serializing_if = "Option::is_none"
145 )]
146 pub format: Option<Option<RealtimeAudioFormats>>,
147 #[serde(
148 default,
149 deserialize_with = "present_nullable",
150 skip_serializing_if = "Option::is_none"
151 )]
152 pub voice: Option<Option<RealtimeResponseCreateAudioOutputOutputVoice>>,
153 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
154 pub rest: Rest,
155}
156
157#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
159#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
160#[derive(gproxy_protocol_macros::DeclaredFields)]
161#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
162pub struct RealtimeResponseCreateMcpTool {
163 pub server_label: String,
164 #[serde(rename = "type")]
165 pub type_: RealtimeResponseCreateMcpToolType,
166 #[serde(
167 default,
168 deserialize_with = "present_nullable",
169 skip_serializing_if = "Option::is_none"
170 )]
171 pub allowed_callers: Option<Option<Vec<RealtimeResponseCreateMcpToolAllowedCallersItem>>>,
172 #[serde(
173 default,
174 deserialize_with = "present_nullable",
175 skip_serializing_if = "Option::is_none"
176 )]
177 pub allowed_tools: Option<Option<RealtimeResponseCreateMcpToolAllowedTools>>,
178 #[serde(
179 default,
180 deserialize_with = "present_nullable",
181 skip_serializing_if = "Option::is_none"
182 )]
183 pub authorization: Option<Option<String>>,
184 #[serde(
185 default,
186 deserialize_with = "present_nullable",
187 skip_serializing_if = "Option::is_none"
188 )]
189 pub connector_id: Option<Option<RealtimeResponseCreateMcpToolConnectorId>>,
190 #[serde(
191 default,
192 deserialize_with = "present_nullable",
193 skip_serializing_if = "Option::is_none"
194 )]
195 pub defer_loading: Option<Option<bool>>,
196 #[serde(
197 default,
198 deserialize_with = "present_nullable",
199 skip_serializing_if = "Option::is_none"
200 )]
201 pub headers: Option<Option<std::collections::BTreeMap<String, String>>>,
202 #[serde(
203 default,
204 deserialize_with = "present_nullable",
205 skip_serializing_if = "Option::is_none"
206 )]
207 pub require_approval: Option<Option<RealtimeResponseCreateMcpToolRequireApproval>>,
208 #[serde(
209 default,
210 deserialize_with = "present_nullable",
211 skip_serializing_if = "Option::is_none"
212 )]
213 pub server_description: Option<Option<String>>,
214 #[serde(
215 default,
216 deserialize_with = "present_nullable",
217 skip_serializing_if = "Option::is_none"
218 )]
219 pub server_url: Option<Option<String>>,
220 #[serde(
221 default,
222 deserialize_with = "present_nullable",
223 skip_serializing_if = "Option::is_none"
224 )]
225 pub tunnel_id: Option<Option<String>>,
226 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
227 pub rest: Rest,
228}
229
230#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
232#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
233#[serde(untagged)]
234#[derive(gproxy_protocol_macros::DeclaredFields)]
235#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
236pub enum RealtimeResponseCreateAudioOutputOutputVoice {
237 Text(String),
238 RealtimeResponseCreateAudioOutputOutputVoiceID(RealtimeResponseCreateAudioOutputOutputVoiceID),
239}
240
241#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
243#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
244#[serde(untagged)]
245#[derive(gproxy_protocol_macros::DeclaredFields)]
246#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
247pub enum RealtimeResponseCreateMcpToolAllowedTools {
248 Items(Vec<String>),
249 RealtimeResponseCreateMcpToolAllowedToolsMcpToolFilter(
250 RealtimeResponseCreateMcpToolAllowedToolsMcpToolFilter,
251 ),
252 Variant3(()),
253}
254
255#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
257#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
258#[serde(untagged)]
259#[derive(gproxy_protocol_macros::DeclaredFields)]
260#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
261pub enum RealtimeResponseCreateMcpToolRequireApproval {
262 RealtimeResponseCreateMcpToolRequireApprovalMcpToolApprovalFilter(
263 RealtimeResponseCreateMcpToolRequireApprovalMcpToolApprovalFilter,
264 ),
265 Literal(RealtimeResponseCreateMcpToolRequireApprovalVariant2),
266 Variant3(()),
267}
268
269#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
271#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
272#[derive(gproxy_protocol_macros::DeclaredFields)]
273#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
274pub struct RealtimeResponseCreateAudioOutputOutputVoiceID {
275 pub id: String,
276 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
277 pub rest: Rest,
278}
279
280#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
282#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
283#[derive(gproxy_protocol_macros::DeclaredFields)]
284#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
285pub struct RealtimeResponseCreateMcpToolAllowedToolsMcpToolFilter {
286 #[serde(
287 default,
288 deserialize_with = "present_nullable",
289 skip_serializing_if = "Option::is_none"
290 )]
291 pub read_only: Option<Option<bool>>,
292 #[serde(
293 default,
294 deserialize_with = "present_nullable",
295 skip_serializing_if = "Option::is_none"
296 )]
297 pub tool_names: Option<Option<Vec<String>>>,
298 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
299 pub rest: Rest,
300}
301
302#[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 RealtimeResponseCreateMcpToolRequireApprovalMcpToolApprovalFilter {
308 #[serde(
309 default,
310 deserialize_with = "present_nullable",
311 skip_serializing_if = "Option::is_none"
312 )]
313 pub always:
314 Option<Option<RealtimeResponseCreateMcpToolRequireApprovalMcpToolApprovalFilterAlways>>,
315 #[serde(
316 default,
317 deserialize_with = "present_nullable",
318 skip_serializing_if = "Option::is_none"
319 )]
320 pub never:
321 Option<Option<RealtimeResponseCreateMcpToolRequireApprovalMcpToolApprovalFilterNever>>,
322 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
323 pub rest: Rest,
324}
325
326#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
328#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
329#[derive(gproxy_protocol_macros::DeclaredFields)]
330#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
331pub struct RealtimeResponseCreateMcpToolRequireApprovalMcpToolApprovalFilterAlways {
332 #[serde(
333 default,
334 deserialize_with = "present_nullable",
335 skip_serializing_if = "Option::is_none"
336 )]
337 pub read_only: Option<Option<bool>>,
338 #[serde(
339 default,
340 deserialize_with = "present_nullable",
341 skip_serializing_if = "Option::is_none"
342 )]
343 pub tool_names: Option<Option<Vec<String>>>,
344 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
345 pub rest: Rest,
346}
347
348#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
350#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
351#[derive(gproxy_protocol_macros::DeclaredFields)]
352#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
353pub struct RealtimeResponseCreateMcpToolRequireApprovalMcpToolApprovalFilterNever {
354 #[serde(
355 default,
356 deserialize_with = "present_nullable",
357 skip_serializing_if = "Option::is_none"
358 )]
359 pub read_only: Option<Option<bool>>,
360 #[serde(
361 default,
362 deserialize_with = "present_nullable",
363 skip_serializing_if = "Option::is_none"
364 )]
365 pub tool_names: Option<Option<Vec<String>>>,
366 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
367 pub rest: Rest,
368}
369
370#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
371#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
372#[derive(gproxy_protocol_macros::DeclaredFields)]
373#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
374pub enum RealtimeResponseCreateParamsMaxOutputTokensVariant2 {
375 #[serde(rename = "inf")]
376 Inf,
377}
378
379#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
380#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
381#[serde(untagged)]
382#[derive(gproxy_protocol_macros::DeclaredFields)]
383#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
384pub enum RealtimeResponseCreateParamsMaxOutputTokens {
385 Number(i64),
386 Literal(RealtimeResponseCreateParamsMaxOutputTokensVariant2),
387}
388
389#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
390#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
391#[derive(gproxy_protocol_macros::DeclaredFields)]
392#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
393pub enum RealtimeResponseCreateParamsOutputModalitiesItem {
394 #[serde(rename = "text")]
395 Text,
396 #[serde(rename = "audio")]
397 Audio,
398}
399
400#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
401#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
402#[derive(gproxy_protocol_macros::DeclaredFields)]
403#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
404pub enum RealtimeResponseCreateMcpToolType {
405 #[serde(rename = "mcp")]
406 Mcp,
407}
408
409#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
410#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
411#[derive(gproxy_protocol_macros::DeclaredFields)]
412#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
413pub enum RealtimeResponseCreateMcpToolAllowedCallersItem {
414 #[serde(rename = "direct")]
415 Direct,
416 #[serde(rename = "programmatic")]
417 Programmatic,
418}
419
420#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
421#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
422#[derive(gproxy_protocol_macros::DeclaredFields)]
423#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
424pub enum RealtimeResponseCreateMcpToolConnectorId {
425 #[serde(rename = "connector_dropbox")]
426 ConnectorDropbox,
427 #[serde(rename = "connector_gmail")]
428 ConnectorGmail,
429 #[serde(rename = "connector_googlecalendar")]
430 ConnectorGooglecalendar,
431 #[serde(rename = "connector_googledrive")]
432 ConnectorGoogledrive,
433 #[serde(rename = "connector_microsoftteams")]
434 ConnectorMicrosoftteams,
435 #[serde(rename = "connector_outlookcalendar")]
436 ConnectorOutlookcalendar,
437 #[serde(rename = "connector_outlookemail")]
438 ConnectorOutlookemail,
439 #[serde(rename = "connector_sharepoint")]
440 ConnectorSharepoint,
441}
442
443#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
444#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
445#[derive(gproxy_protocol_macros::DeclaredFields)]
446#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
447pub enum RealtimeResponseCreateMcpToolRequireApprovalVariant2 {
448 #[serde(rename = "always")]
449 Always,
450 #[serde(rename = "never")]
451 Never,
452}