known_types_openai/
schemas.rs

1// This is free and unencumbered software released into the public domain.
2
3//! OpenAI API schemas
4
5#![allow(non_camel_case_types)]
6
7use crate::prelude::{String, Vec};
8
9#[derive(Clone, Debug, Default)]
10#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11pub struct AddUploadPartRequest {
12    /// The chunk of bytes for this Part.
13    pub r#data: String,
14}
15
16/// Represents an individual Admin API key in an org.
17#[derive(Clone, Debug)]
18#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
19pub struct AdminApiKey {
20    /// The object type, which is always `organization.admin_api_key`
21    pub r#object: String,
22
23    /// The identifier, which can be referenced in API endpoints
24    pub r#id: String,
25
26    /// The name of the API key
27    pub r#name: String,
28
29    /// The redacted value of the API key
30    pub r#redacted_value: String,
31
32    /// The value of the API key.
33    pub r#value: Option<String>,
34
35    /// The Unix timestamp (in seconds) of when the API key was created
36    pub r#created_at: i64,
37
38    /// The Unix timestamp (in seconds) of when the API key was last used
39    pub r#last_used_at: Option<i64>,
40
41    pub r#owner: AdminApiKey_Owner,
42}
43
44#[derive(Clone, Debug, Default)]
45#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
46pub struct AdminApiKey_Owner {
47    /// Always `user`
48    pub r#type: Option<String>,
49
50    /// The object type, which is always organization.user
51    pub r#object: Option<String>,
52
53    /// The identifier, which can be referenced in API endpoints
54    pub r#id: Option<String>,
55
56    /// The name of the user
57    pub r#name: Option<String>,
58
59    /// The Unix timestamp (in seconds) of when the user was created
60    pub r#created_at: Option<i64>,
61
62    /// Always `owner`
63    pub r#role: Option<String>,
64}
65
66#[derive(Clone, Debug)]
67#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
68#[cfg_attr(feature = "serde", serde(untagged))]
69pub enum Annotation {
70    FileCitationBody(FileCitationBody),
71
72    UrlCitationBody(UrlCitationBody),
73
74    FilePath(FilePath),
75}
76
77#[derive(Clone, Debug, Default)]
78#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
79pub struct ApiKeyList {
80    pub r#object: Option<String>,
81
82    pub r#data: Option<Vec<AdminApiKey>>,
83
84    pub r#has_more: Option<bool>,
85
86    pub r#first_id: Option<String>,
87
88    pub r#last_id: Option<String>,
89}
90
91#[derive(Clone, Debug, Default)]
92#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
93pub struct ApproximateLocation {
94    /// The type of location approximation.
95    pub r#type: String,
96
97    pub r#country: Option<ApproximateLocation_Country>,
98
99    pub r#region: Option<ApproximateLocation_Region>,
100
101    pub r#city: Option<ApproximateLocation_City>,
102
103    pub r#timezone: Option<ApproximateLocation_Timezone>,
104}
105
106pub type ApproximateLocation_City = Option<String>;
107
108pub type ApproximateLocation_Country = Option<String>;
109
110pub type ApproximateLocation_Region = Option<String>;
111
112pub type ApproximateLocation_Timezone = Option<String>;
113
114/// Represents an `assistant` that can call the model and use tools.
115#[derive(Clone, Debug, Default)]
116#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
117pub struct AssistantObject {
118    /// The identifier, which can be referenced in API endpoints.
119    pub r#id: String,
120
121    /// The object type, which is always `assistant`.
122    pub r#object: String,
123
124    /// The Unix timestamp (in seconds) for when the assistant was created.
125    pub r#created_at: i64,
126
127    /// The name of the assistant.
128    pub r#name: Option<String>,
129
130    /// The description of the assistant.
131    pub r#description: Option<String>,
132
133    /// ID of the model to use.
134    pub r#model: String,
135
136    /// The system instructions that the assistant uses.
137    pub r#instructions: Option<String>,
138
139    /// A list of tool enabled on the assistant.
140    pub r#tools: Vec<AssistantObject_Tools>,
141
142    pub r#tool_resources: Option<AssistantObject_ToolResources>,
143
144    pub r#metadata: Option<Metadata>,
145
146    /// What sampling temperature to use, between 0 and 2.
147    pub r#temperature: Option<f64>,
148
149    /// An alternative to sampling with temperature, called nucleus sampling,
150    /// where the model considers the results of the tokens with top_p
151    /// probability mass.
152    pub r#top_p: Option<f64>,
153
154    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
155}
156
157/// A set of resources that are used by the assistant's tools.
158#[derive(Clone, Debug, Default)]
159#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
160pub struct AssistantObject_ToolResources {
161    pub r#code_interpreter: Option<AssistantObject_ToolResources_CodeInterpreter>,
162
163    pub r#file_search: Option<AssistantObject_ToolResources_FileSearch>,
164}
165
166#[derive(Clone, Debug, Default)]
167#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
168pub struct AssistantObject_ToolResources_CodeInterpreter {
169    /// A list of [file](/docs/api-reference/files) IDs made available to the
170    /// `code_interpreter`` tool.
171    pub r#file_ids: Option<Vec<String>>,
172}
173
174#[derive(Clone, Debug, Default)]
175#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
176pub struct AssistantObject_ToolResources_FileSearch {
177    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
178    /// attached to this assistant.
179    pub r#vector_store_ids: Option<Vec<String>>,
180}
181
182#[derive(Clone, Debug)]
183#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
184#[cfg_attr(feature = "serde", serde(untagged))]
185pub enum AssistantObject_Tools {
186    AssistantToolsCode(AssistantToolsCode),
187
188    AssistantToolsFileSearch(AssistantToolsFileSearch),
189
190    AssistantToolsFunction(AssistantToolsFunction),
191}
192
193/// Represents an event emitted when streaming a Run.
194#[derive(Clone, Debug)]
195#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
196#[cfg_attr(feature = "serde", serde(untagged))]
197pub enum AssistantStreamEvent {
198    ThreadStreamEvent(ThreadStreamEvent),
199
200    RunStreamEvent(RunStreamEvent),
201
202    RunStepStreamEvent(RunStepStreamEvent),
203
204    MessageStreamEvent(MessageStreamEvent),
205
206    ErrorEvent(ErrorEvent),
207
208    DoneEvent(DoneEvent),
209}
210
211#[derive(Clone, Debug)]
212#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
213pub enum AssistantSupportedModels {
214    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.1"))]
215    Gpt41,
216
217    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.1-mini"))]
218    Gpt41Mini,
219
220    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.1-nano"))]
221    Gpt41Nano,
222
223    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.1-2025-04-14"))]
224    Gpt4120250414,
225
226    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.1-mini-2025-04-14"))]
227    Gpt41Mini20250414,
228
229    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.1-nano-2025-04-14"))]
230    Gpt41Nano20250414,
231
232    #[cfg_attr(feature = "serde", serde(rename = "o3-mini"))]
233    O3Mini,
234
235    #[cfg_attr(feature = "serde", serde(rename = "o3-mini-2025-01-31"))]
236    O3Mini20250131,
237
238    #[cfg_attr(feature = "serde", serde(rename = "o1"))]
239    O1,
240
241    #[cfg_attr(feature = "serde", serde(rename = "o1-2024-12-17"))]
242    O120241217,
243
244    #[cfg_attr(feature = "serde", serde(rename = "gpt-4o"))]
245    Gpt4o,
246
247    #[cfg_attr(feature = "serde", serde(rename = "gpt-4o-2024-11-20"))]
248    Gpt4o20241120,
249
250    #[cfg_attr(feature = "serde", serde(rename = "gpt-4o-2024-08-06"))]
251    Gpt4o20240806,
252
253    #[cfg_attr(feature = "serde", serde(rename = "gpt-4o-2024-05-13"))]
254    Gpt4o20240513,
255
256    #[cfg_attr(feature = "serde", serde(rename = "gpt-4o-mini"))]
257    Gpt4oMini,
258
259    #[cfg_attr(feature = "serde", serde(rename = "gpt-4o-mini-2024-07-18"))]
260    Gpt4oMini20240718,
261
262    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.5-preview"))]
263    Gpt45Preview,
264
265    #[cfg_attr(feature = "serde", serde(rename = "gpt-4.5-preview-2025-02-27"))]
266    Gpt45Preview20250227,
267
268    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-turbo"))]
269    Gpt4Turbo,
270
271    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-turbo-2024-04-09"))]
272    Gpt4Turbo20240409,
273
274    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-0125-preview"))]
275    Gpt40125Preview,
276
277    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-turbo-preview"))]
278    Gpt4TurboPreview,
279
280    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-1106-preview"))]
281    Gpt41106Preview,
282
283    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-vision-preview"))]
284    Gpt4VisionPreview,
285
286    #[cfg_attr(feature = "serde", serde(rename = "gpt-4"))]
287    Gpt4,
288
289    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-0314"))]
290    Gpt40314,
291
292    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-0613"))]
293    Gpt40613,
294
295    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-32k"))]
296    Gpt432k,
297
298    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-32k-0314"))]
299    Gpt432k0314,
300
301    #[cfg_attr(feature = "serde", serde(rename = "gpt-4-32k-0613"))]
302    Gpt432k0613,
303
304    #[cfg_attr(feature = "serde", serde(rename = "gpt-3.5-turbo"))]
305    Gpt35Turbo,
306
307    #[cfg_attr(feature = "serde", serde(rename = "gpt-3.5-turbo-16k"))]
308    Gpt35Turbo16k,
309
310    #[cfg_attr(feature = "serde", serde(rename = "gpt-3.5-turbo-0613"))]
311    Gpt35Turbo0613,
312
313    #[cfg_attr(feature = "serde", serde(rename = "gpt-3.5-turbo-1106"))]
314    Gpt35Turbo1106,
315
316    #[cfg_attr(feature = "serde", serde(rename = "gpt-3.5-turbo-0125"))]
317    Gpt35Turbo0125,
318
319    #[cfg_attr(feature = "serde", serde(rename = "gpt-3.5-turbo-16k-0613"))]
320    Gpt35Turbo16k0613,
321
322    #[cfg_attr(feature = "serde", serde(untagged))]
323    Other(String),
324}
325
326#[derive(Clone, Debug, Default)]
327#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
328pub struct AssistantToolsCode {
329    /// The type of tool being defined: `code_interpreter`
330    pub r#type: String,
331}
332
333#[derive(Clone, Debug, Default)]
334#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
335pub struct AssistantToolsFileSearch {
336    /// The type of tool being defined: `file_search`
337    pub r#type: String,
338
339    pub r#file_search: Option<AssistantToolsFileSearch_FileSearch>,
340}
341
342#[derive(Clone, Debug, Default)]
343#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
344pub struct AssistantToolsFileSearchTypeOnly {
345    /// The type of tool being defined: `file_search`
346    pub r#type: String,
347}
348
349/// Overrides for the file search tool.
350#[derive(Clone, Debug, Default)]
351#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
352pub struct AssistantToolsFileSearch_FileSearch {
353    /// The maximum number of results the file search tool should output.
354    pub r#max_num_results: Option<i64>,
355
356    pub r#ranking_options: Option<FileSearchRankingOptions>,
357}
358
359#[derive(Clone, Debug)]
360#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
361pub struct AssistantToolsFunction {
362    /// The type of tool being defined: `function`
363    pub r#type: String,
364
365    pub r#function: FunctionObject,
366}
367
368/// Specifies the format that the model must output.
369#[derive(Clone, Debug)]
370#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
371#[cfg_attr(feature = "serde", serde(untagged))]
372pub enum AssistantsApiResponseFormatOption {
373    /// `auto` is the default value
374    Text(String),
375
376    ResponseFormatText(ResponseFormatText),
377
378    ResponseFormatJsonObject(ResponseFormatJsonObject),
379
380    ResponseFormatJsonSchema(ResponseFormatJsonSchema),
381}
382
383/// Controls which (if any) tool is called by the model.
384#[derive(Clone, Debug)]
385#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
386#[cfg_attr(feature = "serde", serde(untagged))]
387pub enum AssistantsApiToolChoiceOption {
388    /// `none` means the model will not call any tools and instead generates a
389    /// message.
390    Text(String),
391
392    AssistantsNamedToolChoice(AssistantsNamedToolChoice),
393}
394
395/// Specifies a tool the model should use.
396#[derive(Clone, Debug, Default)]
397#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
398pub struct AssistantsNamedToolChoice {
399    /// The type of the tool.
400    pub r#type: String,
401
402    pub r#function: Option<AssistantsNamedToolChoice_Function>,
403}
404
405#[derive(Clone, Debug, Default)]
406#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
407pub struct AssistantsNamedToolChoice_Function {
408    /// The name of the function to call.
409    pub r#name: String,
410}
411
412/// The format of the output, in one of these options: `json`, `text`, `srt`,
413/// `verbose_json`, or `vtt`.
414#[derive(Clone, Debug)]
415#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
416pub enum AudioResponseFormat {
417    #[cfg_attr(feature = "serde", serde(rename = "json"))]
418    Json,
419
420    #[cfg_attr(feature = "serde", serde(rename = "text"))]
421    Text,
422
423    #[cfg_attr(feature = "serde", serde(rename = "srt"))]
424    Srt,
425
426    #[cfg_attr(feature = "serde", serde(rename = "verbose_json"))]
427    VerboseJson,
428
429    #[cfg_attr(feature = "serde", serde(rename = "vtt"))]
430    Vtt,
431
432    #[cfg_attr(feature = "serde", serde(untagged))]
433    Other(String),
434}
435
436/// A log of a user action or configuration change within this organization.
437#[derive(Clone, Debug)]
438#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
439pub struct AuditLog {
440    /// The ID of this log.
441    pub r#id: String,
442
443    pub r#type: AuditLogEventType,
444
445    /// The Unix timestamp (in seconds) of the event.
446    pub r#effective_at: i64,
447
448    pub r#project: Option<AuditLog_Project>,
449
450    pub r#actor: AuditLogActor,
451
452    #[cfg_attr(feature = "serde", serde(rename = "api_key.created"))]
453    pub r#api_key_created: Option<AuditLog_ApiKeyCreated>,
454
455    #[cfg_attr(feature = "serde", serde(rename = "api_key.updated"))]
456    pub r#api_key_updated: Option<AuditLog_ApiKeyUpdated>,
457
458    #[cfg_attr(feature = "serde", serde(rename = "api_key.deleted"))]
459    pub r#api_key_deleted: Option<AuditLog_ApiKeyDeleted>,
460
461    #[cfg_attr(feature = "serde", serde(rename = "checkpoint_permission.created"))]
462    pub r#checkpoint_permission_created: Option<AuditLog_CheckpointPermissionCreated>,
463
464    #[cfg_attr(feature = "serde", serde(rename = "checkpoint_permission.deleted"))]
465    pub r#checkpoint_permission_deleted: Option<AuditLog_CheckpointPermissionDeleted>,
466
467    #[cfg_attr(feature = "serde", serde(rename = "invite.sent"))]
468    pub r#invite_sent: Option<AuditLog_InviteSent>,
469
470    #[cfg_attr(feature = "serde", serde(rename = "invite.accepted"))]
471    pub r#invite_accepted: Option<AuditLog_InviteAccepted>,
472
473    #[cfg_attr(feature = "serde", serde(rename = "invite.deleted"))]
474    pub r#invite_deleted: Option<AuditLog_InviteDeleted>,
475
476    #[cfg_attr(feature = "serde", serde(rename = "login.failed"))]
477    pub r#login_failed: Option<AuditLog_LoginFailed>,
478
479    #[cfg_attr(feature = "serde", serde(rename = "logout.failed"))]
480    pub r#logout_failed: Option<AuditLog_LogoutFailed>,
481
482    #[cfg_attr(feature = "serde", serde(rename = "organization.updated"))]
483    pub r#organization_updated: Option<AuditLog_OrganizationUpdated>,
484
485    #[cfg_attr(feature = "serde", serde(rename = "project.created"))]
486    pub r#project_created: Option<AuditLog_ProjectCreated>,
487
488    #[cfg_attr(feature = "serde", serde(rename = "project.updated"))]
489    pub r#project_updated: Option<AuditLog_ProjectUpdated>,
490
491    #[cfg_attr(feature = "serde", serde(rename = "project.archived"))]
492    pub r#project_archived: Option<AuditLog_ProjectArchived>,
493
494    #[cfg_attr(feature = "serde", serde(rename = "rate_limit.updated"))]
495    pub r#rate_limit_updated: Option<AuditLog_RateLimitUpdated>,
496
497    #[cfg_attr(feature = "serde", serde(rename = "rate_limit.deleted"))]
498    pub r#rate_limit_deleted: Option<AuditLog_RateLimitDeleted>,
499
500    #[cfg_attr(feature = "serde", serde(rename = "service_account.created"))]
501    pub r#service_account_created: Option<AuditLog_ServiceAccountCreated>,
502
503    #[cfg_attr(feature = "serde", serde(rename = "service_account.updated"))]
504    pub r#service_account_updated: Option<AuditLog_ServiceAccountUpdated>,
505
506    #[cfg_attr(feature = "serde", serde(rename = "service_account.deleted"))]
507    pub r#service_account_deleted: Option<AuditLog_ServiceAccountDeleted>,
508
509    #[cfg_attr(feature = "serde", serde(rename = "user.added"))]
510    pub r#user_added: Option<AuditLog_UserAdded>,
511
512    #[cfg_attr(feature = "serde", serde(rename = "user.updated"))]
513    pub r#user_updated: Option<AuditLog_UserUpdated>,
514
515    #[cfg_attr(feature = "serde", serde(rename = "user.deleted"))]
516    pub r#user_deleted: Option<AuditLog_UserDeleted>,
517
518    #[cfg_attr(feature = "serde", serde(rename = "certificate.created"))]
519    pub r#certificate_created: Option<AuditLog_CertificateCreated>,
520
521    #[cfg_attr(feature = "serde", serde(rename = "certificate.updated"))]
522    pub r#certificate_updated: Option<AuditLog_CertificateUpdated>,
523
524    #[cfg_attr(feature = "serde", serde(rename = "certificate.deleted"))]
525    pub r#certificate_deleted: Option<AuditLog_CertificateDeleted>,
526
527    #[cfg_attr(feature = "serde", serde(rename = "certificates.activated"))]
528    pub r#certificates_activated: Option<AuditLog_CertificatesActivated>,
529
530    #[cfg_attr(feature = "serde", serde(rename = "certificates.deactivated"))]
531    pub r#certificates_deactivated: Option<AuditLog_CertificatesDeactivated>,
532}
533
534/// The actor who performed the audit logged action.
535#[derive(Clone, Debug, Default)]
536#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
537pub struct AuditLogActor {
538    /// The type of actor.
539    pub r#type: Option<String>,
540
541    pub r#session: Option<AuditLogActorSession>,
542
543    pub r#api_key: Option<AuditLogActorApiKey>,
544}
545
546/// The API Key used to perform the audit logged action.
547#[derive(Clone, Debug, Default)]
548#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
549pub struct AuditLogActorApiKey {
550    /// The tracking id of the API key.
551    pub r#id: Option<String>,
552
553    /// The type of API key.
554    pub r#type: Option<String>,
555
556    pub r#user: Option<AuditLogActorUser>,
557
558    pub r#service_account: Option<AuditLogActorServiceAccount>,
559}
560
561/// The service account that performed the audit logged action.
562#[derive(Clone, Debug, Default)]
563#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
564pub struct AuditLogActorServiceAccount {
565    /// The service account id.
566    pub r#id: Option<String>,
567}
568
569/// The session in which the audit logged action was performed.
570#[derive(Clone, Debug, Default)]
571#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
572pub struct AuditLogActorSession {
573    pub r#user: Option<AuditLogActorUser>,
574
575    /// The IP address from which the action was performed.
576    pub r#ip_address: Option<String>,
577}
578
579/// The user who performed the audit logged action.
580#[derive(Clone, Debug, Default)]
581#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
582pub struct AuditLogActorUser {
583    /// The user id.
584    pub r#id: Option<String>,
585
586    /// The user email.
587    pub r#email: Option<String>,
588}
589
590/// The event type.
591#[derive(Clone, Debug)]
592#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
593pub enum AuditLogEventType {
594    #[cfg_attr(feature = "serde", serde(rename = "api_key.created"))]
595    ApiKeyCreated,
596
597    #[cfg_attr(feature = "serde", serde(rename = "api_key.updated"))]
598    ApiKeyUpdated,
599
600    #[cfg_attr(feature = "serde", serde(rename = "api_key.deleted"))]
601    ApiKeyDeleted,
602
603    #[cfg_attr(feature = "serde", serde(rename = "checkpoint_permission.created"))]
604    CheckpointPermissionCreated,
605
606    #[cfg_attr(feature = "serde", serde(rename = "checkpoint_permission.deleted"))]
607    CheckpointPermissionDeleted,
608
609    #[cfg_attr(feature = "serde", serde(rename = "invite.sent"))]
610    InviteSent,
611
612    #[cfg_attr(feature = "serde", serde(rename = "invite.accepted"))]
613    InviteAccepted,
614
615    #[cfg_attr(feature = "serde", serde(rename = "invite.deleted"))]
616    InviteDeleted,
617
618    #[cfg_attr(feature = "serde", serde(rename = "login.succeeded"))]
619    LoginSucceeded,
620
621    #[cfg_attr(feature = "serde", serde(rename = "login.failed"))]
622    LoginFailed,
623
624    #[cfg_attr(feature = "serde", serde(rename = "logout.succeeded"))]
625    LogoutSucceeded,
626
627    #[cfg_attr(feature = "serde", serde(rename = "logout.failed"))]
628    LogoutFailed,
629
630    #[cfg_attr(feature = "serde", serde(rename = "organization.updated"))]
631    OrganizationUpdated,
632
633    #[cfg_attr(feature = "serde", serde(rename = "project.created"))]
634    ProjectCreated,
635
636    #[cfg_attr(feature = "serde", serde(rename = "project.updated"))]
637    ProjectUpdated,
638
639    #[cfg_attr(feature = "serde", serde(rename = "project.archived"))]
640    ProjectArchived,
641
642    #[cfg_attr(feature = "serde", serde(rename = "service_account.created"))]
643    ServiceAccountCreated,
644
645    #[cfg_attr(feature = "serde", serde(rename = "service_account.updated"))]
646    ServiceAccountUpdated,
647
648    #[cfg_attr(feature = "serde", serde(rename = "service_account.deleted"))]
649    ServiceAccountDeleted,
650
651    #[cfg_attr(feature = "serde", serde(rename = "rate_limit.updated"))]
652    RateLimitUpdated,
653
654    #[cfg_attr(feature = "serde", serde(rename = "rate_limit.deleted"))]
655    RateLimitDeleted,
656
657    #[cfg_attr(feature = "serde", serde(rename = "user.added"))]
658    UserAdded,
659
660    #[cfg_attr(feature = "serde", serde(rename = "user.updated"))]
661    UserUpdated,
662
663    #[cfg_attr(feature = "serde", serde(rename = "user.deleted"))]
664    UserDeleted,
665
666    #[cfg_attr(feature = "serde", serde(untagged))]
667    Other(String),
668}
669
670/// The details for events with this `type`.
671#[derive(Clone, Debug, Default)]
672#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
673pub struct AuditLog_ApiKeyCreated {
674    /// The tracking ID of the API key.
675    pub r#id: Option<String>,
676
677    pub r#data: Option<AuditLog_ApiKeyCreated_Data>,
678}
679
680/// The payload used to create the API key.
681#[derive(Clone, Debug, Default)]
682#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
683pub struct AuditLog_ApiKeyCreated_Data {
684    /// A list of scopes allowed for the API key, e.g.
685    pub r#scopes: Option<Vec<String>>,
686}
687
688/// The details for events with this `type`.
689#[derive(Clone, Debug, Default)]
690#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
691pub struct AuditLog_ApiKeyDeleted {
692    /// The tracking ID of the API key.
693    pub r#id: Option<String>,
694}
695
696/// The details for events with this `type`.
697#[derive(Clone, Debug, Default)]
698#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
699pub struct AuditLog_ApiKeyUpdated {
700    /// The tracking ID of the API key.
701    pub r#id: Option<String>,
702
703    pub r#changes_requested: Option<AuditLog_ApiKeyUpdated_ChangesRequested>,
704}
705
706/// The payload used to update the API key.
707#[derive(Clone, Debug, Default)]
708#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
709pub struct AuditLog_ApiKeyUpdated_ChangesRequested {
710    /// A list of scopes allowed for the API key, e.g.
711    pub r#scopes: Option<Vec<String>>,
712}
713
714/// The details for events with this `type`.
715#[derive(Clone, Debug, Default)]
716#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
717pub struct AuditLog_CertificateCreated {
718    /// The certificate ID.
719    pub r#id: Option<String>,
720
721    /// The name of the certificate.
722    pub r#name: Option<String>,
723}
724
725/// The details for events with this `type`.
726#[derive(Clone, Debug, Default)]
727#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
728pub struct AuditLog_CertificateDeleted {
729    /// The certificate ID.
730    pub r#id: Option<String>,
731
732    /// The name of the certificate.
733    pub r#name: Option<String>,
734
735    /// The certificate content in PEM format.
736    pub r#certificate: Option<String>,
737}
738
739/// The details for events with this `type`.
740#[derive(Clone, Debug, Default)]
741#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
742pub struct AuditLog_CertificateUpdated {
743    /// The certificate ID.
744    pub r#id: Option<String>,
745
746    /// The name of the certificate.
747    pub r#name: Option<String>,
748}
749
750/// The details for events with this `type`.
751#[derive(Clone, Debug, Default)]
752#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
753pub struct AuditLog_CertificatesActivated {
754    pub r#certificates: Option<Vec<AuditLog_CertificatesActivated_Certificates>>,
755}
756
757#[derive(Clone, Debug, Default)]
758#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
759pub struct AuditLog_CertificatesActivated_Certificates {
760    /// The certificate ID.
761    pub r#id: Option<String>,
762
763    /// The name of the certificate.
764    pub r#name: Option<String>,
765}
766
767/// The details for events with this `type`.
768#[derive(Clone, Debug, Default)]
769#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
770pub struct AuditLog_CertificatesDeactivated {
771    pub r#certificates: Option<Vec<AuditLog_CertificatesDeactivated_Certificates>>,
772}
773
774#[derive(Clone, Debug, Default)]
775#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
776pub struct AuditLog_CertificatesDeactivated_Certificates {
777    /// The certificate ID.
778    pub r#id: Option<String>,
779
780    /// The name of the certificate.
781    pub r#name: Option<String>,
782}
783
784/// The project and fine-tuned model checkpoint that the checkpoint permission
785/// was created for.
786#[derive(Clone, Debug, Default)]
787#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
788pub struct AuditLog_CheckpointPermissionCreated {
789    /// The ID of the checkpoint permission.
790    pub r#id: Option<String>,
791
792    pub r#data: Option<AuditLog_CheckpointPermissionCreated_Data>,
793}
794
795/// The payload used to create the checkpoint permission.
796#[derive(Clone, Debug, Default)]
797#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
798pub struct AuditLog_CheckpointPermissionCreated_Data {
799    /// The ID of the project that the checkpoint permission was created for.
800    pub r#project_id: Option<String>,
801
802    /// The ID of the fine-tuned model checkpoint.
803    pub r#fine_tuned_model_checkpoint: Option<String>,
804}
805
806/// The details for events with this `type`.
807#[derive(Clone, Debug, Default)]
808#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
809pub struct AuditLog_CheckpointPermissionDeleted {
810    /// The ID of the checkpoint permission.
811    pub r#id: Option<String>,
812}
813
814/// The details for events with this `type`.
815#[derive(Clone, Debug, Default)]
816#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
817pub struct AuditLog_InviteAccepted {
818    /// The ID of the invite.
819    pub r#id: Option<String>,
820}
821
822/// The details for events with this `type`.
823#[derive(Clone, Debug, Default)]
824#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
825pub struct AuditLog_InviteDeleted {
826    /// The ID of the invite.
827    pub r#id: Option<String>,
828}
829
830/// The details for events with this `type`.
831#[derive(Clone, Debug, Default)]
832#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
833pub struct AuditLog_InviteSent {
834    /// The ID of the invite.
835    pub r#id: Option<String>,
836
837    pub r#data: Option<AuditLog_InviteSent_Data>,
838}
839
840/// The payload used to create the invite.
841#[derive(Clone, Debug, Default)]
842#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
843pub struct AuditLog_InviteSent_Data {
844    /// The email invited to the organization.
845    pub r#email: Option<String>,
846
847    /// The role the email was invited to be.
848    pub r#role: Option<String>,
849}
850
851/// The details for events with this `type`.
852#[derive(Clone, Debug, Default)]
853#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
854pub struct AuditLog_LoginFailed {
855    /// The error code of the failure.
856    pub r#error_code: Option<String>,
857
858    /// The error message of the failure.
859    pub r#error_message: Option<String>,
860}
861
862/// The details for events with this `type`.
863#[derive(Clone, Debug, Default)]
864#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
865pub struct AuditLog_LogoutFailed {
866    /// The error code of the failure.
867    pub r#error_code: Option<String>,
868
869    /// The error message of the failure.
870    pub r#error_message: Option<String>,
871}
872
873/// The details for events with this `type`.
874#[derive(Clone, Debug, Default)]
875#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
876pub struct AuditLog_OrganizationUpdated {
877    /// The organization ID.
878    pub r#id: Option<String>,
879
880    pub r#changes_requested: Option<AuditLog_OrganizationUpdated_ChangesRequested>,
881}
882
883/// The payload used to update the organization settings.
884#[derive(Clone, Debug, Default)]
885#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
886pub struct AuditLog_OrganizationUpdated_ChangesRequested {
887    /// The organization title.
888    pub r#title: Option<String>,
889
890    /// The organization description.
891    pub r#description: Option<String>,
892
893    /// The organization name.
894    pub r#name: Option<String>,
895
896    pub r#settings: Option<AuditLog_OrganizationUpdated_ChangesRequested_Settings>,
897}
898
899#[derive(Clone, Debug, Default)]
900#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
901pub struct AuditLog_OrganizationUpdated_ChangesRequested_Settings {
902    /// Visibility of the threads page which shows messages created with the
903    /// Assistants API and Playground.
904    pub r#threads_ui_visibility: Option<String>,
905
906    /// Visibility of the usage dashboard which shows activity and costs for
907    /// your organization.
908    pub r#usage_dashboard_visibility: Option<String>,
909}
910
911/// The project that the action was scoped to.
912#[derive(Clone, Debug, Default)]
913#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
914pub struct AuditLog_Project {
915    /// The project ID.
916    pub r#id: Option<String>,
917
918    /// The project title.
919    pub r#name: Option<String>,
920}
921
922/// The details for events with this `type`.
923#[derive(Clone, Debug, Default)]
924#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
925pub struct AuditLog_ProjectArchived {
926    /// The project ID.
927    pub r#id: Option<String>,
928}
929
930/// The details for events with this `type`.
931#[derive(Clone, Debug, Default)]
932#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
933pub struct AuditLog_ProjectCreated {
934    /// The project ID.
935    pub r#id: Option<String>,
936
937    pub r#data: Option<AuditLog_ProjectCreated_Data>,
938}
939
940/// The payload used to create the project.
941#[derive(Clone, Debug, Default)]
942#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
943pub struct AuditLog_ProjectCreated_Data {
944    /// The project name.
945    pub r#name: Option<String>,
946
947    /// The title of the project as seen on the dashboard.
948    pub r#title: Option<String>,
949}
950
951/// The details for events with this `type`.
952#[derive(Clone, Debug, Default)]
953#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
954pub struct AuditLog_ProjectUpdated {
955    /// The project ID.
956    pub r#id: Option<String>,
957
958    pub r#changes_requested: Option<AuditLog_ProjectUpdated_ChangesRequested>,
959}
960
961/// The payload used to update the project.
962#[derive(Clone, Debug, Default)]
963#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
964pub struct AuditLog_ProjectUpdated_ChangesRequested {
965    /// The title of the project as seen on the dashboard.
966    pub r#title: Option<String>,
967}
968
969/// The details for events with this `type`.
970#[derive(Clone, Debug, Default)]
971#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
972pub struct AuditLog_RateLimitDeleted {
973    /// The rate limit ID
974    pub r#id: Option<String>,
975}
976
977/// The details for events with this `type`.
978#[derive(Clone, Debug, Default)]
979#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
980pub struct AuditLog_RateLimitUpdated {
981    /// The rate limit ID
982    pub r#id: Option<String>,
983
984    pub r#changes_requested: Option<AuditLog_RateLimitUpdated_ChangesRequested>,
985}
986
987/// The payload used to update the rate limits.
988#[derive(Clone, Debug, Default)]
989#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
990pub struct AuditLog_RateLimitUpdated_ChangesRequested {
991    /// The maximum requests per minute.
992    pub r#max_requests_per_1_minute: Option<i64>,
993
994    /// The maximum tokens per minute.
995    pub r#max_tokens_per_1_minute: Option<i64>,
996
997    /// The maximum images per minute.
998    pub r#max_images_per_1_minute: Option<i64>,
999
1000    /// The maximum audio megabytes per minute.
1001    pub r#max_audio_megabytes_per_1_minute: Option<i64>,
1002
1003    /// The maximum requests per day.
1004    pub r#max_requests_per_1_day: Option<i64>,
1005
1006    /// The maximum batch input tokens per day.
1007    pub r#batch_1_day_max_input_tokens: Option<i64>,
1008}
1009
1010/// The details for events with this `type`.
1011#[derive(Clone, Debug, Default)]
1012#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1013pub struct AuditLog_ServiceAccountCreated {
1014    /// The service account ID.
1015    pub r#id: Option<String>,
1016
1017    pub r#data: Option<AuditLog_ServiceAccountCreated_Data>,
1018}
1019
1020/// The payload used to create the service account.
1021#[derive(Clone, Debug, Default)]
1022#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1023pub struct AuditLog_ServiceAccountCreated_Data {
1024    /// The role of the service account.
1025    pub r#role: Option<String>,
1026}
1027
1028/// The details for events with this `type`.
1029#[derive(Clone, Debug, Default)]
1030#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1031pub struct AuditLog_ServiceAccountDeleted {
1032    /// The service account ID.
1033    pub r#id: Option<String>,
1034}
1035
1036/// The details for events with this `type`.
1037#[derive(Clone, Debug, Default)]
1038#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1039pub struct AuditLog_ServiceAccountUpdated {
1040    /// The service account ID.
1041    pub r#id: Option<String>,
1042
1043    pub r#changes_requested: Option<AuditLog_ServiceAccountUpdated_ChangesRequested>,
1044}
1045
1046/// The payload used to updated the service account.
1047#[derive(Clone, Debug, Default)]
1048#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1049pub struct AuditLog_ServiceAccountUpdated_ChangesRequested {
1050    /// The role of the service account.
1051    pub r#role: Option<String>,
1052}
1053
1054/// The details for events with this `type`.
1055#[derive(Clone, Debug, Default)]
1056#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1057pub struct AuditLog_UserAdded {
1058    /// The user ID.
1059    pub r#id: Option<String>,
1060
1061    pub r#data: Option<AuditLog_UserAdded_Data>,
1062}
1063
1064/// The payload used to add the user to the project.
1065#[derive(Clone, Debug, Default)]
1066#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1067pub struct AuditLog_UserAdded_Data {
1068    /// The role of the user.
1069    pub r#role: Option<String>,
1070}
1071
1072/// The details for events with this `type`.
1073#[derive(Clone, Debug, Default)]
1074#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1075pub struct AuditLog_UserDeleted {
1076    /// The user ID.
1077    pub r#id: Option<String>,
1078}
1079
1080/// The details for events with this `type`.
1081#[derive(Clone, Debug, Default)]
1082#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1083pub struct AuditLog_UserUpdated {
1084    /// The project ID.
1085    pub r#id: Option<String>,
1086
1087    pub r#changes_requested: Option<AuditLog_UserUpdated_ChangesRequested>,
1088}
1089
1090/// The payload used to update the user.
1091#[derive(Clone, Debug, Default)]
1092#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1093pub struct AuditLog_UserUpdated_ChangesRequested {
1094    /// The role of the user.
1095    pub r#role: Option<String>,
1096}
1097
1098/// The default strategy.
1099#[derive(Clone, Debug, Default)]
1100#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1101pub struct AutoChunkingStrategyRequestParam {
1102    /// Always `auto`.
1103    pub r#type: String,
1104}
1105
1106#[derive(Clone, Debug, Default)]
1107#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1108pub struct Batch {
1109    pub r#id: String,
1110
1111    /// The object type, which is always `batch`.
1112    pub r#object: String,
1113
1114    /// The OpenAI API endpoint used by the batch.
1115    pub r#endpoint: String,
1116
1117    pub r#errors: Option<Batch_Errors>,
1118
1119    /// The ID of the input file for the batch.
1120    pub r#input_file_id: String,
1121
1122    /// The time frame within which the batch should be processed.
1123    pub r#completion_window: String,
1124
1125    /// The current status of the batch.
1126    pub r#status: String,
1127
1128    /// The ID of the file containing the outputs of successfully executed
1129    /// requests.
1130    pub r#output_file_id: Option<String>,
1131
1132    /// The ID of the file containing the outputs of requests with errors.
1133    pub r#error_file_id: Option<String>,
1134
1135    /// The Unix timestamp (in seconds) for when the batch was created.
1136    pub r#created_at: i64,
1137
1138    /// The Unix timestamp (in seconds) for when the batch started processing.
1139    pub r#in_progress_at: Option<i64>,
1140
1141    /// The Unix timestamp (in seconds) for when the batch will expire.
1142    pub r#expires_at: Option<i64>,
1143
1144    /// The Unix timestamp (in seconds) for when the batch started finalizing.
1145    pub r#finalizing_at: Option<i64>,
1146
1147    /// The Unix timestamp (in seconds) for when the batch was completed.
1148    pub r#completed_at: Option<i64>,
1149
1150    /// The Unix timestamp (in seconds) for when the batch failed.
1151    pub r#failed_at: Option<i64>,
1152
1153    /// The Unix timestamp (in seconds) for when the batch expired.
1154    pub r#expired_at: Option<i64>,
1155
1156    /// The Unix timestamp (in seconds) for when the batch started cancelling.
1157    pub r#cancelling_at: Option<i64>,
1158
1159    /// The Unix timestamp (in seconds) for when the batch was cancelled.
1160    pub r#cancelled_at: Option<i64>,
1161
1162    pub r#request_counts: Option<Batch_RequestCounts>,
1163
1164    pub r#metadata: Option<Metadata>,
1165}
1166
1167/// The per-line object of the batch input file
1168#[derive(Clone, Debug, Default)]
1169#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1170pub struct BatchRequestInput {
1171    /// A developer-provided per-request id that will be used to match outputs
1172    /// to inputs.
1173    pub r#custom_id: Option<String>,
1174
1175    /// The HTTP method to be used for the request.
1176    pub r#method: Option<String>,
1177
1178    /// The OpenAI API relative URL to be used for the request.
1179    pub r#url: Option<String>,
1180}
1181
1182/// The per-line object of the batch output and error files
1183#[derive(Clone, Debug, Default)]
1184#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1185pub struct BatchRequestOutput {
1186    pub r#id: Option<String>,
1187
1188    /// A developer-provided per-request id that will be used to match outputs
1189    /// to inputs.
1190    pub r#custom_id: Option<String>,
1191
1192    pub r#response: Option<BatchRequestOutput_Response>,
1193
1194    pub r#error: Option<BatchRequestOutput_Error>,
1195}
1196
1197/// For requests that failed with a non-HTTP error, this will contain more
1198/// information on the cause of the failure.
1199#[derive(Clone, Debug, Default)]
1200#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1201pub struct BatchRequestOutput_Error {
1202    /// A machine-readable error code.
1203    pub r#code: Option<String>,
1204
1205    /// A human-readable error message.
1206    pub r#message: Option<String>,
1207}
1208
1209#[derive(Clone, Debug, Default)]
1210#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1211pub struct BatchRequestOutput_Response {
1212    /// The HTTP status code of the response
1213    pub r#status_code: Option<i64>,
1214
1215    /// An unique identifier for the OpenAI API request.
1216    pub r#request_id: Option<String>,
1217
1218    /// The JSON body of the response
1219    pub r#body: Option<BatchRequestOutput_Response_Body>,
1220}
1221
1222/// The JSON body of the response
1223#[derive(Clone, Debug, Default)]
1224#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1225pub struct BatchRequestOutput_Response_Body;
1226
1227#[derive(Clone, Debug, Default)]
1228#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1229pub struct Batch_Errors {
1230    /// The object type, which is always `list`.
1231    pub r#object: Option<String>,
1232
1233    pub r#data: Option<Vec<Batch_Errors_Data>>,
1234}
1235
1236#[derive(Clone, Debug, Default)]
1237#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1238pub struct Batch_Errors_Data {
1239    /// An error code identifying the error type.
1240    pub r#code: Option<String>,
1241
1242    /// A human-readable message providing more details about the error.
1243    pub r#message: Option<String>,
1244
1245    /// The name of the parameter that caused the error, if applicable.
1246    pub r#param: Option<String>,
1247
1248    /// The line number of the input file where the error occurred, if
1249    /// applicable.
1250    pub r#line: Option<i64>,
1251}
1252
1253/// The request counts for different statuses within the batch.
1254#[derive(Clone, Debug, Default)]
1255#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1256pub struct Batch_RequestCounts {
1257    /// Total number of requests in the batch.
1258    pub r#total: i64,
1259
1260    /// Number of requests that have been completed successfully.
1261    pub r#completed: i64,
1262
1263    /// Number of requests that have failed.
1264    pub r#failed: i64,
1265}
1266
1267/// Represents an individual `certificate` uploaded to the organization.
1268#[derive(Clone, Debug)]
1269#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1270pub struct Certificate {
1271    /// The object type.
1272    pub r#object: String,
1273
1274    /// The identifier, which can be referenced in API endpoints
1275    pub r#id: String,
1276
1277    /// The name of the certificate.
1278    pub r#name: String,
1279
1280    /// The Unix timestamp (in seconds) of when the certificate was uploaded.
1281    pub r#created_at: i64,
1282
1283    pub r#certificate_details: Certificate_CertificateDetails,
1284
1285    /// Whether the certificate is currently active at the specified scope.
1286    pub r#active: Option<bool>,
1287}
1288
1289#[derive(Clone, Debug, Default)]
1290#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1291pub struct Certificate_CertificateDetails {
1292    /// The Unix timestamp (in seconds) of when the certificate becomes valid.
1293    pub r#valid_at: Option<i64>,
1294
1295    /// The Unix timestamp (in seconds) of when the certificate expires.
1296    pub r#expires_at: Option<i64>,
1297
1298    /// The content of the certificate in PEM format.
1299    pub r#content: Option<String>,
1300}
1301
1302#[derive(Clone, Debug, Default)]
1303#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1304pub struct ChatCompletionDeleted {
1305    /// The type of object being deleted.
1306    pub r#object: String,
1307
1308    /// The ID of the chat completion that was deleted.
1309    pub r#id: String,
1310
1311    /// Whether the chat completion was deleted.
1312    pub r#deleted: bool,
1313}
1314
1315/// Specifying a particular function via `{"name": "my_function"}` forces the
1316/// model to call that function.
1317#[derive(Clone, Debug, Default)]
1318#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1319pub struct ChatCompletionFunctionCallOption {
1320    /// The name of the function to call.
1321    pub r#name: String,
1322}
1323
1324#[derive(Clone, Debug, Default)]
1325#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1326pub struct ChatCompletionFunctions {
1327    /// A description of what the function does, used by the model to choose
1328    /// when and how to call the function.
1329    pub r#description: Option<String>,
1330
1331    /// The name of the function to be called.
1332    pub r#name: String,
1333
1334    pub r#parameters: Option<FunctionParameters>,
1335}
1336
1337/// An object representing a list of Chat Completions.
1338#[derive(Clone, Debug, Default)]
1339#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1340pub struct ChatCompletionList {
1341    /// The type of this object.
1342    pub r#object: String,
1343
1344    /// An array of chat completion objects.
1345    pub r#data: Vec<CreateChatCompletionResponse>,
1346
1347    /// The identifier of the first chat completion in the data array.
1348    pub r#first_id: String,
1349
1350    /// The identifier of the last chat completion in the data array.
1351    pub r#last_id: String,
1352
1353    /// Indicates whether there are more Chat Completions available.
1354    pub r#has_more: bool,
1355}
1356
1357/// An object representing a list of chat completion messages.
1358#[derive(Clone, Debug, Default)]
1359#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1360pub struct ChatCompletionMessageList {
1361    /// The type of this object.
1362    pub r#object: String,
1363
1364    /// An array of chat completion message objects.
1365    pub r#data: Vec<ChatCompletionMessageList_Data>,
1366
1367    /// The identifier of the first chat message in the data array.
1368    pub r#first_id: String,
1369
1370    /// The identifier of the last chat message in the data array.
1371    pub r#last_id: String,
1372
1373    /// Indicates whether there are more chat messages available.
1374    pub r#has_more: bool,
1375}
1376
1377#[derive(Clone, Debug, Default)]
1378#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1379pub struct ChatCompletionMessageList_Data {
1380    /// The contents of the message.
1381    pub r#content: Option<String>,
1382
1383    /// The refusal message generated by the model.
1384    pub r#refusal: Option<String>,
1385
1386    pub r#tool_calls: Option<ChatCompletionMessageToolCalls>,
1387
1388    /// Annotations for the message, when applicable, as when using the [web
1389    /// search tool](/docs/guides/tools-web-search?api-mode=chat).
1390    pub r#annotations: Option<Vec<ChatCompletionResponseMessage_Annotations>>,
1391
1392    /// The role of the author of this message.
1393    pub r#role: String,
1394
1395    pub r#function_call: Option<ChatCompletionResponseMessage_FunctionCall>,
1396
1397    pub r#audio: Option<ChatCompletionResponseMessage_Audio>,
1398
1399    /// The identifier of the chat message.
1400    pub r#id: String,
1401}
1402
1403#[derive(Clone, Debug, Default)]
1404#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1405pub struct ChatCompletionMessageList_Data_Variant2 {
1406    /// The identifier of the chat message.
1407    pub r#id: String,
1408}
1409
1410#[derive(Clone, Debug)]
1411#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1412pub struct ChatCompletionMessageToolCall {
1413    /// The ID of the tool call.
1414    pub r#id: String,
1415
1416    /// The type of the tool.
1417    pub r#type: String,
1418
1419    pub r#function: ChatCompletionMessageToolCall_Function,
1420}
1421
1422#[derive(Clone, Debug, Default)]
1423#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1424pub struct ChatCompletionMessageToolCallChunk {
1425    pub r#index: i64,
1426
1427    /// The ID of the tool call.
1428    pub r#id: Option<String>,
1429
1430    /// The type of the tool.
1431    pub r#type: Option<String>,
1432
1433    pub r#function: Option<ChatCompletionMessageToolCallChunk_Function>,
1434}
1435
1436#[derive(Clone, Debug, Default)]
1437#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1438pub struct ChatCompletionMessageToolCallChunk_Function {
1439    /// The name of the function to call.
1440    pub r#name: Option<String>,
1441
1442    /// The arguments to call the function with, as generated by the model in
1443    /// JSON format.
1444    pub r#arguments: Option<String>,
1445}
1446
1447/// The function that the model called.
1448#[derive(Clone, Debug, Default)]
1449#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1450pub struct ChatCompletionMessageToolCall_Function {
1451    /// The name of the function to call.
1452    pub r#name: String,
1453
1454    /// The arguments to call the function with, as generated by the model in
1455    /// JSON format.
1456    pub r#arguments: String,
1457}
1458
1459/// The tool calls generated by the model, such as function calls.
1460pub type ChatCompletionMessageToolCalls = Vec<ChatCompletionMessageToolCall>;
1461
1462/// Output types that you would like the model to generate for this request.
1463pub type ChatCompletionModalities = Vec<String>;
1464
1465/// Specifies a tool the model should use.
1466#[derive(Clone, Debug)]
1467#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1468pub struct ChatCompletionNamedToolChoice {
1469    /// The type of the tool.
1470    pub r#type: String,
1471
1472    pub r#function: ChatCompletionNamedToolChoice_Function,
1473}
1474
1475#[derive(Clone, Debug, Default)]
1476#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1477pub struct ChatCompletionNamedToolChoice_Function {
1478    /// The name of the function to call.
1479    pub r#name: String,
1480}
1481
1482/// Messages sent by the model in response to user messages.
1483#[derive(Clone, Debug, Default)]
1484#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1485pub struct ChatCompletionRequestAssistantMessage {
1486    pub r#content: Option<ChatCompletionRequestAssistantMessage_Content>,
1487
1488    /// The refusal message by the assistant.
1489    pub r#refusal: Option<String>,
1490
1491    /// An optional name for the participant.
1492    pub r#name: Option<String>,
1493
1494    pub r#audio: Option<ChatCompletionRequestAssistantMessage_Audio>,
1495
1496    pub r#tool_calls: Option<ChatCompletionMessageToolCalls>,
1497
1498    pub r#function_call: Option<ChatCompletionRequestAssistantMessage_FunctionCall>,
1499}
1500
1501#[derive(Clone, Debug)]
1502#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1503#[cfg_attr(feature = "serde", serde(untagged))]
1504pub enum ChatCompletionRequestAssistantMessageContentPart {
1505    ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
1506
1507    ChatCompletionRequestMessageContentPartRefusal(ChatCompletionRequestMessageContentPartRefusal),
1508}
1509
1510/// Data about a previous audio response from the model.
1511#[derive(Clone, Debug, Default)]
1512#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1513pub struct ChatCompletionRequestAssistantMessage_Audio {
1514    /// Unique identifier for a previous audio response from the model.
1515    pub r#id: String,
1516}
1517
1518/// The contents of the assistant message.
1519#[derive(Clone, Debug)]
1520#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1521#[cfg_attr(feature = "serde", serde(untagged))]
1522pub enum ChatCompletionRequestAssistantMessage_Content {
1523    /// The contents of the assistant message.
1524    Text(String),
1525
1526    /// An array of content parts with a defined type.
1527    Array(Vec<ChatCompletionRequestAssistantMessageContentPart>),
1528}
1529
1530/// Deprecated and replaced by `tool_calls`.
1531#[derive(Clone, Debug, Default)]
1532#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1533pub struct ChatCompletionRequestAssistantMessage_FunctionCall {
1534    /// The arguments to call the function with, as generated by the model in
1535    /// JSON format.
1536    pub r#arguments: String,
1537
1538    /// The name of the function to call.
1539    pub r#name: String,
1540}
1541
1542/// Developer-provided instructions that the model should follow, regardless of
1543/// messages sent by the user.
1544#[derive(Clone, Debug)]
1545#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1546pub struct ChatCompletionRequestDeveloperMessage {
1547    pub r#content: ChatCompletionRequestDeveloperMessage_Content,
1548
1549    /// An optional name for the participant.
1550    pub r#name: Option<String>,
1551}
1552
1553/// The contents of the developer message.
1554#[derive(Clone, Debug)]
1555#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1556#[cfg_attr(feature = "serde", serde(untagged))]
1557pub enum ChatCompletionRequestDeveloperMessage_Content {
1558    /// The contents of the developer message.
1559    Text(String),
1560
1561    /// An array of content parts with a defined type.
1562    Array(Vec<ChatCompletionRequestMessageContentPartText>),
1563}
1564
1565#[derive(Clone, Debug, Default)]
1566#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1567pub struct ChatCompletionRequestFunctionMessage {
1568    /// The contents of the function message.
1569    pub r#content: Option<String>,
1570
1571    /// The name of the function to call.
1572    pub r#name: String,
1573}
1574
1575include!("schemas/chat_completion_request_message.rs");
1576
1577/// Learn about [audio inputs](/docs/guides/audio).
1578#[derive(Clone, Debug)]
1579#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1580pub struct ChatCompletionRequestMessageContentPartAudio {
1581    /// The type of the content part.
1582    pub r#type: String,
1583
1584    pub r#input_audio: ChatCompletionRequestMessageContentPartAudio_InputAudio,
1585}
1586
1587#[derive(Clone, Debug, Default)]
1588#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1589pub struct ChatCompletionRequestMessageContentPartAudio_InputAudio {
1590    /// Base64 encoded audio data.
1591    pub r#data: String,
1592
1593    /// The format of the encoded audio data.
1594    pub r#format: String,
1595}
1596
1597/// Learn about [file inputs](/docs/guides/text) for text generation.
1598#[derive(Clone, Debug)]
1599#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1600pub struct ChatCompletionRequestMessageContentPartFile {
1601    /// The type of the content part.
1602    pub r#type: String,
1603
1604    pub r#file: ChatCompletionRequestMessageContentPartFile_File,
1605}
1606
1607#[derive(Clone, Debug, Default)]
1608#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1609pub struct ChatCompletionRequestMessageContentPartFile_File {
1610    /// The name of the file, used when passing the file to the model as a
1611    /// string.
1612    pub r#filename: Option<String>,
1613
1614    /// The base64 encoded file data, used when passing the file to the model as
1615    /// a string.
1616    pub r#file_data: Option<String>,
1617
1618    /// The ID of an uploaded file to use as input.
1619    pub r#file_id: Option<String>,
1620}
1621
1622/// Learn about [image inputs](/docs/guides/vision).
1623#[derive(Clone, Debug)]
1624#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1625pub struct ChatCompletionRequestMessageContentPartImage {
1626    /// The type of the content part.
1627    pub r#type: String,
1628
1629    pub r#image_url: ChatCompletionRequestMessageContentPartImage_ImageUrl,
1630}
1631
1632#[derive(Clone, Debug, Default)]
1633#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1634pub struct ChatCompletionRequestMessageContentPartImage_ImageUrl {
1635    /// Either a URL of the image or the base64 encoded image data.
1636    pub r#url: String,
1637
1638    /// Specifies the detail level of the image.
1639    pub r#detail: Option<String>,
1640}
1641
1642#[derive(Clone, Debug, Default)]
1643#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1644pub struct ChatCompletionRequestMessageContentPartRefusal {
1645    /// The type of the content part.
1646    pub r#type: String,
1647
1648    /// The refusal message generated by the model.
1649    pub r#refusal: String,
1650}
1651
1652/// Learn about [text inputs](/docs/guides/text-generation).
1653#[derive(Clone, Debug, Default)]
1654#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1655pub struct ChatCompletionRequestMessageContentPartText {
1656    /// The type of the content part.
1657    pub r#type: String,
1658
1659    /// The text content.
1660    pub r#text: String,
1661}
1662
1663/// Developer-provided instructions that the model should follow, regardless of
1664/// messages sent by the user.
1665#[derive(Clone, Debug)]
1666#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1667pub struct ChatCompletionRequestSystemMessage {
1668    pub r#content: ChatCompletionRequestSystemMessage_Content,
1669
1670    /// An optional name for the participant.
1671    pub r#name: Option<String>,
1672}
1673
1674/// The contents of the system message.
1675#[derive(Clone, Debug)]
1676#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1677#[cfg_attr(feature = "serde", serde(untagged))]
1678pub enum ChatCompletionRequestSystemMessage_Content {
1679    /// The contents of the system message.
1680    Text(String),
1681
1682    /// An array of content parts with a defined type.
1683    Array(Vec<ChatCompletionRequestMessageContentPartText>),
1684}
1685
1686#[derive(Clone, Debug)]
1687#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1688pub struct ChatCompletionRequestToolMessage {
1689    pub r#content: ChatCompletionRequestToolMessage_Content,
1690
1691    /// Tool call that this message is responding to.
1692    pub r#tool_call_id: String,
1693}
1694
1695/// The contents of the tool message.
1696#[derive(Clone, Debug)]
1697#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1698#[cfg_attr(feature = "serde", serde(untagged))]
1699pub enum ChatCompletionRequestToolMessage_Content {
1700    /// The contents of the tool message.
1701    Text(String),
1702
1703    /// An array of content parts with a defined type.
1704    Array(Vec<ChatCompletionRequestMessageContentPartText>),
1705}
1706
1707/// Messages sent by an end user, containing prompts or additional context
1708/// information.
1709#[derive(Clone, Debug)]
1710#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1711pub struct ChatCompletionRequestUserMessage {
1712    pub r#content: ChatCompletionRequestUserMessage_Content,
1713
1714    /// An optional name for the participant.
1715    pub r#name: Option<String>,
1716}
1717
1718#[derive(Clone, Debug)]
1719#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1720#[cfg_attr(feature = "serde", serde(untagged))]
1721pub enum ChatCompletionRequestUserMessageContentPart {
1722    ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
1723
1724    ChatCompletionRequestMessageContentPartImage(ChatCompletionRequestMessageContentPartImage),
1725
1726    ChatCompletionRequestMessageContentPartAudio(ChatCompletionRequestMessageContentPartAudio),
1727
1728    ChatCompletionRequestMessageContentPartFile(ChatCompletionRequestMessageContentPartFile),
1729}
1730
1731/// The contents of the user message.
1732#[derive(Clone, Debug)]
1733#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1734#[cfg_attr(feature = "serde", serde(untagged))]
1735pub enum ChatCompletionRequestUserMessage_Content {
1736    /// The text contents of the message.
1737    Text(String),
1738
1739    /// An array of content parts with a defined type.
1740    Array(Vec<ChatCompletionRequestUserMessageContentPart>),
1741}
1742
1743/// A chat completion message generated by the model.
1744#[derive(Clone, Debug, Default)]
1745#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1746pub struct ChatCompletionResponseMessage {
1747    /// The contents of the message.
1748    pub r#content: Option<String>,
1749
1750    /// The refusal message generated by the model.
1751    pub r#refusal: Option<String>,
1752
1753    pub r#tool_calls: Option<ChatCompletionMessageToolCalls>,
1754
1755    /// Annotations for the message, when applicable, as when using the [web
1756    /// search tool](/docs/guides/tools-web-search?api-mode=chat).
1757    pub r#annotations: Option<Vec<ChatCompletionResponseMessage_Annotations>>,
1758
1759    /// The role of the author of this message.
1760    pub r#role: String,
1761
1762    pub r#function_call: Option<ChatCompletionResponseMessage_FunctionCall>,
1763
1764    pub r#audio: Option<ChatCompletionResponseMessage_Audio>,
1765}
1766
1767/// A URL citation when using web search.
1768#[derive(Clone, Debug)]
1769#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1770pub struct ChatCompletionResponseMessage_Annotations {
1771    /// The type of the URL citation.
1772    pub r#type: String,
1773
1774    pub r#url_citation: ChatCompletionResponseMessage_Annotations_UrlCitation,
1775}
1776
1777/// A URL citation when using web search.
1778#[derive(Clone, Debug, Default)]
1779#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1780pub struct ChatCompletionResponseMessage_Annotations_UrlCitation {
1781    /// The index of the last character of the URL citation in the message.
1782    pub r#end_index: i64,
1783
1784    /// The index of the first character of the URL citation in the message.
1785    pub r#start_index: i64,
1786
1787    /// The URL of the web resource.
1788    pub r#url: String,
1789
1790    /// The title of the web resource.
1791    pub r#title: String,
1792}
1793
1794/// If the audio output modality is requested, this object contains data about
1795/// the audio response from the model.
1796#[derive(Clone, Debug, Default)]
1797#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1798pub struct ChatCompletionResponseMessage_Audio {
1799    /// Unique identifier for this audio response.
1800    pub r#id: String,
1801
1802    /// The Unix timestamp (in seconds) for when this audio response will no
1803    /// longer be accessible on the server for use in multi-turn conversations.
1804    pub r#expires_at: i64,
1805
1806    /// Base64 encoded audio bytes generated by the model, in the format
1807    /// specified in the request.
1808    pub r#data: String,
1809
1810    /// Transcript of the audio generated by the model.
1811    pub r#transcript: String,
1812}
1813
1814/// Deprecated and replaced by `tool_calls`.
1815#[derive(Clone, Debug, Default)]
1816#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1817pub struct ChatCompletionResponseMessage_FunctionCall {
1818    /// The arguments to call the function with, as generated by the model in
1819    /// JSON format.
1820    pub r#arguments: String,
1821
1822    /// The name of the function to call.
1823    pub r#name: String,
1824}
1825
1826/// The role of the author of a message
1827#[derive(Clone, Debug)]
1828#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1829pub enum ChatCompletionRole {
1830    #[cfg_attr(feature = "serde", serde(rename = "developer"))]
1831    Developer,
1832
1833    #[cfg_attr(feature = "serde", serde(rename = "system"))]
1834    System,
1835
1836    #[cfg_attr(feature = "serde", serde(rename = "user"))]
1837    User,
1838
1839    #[cfg_attr(feature = "serde", serde(rename = "assistant"))]
1840    Assistant,
1841
1842    #[cfg_attr(feature = "serde", serde(rename = "tool"))]
1843    Tool,
1844
1845    #[cfg_attr(feature = "serde", serde(rename = "function"))]
1846    Function,
1847
1848    #[cfg_attr(feature = "serde", serde(untagged))]
1849    Other(String),
1850}
1851
1852/// Options for streaming response.
1853#[derive(Clone, Debug, Default)]
1854#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1855pub struct ChatCompletionStreamOptions {
1856    /// If set, an additional chunk will be streamed before the `data: [DONE]`
1857    /// message.
1858    pub r#include_usage: Option<bool>,
1859}
1860
1861/// A chat completion delta generated by streamed model responses.
1862#[derive(Clone, Debug, Default)]
1863#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1864pub struct ChatCompletionStreamResponseDelta {
1865    /// The contents of the chunk message.
1866    pub r#content: Option<String>,
1867
1868    pub r#function_call: Option<ChatCompletionStreamResponseDelta_FunctionCall>,
1869
1870    pub r#tool_calls: Option<Vec<ChatCompletionMessageToolCallChunk>>,
1871
1872    /// The role of the author of this message.
1873    pub r#role: Option<String>,
1874
1875    /// The refusal message generated by the model.
1876    pub r#refusal: Option<String>,
1877}
1878
1879/// Deprecated and replaced by `tool_calls`.
1880#[derive(Clone, Debug, Default)]
1881#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1882pub struct ChatCompletionStreamResponseDelta_FunctionCall {
1883    /// The arguments to call the function with, as generated by the model in
1884    /// JSON format.
1885    pub r#arguments: Option<String>,
1886
1887    /// The name of the function to call.
1888    pub r#name: Option<String>,
1889}
1890
1891#[derive(Clone, Debug, Default)]
1892#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1893pub struct ChatCompletionTokenLogprob {
1894    /// The token.
1895    pub r#token: String,
1896
1897    /// The log probability of this token, if it is within the top 20 most
1898    /// likely tokens.
1899    pub r#logprob: f64,
1900
1901    /// A list of integers representing the UTF-8 bytes representation of the
1902    /// token.
1903    pub r#bytes: Option<Vec<i64>>,
1904
1905    /// List of the most likely tokens and their log probability, at this token
1906    /// position.
1907    pub r#top_logprobs: Vec<ChatCompletionTokenLogprob_TopLogprobs>,
1908}
1909
1910#[derive(Clone, Debug, Default)]
1911#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1912pub struct ChatCompletionTokenLogprob_TopLogprobs {
1913    /// The token.
1914    pub r#token: String,
1915
1916    /// The log probability of this token, if it is within the top 20 most
1917    /// likely tokens.
1918    pub r#logprob: f64,
1919
1920    /// A list of integers representing the UTF-8 bytes representation of the
1921    /// token.
1922    pub r#bytes: Option<Vec<i64>>,
1923}
1924
1925#[derive(Clone, Debug)]
1926#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1927pub struct ChatCompletionTool {
1928    /// The type of the tool.
1929    pub r#type: String,
1930
1931    pub r#function: FunctionObject,
1932}
1933
1934/// Controls which (if any) tool is called by the model.
1935#[derive(Clone, Debug)]
1936#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1937#[cfg_attr(feature = "serde", serde(untagged))]
1938pub enum ChatCompletionToolChoiceOption {
1939    /// `none` means the model will not call any tool and instead generates a
1940    /// message.
1941    Text(String),
1942
1943    ChatCompletionNamedToolChoice(ChatCompletionNamedToolChoice),
1944}
1945
1946/// The chunking strategy used to chunk the file(s).
1947#[derive(Clone, Debug)]
1948#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1949#[cfg_attr(feature = "serde", serde(untagged))]
1950pub enum ChunkingStrategyRequestParam {
1951    AutoChunkingStrategyRequestParam(AutoChunkingStrategyRequestParam),
1952
1953    StaticChunkingStrategyRequestParam(StaticChunkingStrategyRequestParam),
1954}
1955
1956/// A click action.
1957#[derive(Clone, Debug, Default)]
1958#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1959pub struct Click {
1960    /// Specifies the event type.
1961    pub r#type: String,
1962
1963    /// Indicates which mouse button was pressed during the click.
1964    pub r#button: String,
1965
1966    /// The x-coordinate where the click occurred.
1967    pub r#x: i64,
1968
1969    /// The y-coordinate where the click occurred.
1970    pub r#y: i64,
1971}
1972
1973/// The output of a code interpreter tool call that is a file.
1974#[derive(Clone, Debug, Default)]
1975#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1976pub struct CodeInterpreterFileOutput {
1977    /// The type of the code interpreter file output.
1978    pub r#type: String,
1979
1980    pub r#files: Vec<CodeInterpreterFileOutput_Files>,
1981}
1982
1983#[derive(Clone, Debug, Default)]
1984#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1985pub struct CodeInterpreterFileOutput_Files {
1986    /// The MIME type of the file.
1987    pub r#mime_type: String,
1988
1989    /// The ID of the file.
1990    pub r#file_id: String,
1991}
1992
1993/// The output of a code interpreter tool call that is text.
1994#[derive(Clone, Debug, Default)]
1995#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1996pub struct CodeInterpreterTextOutput {
1997    /// The type of the code interpreter text output.
1998    pub r#type: String,
1999
2000    /// The logs of the code interpreter tool call.
2001    pub r#logs: String,
2002}
2003
2004/// A tool call to run code.
2005#[derive(Clone, Debug, Default)]
2006#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2007pub struct CodeInterpreterToolCall {
2008    /// The unique ID of the code interpreter tool call.
2009    pub r#id: String,
2010
2011    /// The type of the code interpreter tool call.
2012    pub r#type: String,
2013
2014    /// The code to run.
2015    pub r#code: String,
2016
2017    /// The status of the code interpreter tool call.
2018    pub r#status: String,
2019
2020    /// The results of the code interpreter tool call.
2021    pub r#results: Vec<CodeInterpreterToolOutput>,
2022}
2023
2024#[derive(Clone, Debug)]
2025#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2026#[cfg_attr(feature = "serde", serde(untagged))]
2027pub enum CodeInterpreterToolOutput {
2028    CodeInterpreterTextOutput(CodeInterpreterTextOutput),
2029
2030    CodeInterpreterFileOutput(CodeInterpreterFileOutput),
2031}
2032
2033/// A filter used to compare a specified attribute key to a given value using a
2034/// defined comparison operation.
2035#[derive(Clone, Debug)]
2036#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2037pub struct ComparisonFilter {
2038    /// Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`.
2039    pub r#type: String,
2040
2041    /// The key to compare against the value.
2042    pub r#key: String,
2043
2044    pub r#value: ComparisonFilter_Value,
2045}
2046
2047/// The value to compare against the attribute key; supports string, number, or
2048/// boolean types.
2049#[derive(Clone, Debug)]
2050#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2051#[cfg_attr(feature = "serde", serde(untagged))]
2052pub enum ComparisonFilter_Value {
2053    Text(String),
2054
2055    Number(f64),
2056
2057    Boolean(bool),
2058}
2059
2060#[derive(Clone, Debug, Default)]
2061#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2062pub struct CompleteUploadRequest {
2063    /// The ordered list of Part IDs.
2064    pub r#part_ids: Vec<String>,
2065
2066    /// The optional md5 checksum for the file contents to verify if the bytes
2067    /// uploaded matches what you expect.
2068    pub r#md5: Option<String>,
2069}
2070
2071/// Usage statistics for the completion request.
2072#[derive(Clone, Debug, Default)]
2073#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2074pub struct CompletionUsage {
2075    /// Number of tokens in the generated completion.
2076    pub r#completion_tokens: i64,
2077
2078    /// Number of tokens in the prompt.
2079    pub r#prompt_tokens: i64,
2080
2081    /// Total number of tokens used in the request (prompt + completion).
2082    pub r#total_tokens: i64,
2083
2084    pub r#completion_tokens_details: Option<CompletionUsage_CompletionTokensDetails>,
2085
2086    pub r#prompt_tokens_details: Option<CompletionUsage_PromptTokensDetails>,
2087}
2088
2089/// Breakdown of tokens used in a completion.
2090#[derive(Clone, Debug, Default)]
2091#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2092pub struct CompletionUsage_CompletionTokensDetails {
2093    /// When using Predicted Outputs, the number of tokens in the prediction
2094    /// that appeared in the completion.
2095    pub r#accepted_prediction_tokens: Option<i64>,
2096
2097    /// Audio input tokens generated by the model.
2098    pub r#audio_tokens: Option<i64>,
2099
2100    /// Tokens generated by the model for reasoning.
2101    pub r#reasoning_tokens: Option<i64>,
2102
2103    /// When using Predicted Outputs, the number of tokens in the prediction
2104    /// that did not appear in the completion.
2105    pub r#rejected_prediction_tokens: Option<i64>,
2106}
2107
2108/// Breakdown of tokens used in the prompt.
2109#[derive(Clone, Debug, Default)]
2110#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2111pub struct CompletionUsage_PromptTokensDetails {
2112    /// Audio input tokens present in the prompt.
2113    pub r#audio_tokens: Option<i64>,
2114
2115    /// Cached tokens present in the prompt.
2116    pub r#cached_tokens: Option<i64>,
2117}
2118
2119/// Combine multiple filters using `and` or `or`.
2120#[derive(Clone, Debug, Default)]
2121#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2122pub struct CompoundFilter {
2123    /// Type of operation: `and` or `or`.
2124    pub r#type: String,
2125
2126    /// Array of filters to combine.
2127    pub r#filters: Vec<ComparisonFilter>,
2128}
2129
2130#[derive(Clone, Debug)]
2131#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2132#[cfg_attr(feature = "serde", serde(untagged))]
2133pub enum ComputerAction {
2134    Click(Click),
2135
2136    DoubleClick(DoubleClick),
2137
2138    Drag(Drag),
2139
2140    KeyPress(KeyPress),
2141
2142    Move(Move),
2143
2144    Screenshot(Screenshot),
2145
2146    Scroll(Scroll),
2147
2148    Type(Type),
2149
2150    Wait(Wait),
2151}
2152
2153/// The output of a computer tool call.
2154#[derive(Clone, Debug)]
2155#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2156pub struct ComputerCallOutputItemParam {
2157    pub r#id: Option<ComputerCallOutputItemParam_Id>,
2158
2159    /// The ID of the computer tool call that produced the output.
2160    pub r#call_id: String,
2161
2162    /// The type of the computer tool call output.
2163    pub r#type: String,
2164
2165    pub r#output: ComputerScreenshotImage,
2166
2167    pub r#acknowledged_safety_checks: Option<ComputerCallOutputItemParam_AcknowledgedSafetyChecks>,
2168
2169    pub r#status: Option<ComputerCallOutputItemParam_Status>,
2170}
2171
2172pub type ComputerCallOutputItemParam_AcknowledgedSafetyChecks = Option<ComputerCallOutputItemParam_AcknowledgedSafetyChecks_1>;
2173
2174/// The safety checks reported by the API that have been acknowledged by the
2175/// developer.
2176pub type ComputerCallOutputItemParam_AcknowledgedSafetyChecks_1 = Vec<ComputerCallSafetyCheckParam>;
2177
2178pub type ComputerCallOutputItemParam_Id = Option<String>;
2179
2180pub type ComputerCallOutputItemParam_Status = Option<String>;
2181
2182/// A pending safety check for the computer call.
2183#[derive(Clone, Debug, Default)]
2184#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2185pub struct ComputerCallSafetyCheckParam {
2186    /// The ID of the pending safety check.
2187    pub r#id: String,
2188
2189    pub r#code: Option<ComputerCallSafetyCheckParam_Code>,
2190
2191    pub r#message: Option<ComputerCallSafetyCheckParam_Message>,
2192}
2193
2194pub type ComputerCallSafetyCheckParam_Code = Option<String>;
2195
2196pub type ComputerCallSafetyCheckParam_Message = Option<String>;
2197
2198/// A computer screenshot image used with the computer use tool.
2199#[derive(Clone, Debug, Default)]
2200#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2201pub struct ComputerScreenshotImage {
2202    /// Specifies the event type.
2203    pub r#type: String,
2204
2205    /// The URL of the screenshot image.
2206    pub r#image_url: Option<String>,
2207
2208    /// The identifier of an uploaded file that contains the screenshot.
2209    pub r#file_id: Option<String>,
2210}
2211
2212/// A tool call to a computer use tool.
2213#[derive(Clone, Debug)]
2214#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2215pub struct ComputerToolCall {
2216    /// The type of the computer call.
2217    pub r#type: String,
2218
2219    /// The unique ID of the computer call.
2220    pub r#id: String,
2221
2222    /// An identifier used when responding to the tool call with output.
2223    pub r#call_id: String,
2224
2225    pub r#action: ComputerAction,
2226
2227    /// The pending safety checks for the computer call.
2228    pub r#pending_safety_checks: Vec<ComputerToolCallSafetyCheck>,
2229
2230    /// The status of the item.
2231    pub r#status: String,
2232}
2233
2234/// The output of a computer tool call.
2235#[derive(Clone, Debug)]
2236#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2237pub struct ComputerToolCallOutput {
2238    /// The type of the computer tool call output.
2239    pub r#type: String,
2240
2241    /// The ID of the computer tool call output.
2242    pub r#id: Option<String>,
2243
2244    /// The ID of the computer tool call that produced the output.
2245    pub r#call_id: String,
2246
2247    /// The safety checks reported by the API that have been acknowledged by the
2248    /// developer.
2249    pub r#acknowledged_safety_checks: Option<Vec<ComputerToolCallSafetyCheck>>,
2250
2251    pub r#output: ComputerScreenshotImage,
2252
2253    /// The status of the message input.
2254    pub r#status: Option<String>,
2255}
2256
2257#[derive(Clone, Debug)]
2258#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2259pub struct ComputerToolCallOutputResource {
2260    /// The type of the computer tool call output.
2261    pub r#type: String,
2262
2263    /// The unique ID of the computer call tool output.
2264    pub r#id: String,
2265
2266    /// The ID of the computer tool call that produced the output.
2267    pub r#call_id: String,
2268
2269    /// The safety checks reported by the API that have been acknowledged by the
2270    /// developer.
2271    pub r#acknowledged_safety_checks: Option<Vec<ComputerToolCallSafetyCheck>>,
2272
2273    pub r#output: ComputerScreenshotImage,
2274
2275    /// The status of the message input.
2276    pub r#status: Option<String>,
2277}
2278
2279#[derive(Clone, Debug, Default)]
2280#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2281pub struct ComputerToolCallOutputResource_Variant2 {
2282    /// The unique ID of the computer call tool output.
2283    pub r#id: String,
2284}
2285
2286/// A pending safety check for the computer call.
2287#[derive(Clone, Debug, Default)]
2288#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2289pub struct ComputerToolCallSafetyCheck {
2290    /// The ID of the pending safety check.
2291    pub r#id: String,
2292
2293    /// The type of the pending safety check.
2294    pub r#code: String,
2295
2296    /// Details about the pending safety check.
2297    pub r#message: String,
2298}
2299
2300/// A tool that controls a virtual computer.
2301#[derive(Clone, Debug, Default)]
2302#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2303pub struct ComputerUsePreviewTool {
2304    /// The type of the computer use tool.
2305    pub r#type: String,
2306
2307    /// The type of computer environment to control.
2308    pub r#environment: String,
2309
2310    /// The width of the computer display.
2311    pub r#display_width: i64,
2312
2313    /// The height of the computer display.
2314    pub r#display_height: i64,
2315}
2316
2317/// Multi-modal input and output contents.
2318#[derive(Clone, Debug)]
2319#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2320#[cfg_attr(feature = "serde", serde(untagged))]
2321pub enum Content {
2322    InputContent(InputContent),
2323
2324    OutputContent(OutputContent),
2325}
2326
2327/// An x/y coordinate pair, e.g.
2328#[derive(Clone, Debug, Default)]
2329#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2330pub struct Coordinate {
2331    /// The x-coordinate.
2332    pub r#x: i64,
2333
2334    /// The y-coordinate.
2335    pub r#y: i64,
2336}
2337
2338/// The aggregated costs details of the specific time bucket.
2339#[derive(Clone, Debug, Default)]
2340#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2341pub struct CostsResult {
2342    pub r#object: String,
2343
2344    pub r#amount: Option<CostsResult_Amount>,
2345
2346    /// When `group_by=line_item`, this field provides the line item of the
2347    /// grouped costs result.
2348    pub r#line_item: Option<String>,
2349
2350    /// When `group_by=project_id`, this field provides the project ID of the
2351    /// grouped costs result.
2352    pub r#project_id: Option<String>,
2353}
2354
2355/// The monetary value in its associated currency.
2356#[derive(Clone, Debug, Default)]
2357#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2358pub struct CostsResult_Amount {
2359    /// The numeric value of the cost.
2360    pub r#value: Option<f64>,
2361
2362    /// Lowercase ISO-4217 currency e.g.
2363    pub r#currency: Option<String>,
2364}
2365
2366#[derive(Clone, Debug)]
2367#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2368pub struct CreateAssistantRequest {
2369    pub r#model: CreateAssistantRequest_Model,
2370
2371    /// The name of the assistant.
2372    pub r#name: Option<String>,
2373
2374    /// The description of the assistant.
2375    pub r#description: Option<String>,
2376
2377    /// The system instructions that the assistant uses.
2378    pub r#instructions: Option<String>,
2379
2380    pub r#reasoning_effort: Option<ReasoningEffort>,
2381
2382    /// A list of tool enabled on the assistant.
2383    pub r#tools: Option<Vec<CreateAssistantRequest_Tools>>,
2384
2385    pub r#tool_resources: Option<CreateAssistantRequest_ToolResources>,
2386
2387    pub r#metadata: Option<Metadata>,
2388
2389    /// What sampling temperature to use, between 0 and 2.
2390    pub r#temperature: Option<f64>,
2391
2392    /// An alternative to sampling with temperature, called nucleus sampling,
2393    /// where the model considers the results of the tokens with top_p
2394    /// probability mass.
2395    pub r#top_p: Option<f64>,
2396
2397    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
2398}
2399
2400/// ID of the model to use.
2401#[derive(Clone, Debug)]
2402#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2403#[cfg_attr(feature = "serde", serde(untagged))]
2404pub enum CreateAssistantRequest_Model {
2405    Text(String),
2406
2407    AssistantSupportedModels(AssistantSupportedModels),
2408}
2409
2410/// A set of resources that are used by the assistant's tools.
2411#[derive(Clone, Debug, Default)]
2412#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2413pub struct CreateAssistantRequest_ToolResources {
2414    pub r#code_interpreter: Option<CreateAssistantRequest_ToolResources_CodeInterpreter>,
2415
2416    pub r#file_search: Option<CreateAssistantRequest_ToolResources_FileSearch>,
2417}
2418
2419#[derive(Clone, Debug, Default)]
2420#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2421pub struct CreateAssistantRequest_ToolResources_CodeInterpreter {
2422    /// A list of [file](/docs/api-reference/files) IDs made available to the
2423    /// `code_interpreter` tool.
2424    pub r#file_ids: Option<Vec<String>>,
2425}
2426
2427#[derive(Clone, Debug, Default)]
2428#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2429pub struct CreateAssistantRequest_ToolResources_FileSearch {
2430    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
2431    /// this assistant.
2432    pub r#vector_store_ids: Option<Vec<String>>,
2433
2434    /// A helper to create a [vector
2435    /// store](/docs/api-reference/vector-stores/object) with file_ids and
2436    /// attach it to this assistant.
2437    pub r#vector_stores: Option<Vec<CreateAssistantRequest_ToolResources_FileSearch_VectorStores>>,
2438}
2439
2440#[derive(Clone, Debug, Default)]
2441#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2442pub struct CreateAssistantRequest_ToolResources_FileSearch_VectorStores {
2443    /// A list of [file](/docs/api-reference/files) IDs to add to the vector
2444    /// store.
2445    pub r#file_ids: Option<Vec<String>>,
2446
2447    pub r#metadata: Option<Metadata>,
2448}
2449
2450#[derive(Clone, Debug)]
2451#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2452#[cfg_attr(feature = "serde", serde(untagged))]
2453pub enum CreateAssistantRequest_Tools {
2454    AssistantToolsCode(AssistantToolsCode),
2455
2456    AssistantToolsFileSearch(AssistantToolsFileSearch),
2457
2458    AssistantToolsFunction(AssistantToolsFunction),
2459}
2460
2461#[derive(Clone, Debug)]
2462#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2463pub struct CreateChatCompletionRequest {
2464    pub r#metadata: Option<Metadata>,
2465
2466    /// What sampling temperature to use, between 0 and 2.
2467    pub r#temperature: Option<f64>,
2468
2469    /// An alternative to sampling with temperature, called nucleus sampling,
2470    /// where the model considers the results of the tokens with top_p
2471    /// probability mass.
2472    pub r#top_p: Option<f64>,
2473
2474    /// A unique identifier representing your end-user, which can help OpenAI to
2475    /// monitor and detect abuse.
2476    pub r#user: Option<String>,
2477
2478    pub r#service_tier: Option<ServiceTier>,
2479
2480    /// A list of messages comprising the conversation so far.
2481    pub r#messages: Vec<ChatCompletionRequestMessage>,
2482
2483    /// Model ID used to generate the response, like `gpt-4o` or `o3`.
2484    pub r#model: ModelIdsShared,
2485
2486    pub r#modalities: Option<ResponseModalities>,
2487
2488    pub r#reasoning_effort: Option<ReasoningEffort>,
2489
2490    /// An upper bound for the number of tokens that can be generated for a
2491    /// completion, including visible output tokens and [reasoning
2492    /// tokens](/docs/guides/reasoning).
2493    pub r#max_completion_tokens: Option<i64>,
2494
2495    /// Number between -2.0 and 2.0.
2496    pub r#frequency_penalty: Option<f64>,
2497
2498    /// Number between -2.0 and 2.0.
2499    pub r#presence_penalty: Option<f64>,
2500
2501    pub r#web_search_options: Option<CreateChatCompletionRequest_Variant2_WebSearchOptions>,
2502
2503    /// An integer between 0 and 20 specifying the number of most likely tokens
2504    /// to return at each token position, each with an associated log
2505    /// probability.
2506    pub r#top_logprobs: Option<i64>,
2507
2508    pub r#response_format: Option<CreateChatCompletionRequest_Variant2_ResponseFormat>,
2509
2510    pub r#audio: Option<CreateChatCompletionRequest_Variant2_Audio>,
2511
2512    /// Whether or not to store the output of this chat completion request for
2513    /// use in our [model distillation](/docs/guides/distillation) or
2514    /// [evals](/docs/guides/evals) products.
2515    pub r#store: Option<bool>,
2516
2517    /// If set to true, the model response data will be streamed to the client
2518    /// as it is generated using [server-sent
2519    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
2520    pub r#stream: Option<bool>,
2521
2522    pub r#stop: Option<StopConfiguration>,
2523
2524    /// Modify the likelihood of specified tokens appearing in the completion.
2525    pub r#logit_bias: Option<CreateChatCompletionRequest_LogitBias>,
2526
2527    /// Whether to return log probabilities of the output tokens or not.
2528    pub r#logprobs: Option<bool>,
2529
2530    /// The maximum number of [tokens](/tokenizer) that can be generated in the
2531    /// chat completion.
2532    pub r#max_tokens: Option<i64>,
2533
2534    /// How many chat completion choices to generate for each input message.
2535    pub r#n: Option<i64>,
2536
2537    pub r#prediction: Option<PredictionContent>,
2538
2539    /// This feature is in Beta.
2540    pub r#seed: Option<i64>,
2541
2542    pub r#stream_options: Option<ChatCompletionStreamOptions>,
2543
2544    /// A list of tools the model may call.
2545    pub r#tools: Option<Vec<ChatCompletionTool>>,
2546
2547    pub r#tool_choice: Option<ChatCompletionToolChoiceOption>,
2548
2549    pub r#parallel_tool_calls: Option<ParallelToolCalls>,
2550
2551    pub r#function_call: Option<CreateChatCompletionRequest_Variant2_FunctionCall>,
2552
2553    /// Deprecated in favor of `tools`.
2554    pub r#functions: Option<Vec<ChatCompletionFunctions>>,
2555}
2556
2557/// Modify the likelihood of specified tokens appearing in the completion.
2558#[derive(Clone, Debug, Default)]
2559#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2560pub struct CreateChatCompletionRequest_LogitBias;
2561
2562#[derive(Clone, Debug)]
2563#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2564pub struct CreateChatCompletionRequest_Variant2 {
2565    /// A list of messages comprising the conversation so far.
2566    pub r#messages: Vec<ChatCompletionRequestMessage>,
2567
2568    /// Model ID used to generate the response, like `gpt-4o` or `o3`.
2569    pub r#model: ModelIdsShared,
2570
2571    pub r#modalities: Option<ResponseModalities>,
2572
2573    pub r#reasoning_effort: Option<ReasoningEffort>,
2574
2575    /// An upper bound for the number of tokens that can be generated for a
2576    /// completion, including visible output tokens and [reasoning
2577    /// tokens](/docs/guides/reasoning).
2578    pub r#max_completion_tokens: Option<i64>,
2579
2580    /// Number between -2.0 and 2.0.
2581    pub r#frequency_penalty: Option<f64>,
2582
2583    /// Number between -2.0 and 2.0.
2584    pub r#presence_penalty: Option<f64>,
2585
2586    pub r#web_search_options: Option<CreateChatCompletionRequest_Variant2_WebSearchOptions>,
2587
2588    /// An integer between 0 and 20 specifying the number of most likely tokens
2589    /// to return at each token position, each with an associated log
2590    /// probability.
2591    pub r#top_logprobs: Option<i64>,
2592
2593    pub r#response_format: Option<CreateChatCompletionRequest_Variant2_ResponseFormat>,
2594
2595    pub r#audio: Option<CreateChatCompletionRequest_Variant2_Audio>,
2596
2597    /// Whether or not to store the output of this chat completion request for
2598    /// use in our [model distillation](/docs/guides/distillation) or
2599    /// [evals](/docs/guides/evals) products.
2600    pub r#store: Option<bool>,
2601
2602    /// If set to true, the model response data will be streamed to the client
2603    /// as it is generated using [server-sent
2604    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
2605    pub r#stream: Option<bool>,
2606
2607    pub r#stop: Option<StopConfiguration>,
2608
2609    /// Modify the likelihood of specified tokens appearing in the completion.
2610    pub r#logit_bias: Option<CreateChatCompletionRequest_Variant2_LogitBias>,
2611
2612    /// Whether to return log probabilities of the output tokens or not.
2613    pub r#logprobs: Option<bool>,
2614
2615    /// The maximum number of [tokens](/tokenizer) that can be generated in the
2616    /// chat completion.
2617    pub r#max_tokens: Option<i64>,
2618
2619    /// How many chat completion choices to generate for each input message.
2620    pub r#n: Option<i64>,
2621
2622    pub r#prediction: Option<PredictionContent>,
2623
2624    /// This feature is in Beta.
2625    pub r#seed: Option<i64>,
2626
2627    pub r#stream_options: Option<ChatCompletionStreamOptions>,
2628
2629    /// A list of tools the model may call.
2630    pub r#tools: Option<Vec<ChatCompletionTool>>,
2631
2632    pub r#tool_choice: Option<ChatCompletionToolChoiceOption>,
2633
2634    pub r#parallel_tool_calls: Option<ParallelToolCalls>,
2635
2636    pub r#function_call: Option<CreateChatCompletionRequest_Variant2_FunctionCall>,
2637
2638    /// Deprecated in favor of `tools`.
2639    pub r#functions: Option<Vec<ChatCompletionFunctions>>,
2640}
2641
2642/// Modify the likelihood of specified tokens appearing in the completion.
2643#[derive(Clone, Debug, Default)]
2644#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2645pub struct CreateChatCompletionRequest_Variant2_LogitBias;
2646
2647/// Parameters for audio output.
2648#[derive(Clone, Debug)]
2649#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2650pub struct CreateChatCompletionRequest_Variant2_Audio {
2651    /// The voice the model uses to respond.
2652    pub r#voice: VoiceIdsShared,
2653
2654    /// Specifies the output audio format.
2655    pub r#format: String,
2656}
2657
2658/// Deprecated in favor of `tool_choice`.
2659#[derive(Clone, Debug)]
2660#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2661#[cfg_attr(feature = "serde", serde(untagged))]
2662pub enum CreateChatCompletionRequest_Variant2_FunctionCall {
2663    /// `none` means the model will not call a function and instead generates a
2664    /// message.
2665    Text(String),
2666
2667    ChatCompletionFunctionCallOption(ChatCompletionFunctionCallOption),
2668}
2669
2670/// An object specifying the format that the model must output.
2671#[derive(Clone, Debug)]
2672#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2673#[cfg_attr(feature = "serde", serde(untagged))]
2674pub enum CreateChatCompletionRequest_Variant2_ResponseFormat {
2675    ResponseFormatText(ResponseFormatText),
2676
2677    ResponseFormatJsonSchema(ResponseFormatJsonSchema),
2678
2679    ResponseFormatJsonObject(ResponseFormatJsonObject),
2680}
2681
2682/// This tool searches the web for relevant results to use in a response.
2683#[derive(Clone, Debug, Default)]
2684#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2685pub struct CreateChatCompletionRequest_Variant2_WebSearchOptions {
2686    pub r#user_location: Option<CreateChatCompletionRequest_Variant2_WebSearchOptions_UserLocation>,
2687
2688    pub r#search_context_size: Option<WebSearchContextSize>,
2689}
2690
2691/// Approximate location parameters for the search.
2692#[derive(Clone, Debug)]
2693#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2694pub struct CreateChatCompletionRequest_Variant2_WebSearchOptions_UserLocation {
2695    /// The type of location approximation.
2696    pub r#type: String,
2697
2698    pub r#approximate: WebSearchLocation,
2699}
2700
2701/// Represents a chat completion response returned by model, based on the
2702/// provided input.
2703#[derive(Clone, Debug, Default)]
2704#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2705pub struct CreateChatCompletionResponse {
2706    /// A unique identifier for the chat completion.
2707    pub r#id: String,
2708
2709    /// A list of chat completion choices.
2710    pub r#choices: Vec<CreateChatCompletionResponse_Choices>,
2711
2712    /// The Unix timestamp (in seconds) of when the chat completion was created.
2713    pub r#created: i64,
2714
2715    /// The model used for the chat completion.
2716    pub r#model: String,
2717
2718    pub r#service_tier: Option<ServiceTier>,
2719
2720    /// This fingerprint represents the backend configuration that the model
2721    /// runs with.
2722    pub r#system_fingerprint: Option<String>,
2723
2724    /// The object type, which is always `chat.completion`.
2725    pub r#object: String,
2726
2727    pub r#usage: Option<CompletionUsage>,
2728}
2729
2730#[derive(Clone, Debug)]
2731#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2732pub struct CreateChatCompletionResponse_Choices {
2733    /// The reason the model stopped generating tokens.
2734    pub r#finish_reason: String,
2735
2736    /// The index of the choice in the list of choices.
2737    pub r#index: i64,
2738
2739    pub r#message: ChatCompletionResponseMessage,
2740
2741    pub r#logprobs: Option<CreateChatCompletionResponse_Choices_Logprobs>,
2742}
2743
2744/// Log probability information for the choice.
2745#[derive(Clone, Debug, Default)]
2746#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2747pub struct CreateChatCompletionResponse_Choices_Logprobs {
2748    /// A list of message content tokens with log probability information.
2749    pub r#content: Option<Vec<ChatCompletionTokenLogprob>>,
2750
2751    /// A list of message refusal tokens with log probability information.
2752    pub r#refusal: Option<Vec<ChatCompletionTokenLogprob>>,
2753}
2754
2755/// Represents a streamed chunk of a chat completion response returned by the
2756/// model, based on the provided input.
2757#[derive(Clone, Debug, Default)]
2758#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2759pub struct CreateChatCompletionStreamResponse {
2760    /// A unique identifier for the chat completion.
2761    pub r#id: String,
2762
2763    /// A list of chat completion choices.
2764    pub r#choices: Vec<CreateChatCompletionStreamResponse_Choices>,
2765
2766    /// The Unix timestamp (in seconds) of when the chat completion was created.
2767    pub r#created: i64,
2768
2769    /// The model to generate the completion.
2770    pub r#model: String,
2771
2772    pub r#service_tier: Option<ServiceTier>,
2773
2774    /// This fingerprint represents the backend configuration that the model
2775    /// runs with.
2776    pub r#system_fingerprint: Option<String>,
2777
2778    /// The object type, which is always `chat.completion.chunk`.
2779    pub r#object: String,
2780
2781    /// An optional field that will only be present when you set
2782    /// `stream_options: {"include_usage": true}` in your request.
2783    pub r#usage: Option<CompletionUsage>,
2784}
2785
2786#[derive(Clone, Debug)]
2787#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2788pub struct CreateChatCompletionStreamResponse_Choices {
2789    pub r#delta: ChatCompletionStreamResponseDelta,
2790
2791    pub r#logprobs: Option<CreateChatCompletionStreamResponse_Choices_Logprobs>,
2792
2793    /// The reason the model stopped generating tokens.
2794    pub r#finish_reason: Option<String>,
2795
2796    /// The index of the choice in the list of choices.
2797    pub r#index: i64,
2798}
2799
2800/// Log probability information for the choice.
2801#[derive(Clone, Debug, Default)]
2802#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2803pub struct CreateChatCompletionStreamResponse_Choices_Logprobs {
2804    /// A list of message content tokens with log probability information.
2805    pub r#content: Option<Vec<ChatCompletionTokenLogprob>>,
2806
2807    /// A list of message refusal tokens with log probability information.
2808    pub r#refusal: Option<Vec<ChatCompletionTokenLogprob>>,
2809}
2810
2811#[derive(Clone, Debug)]
2812#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2813pub struct CreateCompletionRequest {
2814    pub r#model: CreateCompletionRequest_Model,
2815
2816    pub r#prompt: Option<CreateCompletionRequest_Prompt>,
2817
2818    /// Generates `best_of` completions server-side and returns the "best" (the
2819    /// one with the highest log probability per token).
2820    pub r#best_of: Option<i64>,
2821
2822    /// Echo back the prompt in addition to the completion
2823    pub r#echo: Option<bool>,
2824
2825    /// Number between -2.0 and 2.0.
2826    pub r#frequency_penalty: Option<f64>,
2827
2828    /// Modify the likelihood of specified tokens appearing in the completion.
2829    pub r#logit_bias: Option<CreateCompletionRequest_LogitBias>,
2830
2831    /// Include the log probabilities on the `logprobs` most likely output
2832    /// tokens, as well the chosen tokens.
2833    pub r#logprobs: Option<i64>,
2834
2835    /// The maximum number of [tokens](/tokenizer) that can be generated in the
2836    /// completion.
2837    pub r#max_tokens: Option<i64>,
2838
2839    /// How many completions to generate for each prompt.
2840    pub r#n: Option<i64>,
2841
2842    /// Number between -2.0 and 2.0.
2843    pub r#presence_penalty: Option<f64>,
2844
2845    /// If specified, our system will make a best effort to sample
2846    /// deterministically, such that repeated requests with the same `seed` and
2847    /// parameters should return the same result.
2848    pub r#seed: Option<i64>,
2849
2850    pub r#stop: Option<StopConfiguration>,
2851
2852    /// Whether to stream back partial progress.
2853    pub r#stream: Option<bool>,
2854
2855    pub r#stream_options: Option<ChatCompletionStreamOptions>,
2856
2857    /// The suffix that comes after a completion of inserted text.
2858    pub r#suffix: Option<String>,
2859
2860    /// What sampling temperature to use, between 0 and 2.
2861    pub r#temperature: Option<f64>,
2862
2863    /// An alternative to sampling with temperature, called nucleus sampling,
2864    /// where the model considers the results of the tokens with top_p
2865    /// probability mass.
2866    pub r#top_p: Option<f64>,
2867
2868    /// A unique identifier representing your end-user, which can help OpenAI to
2869    /// monitor and detect abuse.
2870    pub r#user: Option<String>,
2871}
2872
2873/// Modify the likelihood of specified tokens appearing in the completion.
2874#[derive(Clone, Debug, Default)]
2875#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2876pub struct CreateCompletionRequest_LogitBias;
2877
2878/// ID of the model to use.
2879pub type CreateCompletionRequest_Model = String;
2880
2881/// The prompt(s) to generate completions for, encoded as a string, array of
2882/// strings, array of tokens, or array of token arrays.
2883#[derive(Clone, Debug)]
2884#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2885#[cfg_attr(feature = "serde", serde(untagged))]
2886pub enum CreateCompletionRequest_Prompt {
2887    Text(String),
2888
2889    TextArray(Vec<String>),
2890
2891    TokenArray(Vec<i64>),
2892
2893    TokenArrayArray(Vec<Vec<i64>>),
2894}
2895
2896/// Represents a completion response from the API.
2897#[derive(Clone, Debug, Default)]
2898#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2899pub struct CreateCompletionResponse {
2900    /// A unique identifier for the completion.
2901    pub r#id: String,
2902
2903    /// The list of completion choices the model generated for the input prompt.
2904    pub r#choices: Vec<CreateCompletionResponse_Choices>,
2905
2906    /// The Unix timestamp (in seconds) of when the completion was created.
2907    pub r#created: i64,
2908
2909    /// The model used for completion.
2910    pub r#model: String,
2911
2912    /// This fingerprint represents the backend configuration that the model
2913    /// runs with.
2914    pub r#system_fingerprint: Option<String>,
2915
2916    /// The object type, which is always "text_completion"
2917    pub r#object: String,
2918
2919    pub r#usage: Option<CompletionUsage>,
2920}
2921
2922#[derive(Clone, Debug, Default)]
2923#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2924pub struct CreateCompletionResponse_Choices {
2925    /// The reason the model stopped generating tokens.
2926    pub r#finish_reason: String,
2927
2928    pub r#index: i64,
2929
2930    pub r#logprobs: Option<CreateCompletionResponse_Choices_Logprobs>,
2931
2932    pub r#text: String,
2933}
2934
2935#[derive(Clone, Debug, Default)]
2936#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2937pub struct CreateCompletionResponse_Choices_Logprobs {
2938    pub r#text_offset: Option<Vec<i64>>,
2939
2940    pub r#token_logprobs: Option<Vec<f64>>,
2941
2942    pub r#tokens: Option<Vec<String>>,
2943
2944    pub r#top_logprobs: Option<Vec<CreateCompletionResponse_Choices_Logprobs_TopLogprobs>>,
2945}
2946
2947#[derive(Clone, Debug, Default)]
2948#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2949pub struct CreateCompletionResponse_Choices_Logprobs_TopLogprobs;
2950
2951#[derive(Clone, Debug)]
2952#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2953pub struct CreateEmbeddingRequest {
2954    pub r#input: CreateEmbeddingRequest_Input,
2955
2956    pub r#model: CreateEmbeddingRequest_Model,
2957
2958    /// The format to return the embeddings in.
2959    pub r#encoding_format: Option<String>,
2960
2961    /// The number of dimensions the resulting output embeddings should have.
2962    pub r#dimensions: Option<i64>,
2963
2964    /// A unique identifier representing your end-user, which can help OpenAI to
2965    /// monitor and detect abuse.
2966    pub r#user: Option<String>,
2967}
2968
2969/// Input text to embed, encoded as a string or array of tokens.
2970#[derive(Clone, Debug)]
2971#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2972#[cfg_attr(feature = "serde", serde(untagged))]
2973pub enum CreateEmbeddingRequest_Input {
2974    /// The string that will be turned into an embedding.
2975    Text(String),
2976
2977    /// The array of strings that will be turned into an embedding.
2978    TextArray(Vec<String>),
2979
2980    /// The array of integers that will be turned into an embedding.
2981    TokenArray(Vec<i64>),
2982
2983    /// The array of arrays containing integers that will be turned into an
2984    /// embedding.
2985    TokenArrayArray(Vec<Vec<i64>>),
2986}
2987
2988/// ID of the model to use.
2989pub type CreateEmbeddingRequest_Model = String;
2990
2991#[derive(Clone, Debug)]
2992#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2993pub struct CreateEmbeddingResponse {
2994    /// The list of embeddings generated by the model.
2995    pub r#data: Vec<Embedding>,
2996
2997    /// The name of the model used to generate the embedding.
2998    pub r#model: String,
2999
3000    /// The object type, which is always "list".
3001    pub r#object: String,
3002
3003    pub r#usage: CreateEmbeddingResponse_Usage,
3004}
3005
3006/// The usage information for the request.
3007#[derive(Clone, Debug, Default)]
3008#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3009pub struct CreateEmbeddingResponse_Usage {
3010    /// The number of tokens used by the prompt.
3011    pub r#prompt_tokens: i64,
3012
3013    /// The total number of tokens used by the request.
3014    pub r#total_tokens: i64,
3015}
3016
3017/// A CompletionsRunDataSource object describing a model sampling configuration.
3018#[derive(Clone, Debug)]
3019#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3020pub struct CreateEvalCompletionsRunDataSource {
3021    /// The type of run data source.
3022    pub r#type: String,
3023
3024    pub r#input_messages: Option<CreateEvalCompletionsRunDataSource_InputMessages>,
3025
3026    pub r#sampling_params: Option<CreateEvalCompletionsRunDataSource_SamplingParams>,
3027
3028    /// The name of the model to use for generating completions (e.g.
3029    pub r#model: Option<String>,
3030
3031    pub r#source: CreateEvalCompletionsRunDataSource_Source,
3032}
3033
3034#[derive(Clone, Debug)]
3035#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3036#[cfg_attr(feature = "serde", serde(untagged))]
3037pub enum CreateEvalCompletionsRunDataSource_InputMessages {
3038    CreateEvalCompletionsRunDataSource_InputMessages_Variant1(CreateEvalCompletionsRunDataSource_InputMessages_Variant1),
3039
3040    CreateEvalCompletionsRunDataSource_InputMessages_Variant2(CreateEvalCompletionsRunDataSource_InputMessages_Variant2),
3041}
3042
3043#[derive(Clone, Debug, Default)]
3044#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3045pub struct CreateEvalCompletionsRunDataSource_InputMessages_Variant1 {
3046    /// The type of input messages.
3047    pub r#type: String,
3048
3049    /// A list of chat messages forming the prompt or context.
3050    pub r#template: Vec<CreateEvalCompletionsRunDataSource_InputMessages_Variant1_Template>,
3051}
3052
3053#[derive(Clone, Debug)]
3054#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3055#[cfg_attr(feature = "serde", serde(untagged))]
3056pub enum CreateEvalCompletionsRunDataSource_InputMessages_Variant1_Template {
3057    EasyInputMessage(EasyInputMessage),
3058
3059    EvalItem(EvalItem),
3060}
3061
3062#[derive(Clone, Debug, Default)]
3063#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3064pub struct CreateEvalCompletionsRunDataSource_InputMessages_Variant2 {
3065    /// The type of input messages.
3066    pub r#type: String,
3067
3068    /// A reference to a variable in the "item" namespace.
3069    pub r#item_reference: String,
3070}
3071
3072#[derive(Clone, Debug, Default)]
3073#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3074pub struct CreateEvalCompletionsRunDataSource_SamplingParams {
3075    /// A higher temperature increases randomness in the outputs.
3076    pub r#temperature: Option<f64>,
3077
3078    /// The maximum number of tokens in the generated output.
3079    pub r#max_completion_tokens: Option<i64>,
3080
3081    /// An alternative to temperature for nucleus sampling; 1.0 includes all
3082    /// tokens.
3083    pub r#top_p: Option<f64>,
3084
3085    /// A seed value to initialize the randomness, during sampling.
3086    pub r#seed: Option<i64>,
3087}
3088
3089#[derive(Clone, Debug)]
3090#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3091#[cfg_attr(feature = "serde", serde(untagged))]
3092pub enum CreateEvalCompletionsRunDataSource_Source {
3093    EvalJsonlFileContentSource(EvalJsonlFileContentSource),
3094
3095    EvalJsonlFileIdSource(EvalJsonlFileIdSource),
3096
3097    EvalStoredCompletionsSource(EvalStoredCompletionsSource),
3098}
3099
3100/// A CustomDataSourceConfig object that defines the schema for the data source
3101/// used for the evaluation runs.
3102#[derive(Clone, Debug, Default)]
3103#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3104pub struct CreateEvalCustomDataSourceConfig {
3105    /// The type of data source.
3106    pub r#type: String,
3107
3108    /// The json schema for each row in the data source.
3109    pub r#item_schema: CreateEvalCustomDataSourceConfig_ItemSchema,
3110
3111    /// Whether the eval should expect you to populate the sample namespace (ie,
3112    /// by generating responses off of your data source)
3113    pub r#include_sample_schema: Option<bool>,
3114}
3115
3116/// The json schema for each row in the data source.
3117#[derive(Clone, Debug, Default)]
3118#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3119pub struct CreateEvalCustomDataSourceConfig_ItemSchema;
3120
3121/// A chat message that makes up the prompt or context.
3122#[derive(Clone, Debug)]
3123#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3124#[cfg_attr(feature = "serde", serde(untagged))]
3125pub enum CreateEvalItem {
3126    CreateEvalItem_Variant1(CreateEvalItem_Variant1),
3127
3128    EvalItem(EvalItem),
3129}
3130
3131#[derive(Clone, Debug, Default)]
3132#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3133pub struct CreateEvalItem_Variant1 {
3134    /// The role of the message (e.g.
3135    pub r#role: String,
3136
3137    /// The content of the message.
3138    pub r#content: String,
3139}
3140
3141/// A JsonlRunDataSource object with that specifies a JSONL file that matches
3142/// the eval
3143#[derive(Clone, Debug)]
3144#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3145pub struct CreateEvalJsonlRunDataSource {
3146    /// The type of data source.
3147    pub r#type: String,
3148
3149    pub r#source: CreateEvalJsonlRunDataSource_Source,
3150}
3151
3152#[derive(Clone, Debug)]
3153#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3154#[cfg_attr(feature = "serde", serde(untagged))]
3155pub enum CreateEvalJsonlRunDataSource_Source {
3156    EvalJsonlFileContentSource(EvalJsonlFileContentSource),
3157
3158    EvalJsonlFileIdSource(EvalJsonlFileIdSource),
3159}
3160
3161/// A LabelModelGrader object which uses a model to assign labels to each item
3162/// in the evaluation.
3163#[derive(Clone, Debug, Default)]
3164#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3165pub struct CreateEvalLabelModelGrader {
3166    /// The object type, which is always `label_model`.
3167    pub r#type: String,
3168
3169    /// The name of the grader.
3170    pub r#name: String,
3171
3172    /// The model to use for the evaluation.
3173    pub r#model: String,
3174
3175    /// A list of chat messages forming the prompt or context.
3176    pub r#input: Vec<CreateEvalItem>,
3177
3178    /// The labels to classify to each item in the evaluation.
3179    pub r#labels: Vec<String>,
3180
3181    /// The labels that indicate a passing result.
3182    pub r#passing_labels: Vec<String>,
3183}
3184
3185/// A data source config which specifies the metadata property of your stored
3186/// completions query.
3187#[derive(Clone, Debug, Default)]
3188#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3189pub struct CreateEvalLogsDataSourceConfig {
3190    /// The type of data source.
3191    pub r#type: String,
3192
3193    /// Metadata filters for the logs data source.
3194    pub r#metadata: Option<CreateEvalLogsDataSourceConfig_Metadata>,
3195}
3196
3197/// Metadata filters for the logs data source.
3198#[derive(Clone, Debug, Default)]
3199#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3200pub struct CreateEvalLogsDataSourceConfig_Metadata;
3201
3202#[derive(Clone, Debug)]
3203#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3204pub struct CreateEvalRequest {
3205    /// The name of the evaluation.
3206    pub r#name: Option<String>,
3207
3208    pub r#metadata: Option<Metadata>,
3209
3210    pub r#data_source_config: CreateEvalRequest_DataSourceConfig,
3211
3212    /// A list of graders for all eval runs in this group.
3213    pub r#testing_criteria: Vec<CreateEvalRequest_TestingCriteria>,
3214}
3215
3216/// The configuration for the data source used for the evaluation runs.
3217#[derive(Clone, Debug)]
3218#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3219#[cfg_attr(feature = "serde", serde(untagged))]
3220pub enum CreateEvalRequest_DataSourceConfig {
3221    CreateEvalCustomDataSourceConfig(CreateEvalCustomDataSourceConfig),
3222
3223    CreateEvalLogsDataSourceConfig(CreateEvalLogsDataSourceConfig),
3224}
3225
3226#[derive(Clone, Debug)]
3227#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3228#[cfg_attr(feature = "serde", serde(untagged))]
3229pub enum CreateEvalRequest_TestingCriteria {
3230    CreateEvalLabelModelGrader(CreateEvalLabelModelGrader),
3231
3232    EvalStringCheckGrader(EvalStringCheckGrader),
3233
3234    EvalTextSimilarityGrader(EvalTextSimilarityGrader),
3235
3236    EvalPythonGrader(EvalPythonGrader),
3237
3238    EvalScoreModelGrader(EvalScoreModelGrader),
3239}
3240
3241/// A ResponsesRunDataSource object describing a model sampling configuration.
3242#[derive(Clone, Debug)]
3243#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3244pub struct CreateEvalResponsesRunDataSource {
3245    /// The type of run data source.
3246    pub r#type: String,
3247
3248    pub r#input_messages: Option<CreateEvalResponsesRunDataSource_InputMessages>,
3249
3250    pub r#sampling_params: Option<CreateEvalResponsesRunDataSource_SamplingParams>,
3251
3252    /// The name of the model to use for generating completions (e.g.
3253    pub r#model: Option<String>,
3254
3255    pub r#source: CreateEvalResponsesRunDataSource_Source,
3256}
3257
3258#[derive(Clone, Debug)]
3259#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3260#[cfg_attr(feature = "serde", serde(untagged))]
3261pub enum CreateEvalResponsesRunDataSource_InputMessages {
3262    CreateEvalResponsesRunDataSource_InputMessages_Variant1(CreateEvalResponsesRunDataSource_InputMessages_Variant1),
3263
3264    CreateEvalResponsesRunDataSource_InputMessages_Variant2(CreateEvalResponsesRunDataSource_InputMessages_Variant2),
3265}
3266
3267#[derive(Clone, Debug, Default)]
3268#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3269pub struct CreateEvalResponsesRunDataSource_InputMessages_Variant1 {
3270    /// The type of input messages.
3271    pub r#type: String,
3272
3273    /// A list of chat messages forming the prompt or context.
3274    pub r#template: Vec<CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template>,
3275}
3276
3277#[derive(Clone, Debug)]
3278#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3279#[cfg_attr(feature = "serde", serde(untagged))]
3280pub enum CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template {
3281    CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template_Variant1(CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template_Variant1),
3282
3283    EvalItem(EvalItem),
3284}
3285
3286#[derive(Clone, Debug, Default)]
3287#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3288pub struct CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template_Variant1 {
3289    /// The role of the message (e.g.
3290    pub r#role: String,
3291
3292    /// The content of the message.
3293    pub r#content: String,
3294}
3295
3296#[derive(Clone, Debug, Default)]
3297#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3298pub struct CreateEvalResponsesRunDataSource_InputMessages_Variant2 {
3299    /// The type of input messages.
3300    pub r#type: String,
3301
3302    /// A reference to a variable in the "item" namespace.
3303    pub r#item_reference: String,
3304}
3305
3306#[derive(Clone, Debug, Default)]
3307#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3308pub struct CreateEvalResponsesRunDataSource_SamplingParams {
3309    /// A higher temperature increases randomness in the outputs.
3310    pub r#temperature: Option<f64>,
3311
3312    /// The maximum number of tokens in the generated output.
3313    pub r#max_completion_tokens: Option<i64>,
3314
3315    /// An alternative to temperature for nucleus sampling; 1.0 includes all
3316    /// tokens.
3317    pub r#top_p: Option<f64>,
3318
3319    /// A seed value to initialize the randomness, during sampling.
3320    pub r#seed: Option<i64>,
3321}
3322
3323#[derive(Clone, Debug)]
3324#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3325#[cfg_attr(feature = "serde", serde(untagged))]
3326pub enum CreateEvalResponsesRunDataSource_Source {
3327    EvalJsonlFileContentSource(EvalJsonlFileContentSource),
3328
3329    EvalJsonlFileIdSource(EvalJsonlFileIdSource),
3330
3331    EvalResponsesSource(EvalResponsesSource),
3332}
3333
3334#[derive(Clone, Debug)]
3335#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3336pub struct CreateEvalRunRequest {
3337    /// The name of the run.
3338    pub r#name: Option<String>,
3339
3340    pub r#metadata: Option<Metadata>,
3341
3342    pub r#data_source: CreateEvalRunRequest_DataSource,
3343}
3344
3345/// Details about the run's data source.
3346#[derive(Clone, Debug)]
3347#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3348#[cfg_attr(feature = "serde", serde(untagged))]
3349pub enum CreateEvalRunRequest_DataSource {
3350    CreateEvalJsonlRunDataSource(CreateEvalJsonlRunDataSource),
3351
3352    CreateEvalCompletionsRunDataSource(CreateEvalCompletionsRunDataSource),
3353
3354    CreateEvalResponsesRunDataSource(CreateEvalResponsesRunDataSource),
3355}
3356
3357#[derive(Clone, Debug, Default)]
3358#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3359pub struct CreateFileRequest {
3360    /// The File object (not file name) to be uploaded.
3361    pub r#file: String,
3362
3363    /// The intended purpose of the uploaded file.
3364    pub r#purpose: String,
3365}
3366
3367#[derive(Clone, Debug, Default)]
3368#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3369pub struct CreateFineTuningCheckpointPermissionRequest {
3370    /// The project identifiers to grant access to.
3371    pub r#project_ids: Vec<String>,
3372}
3373
3374#[derive(Clone, Debug)]
3375#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3376pub struct CreateFineTuningJobRequest {
3377    pub r#model: CreateFineTuningJobRequest_Model,
3378
3379    /// The ID of an uploaded file that contains training data.
3380    pub r#training_file: String,
3381
3382    pub r#hyperparameters: Option<CreateFineTuningJobRequest_Hyperparameters>,
3383
3384    /// A string of up to 64 characters that will be added to your fine-tuned
3385    /// model name.
3386    pub r#suffix: Option<String>,
3387
3388    /// The ID of an uploaded file that contains validation data.
3389    pub r#validation_file: Option<String>,
3390
3391    /// A list of integrations to enable for your fine-tuning job.
3392    pub r#integrations: Option<Vec<CreateFineTuningJobRequest_Integrations>>,
3393
3394    /// The seed controls the reproducibility of the job.
3395    pub r#seed: Option<i64>,
3396
3397    pub r#method: Option<FineTuneMethod>,
3398
3399    pub r#metadata: Option<Metadata>,
3400}
3401
3402/// The hyperparameters used for the fine-tuning job.
3403#[derive(Clone, Debug, Default)]
3404#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3405pub struct CreateFineTuningJobRequest_Hyperparameters {
3406    pub r#batch_size: Option<CreateFineTuningJobRequest_Hyperparameters_BatchSize>,
3407
3408    pub r#learning_rate_multiplier: Option<CreateFineTuningJobRequest_Hyperparameters_LearningRateMultiplier>,
3409
3410    pub r#n_epochs: Option<CreateFineTuningJobRequest_Hyperparameters_NEpochs>,
3411}
3412
3413/// Number of examples in each batch.
3414#[derive(Clone, Debug)]
3415#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3416#[cfg_attr(feature = "serde", serde(untagged))]
3417pub enum CreateFineTuningJobRequest_Hyperparameters_BatchSize {
3418    Text(String),
3419
3420    Integer(i64),
3421}
3422
3423/// Scaling factor for the learning rate.
3424#[derive(Clone, Debug)]
3425#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3426#[cfg_attr(feature = "serde", serde(untagged))]
3427pub enum CreateFineTuningJobRequest_Hyperparameters_LearningRateMultiplier {
3428    Text(String),
3429
3430    Number(f64),
3431}
3432
3433/// The number of epochs to train the model for.
3434#[derive(Clone, Debug)]
3435#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3436#[cfg_attr(feature = "serde", serde(untagged))]
3437pub enum CreateFineTuningJobRequest_Hyperparameters_NEpochs {
3438    Text(String),
3439
3440    Integer(i64),
3441}
3442
3443#[derive(Clone, Debug)]
3444#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3445pub struct CreateFineTuningJobRequest_Integrations {
3446    pub r#type: String,
3447
3448    pub r#wandb: CreateFineTuningJobRequest_Integrations_Wandb,
3449}
3450
3451#[derive(Clone, Debug)]
3452#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3453pub enum CreateFineTuningJobRequest_Integrations_Type {
3454    #[cfg_attr(feature = "serde", serde(rename = "wandb"))]
3455    Wandb,
3456
3457    #[cfg_attr(feature = "serde", serde(untagged))]
3458    Other(String),
3459}
3460
3461/// The settings for your integration with Weights and Biases.
3462#[derive(Clone, Debug, Default)]
3463#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3464pub struct CreateFineTuningJobRequest_Integrations_Wandb {
3465    /// The name of the project that the new run will be created under.
3466    pub r#project: String,
3467
3468    /// A display name to set for the run.
3469    pub r#name: Option<String>,
3470
3471    /// The entity to use for the run.
3472    pub r#entity: Option<String>,
3473
3474    /// A list of tags to be attached to the newly created run.
3475    pub r#tags: Option<Vec<String>>,
3476}
3477
3478/// The name of the model to fine-tune.
3479pub type CreateFineTuningJobRequest_Model = String;
3480
3481#[derive(Clone, Debug)]
3482#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3483pub struct CreateImageEditRequest {
3484    pub r#image: CreateImageEditRequest_Image,
3485
3486    /// A text description of the desired image(s).
3487    pub r#prompt: String,
3488
3489    /// An additional image whose fully transparent areas (e.g.
3490    pub r#mask: Option<String>,
3491
3492    pub r#model: Option<CreateImageEditRequest_Model>,
3493
3494    /// The number of images to generate.
3495    pub r#n: Option<i64>,
3496
3497    /// The size of the generated images.
3498    pub r#size: Option<String>,
3499
3500    /// The format in which the generated images are returned.
3501    pub r#response_format: Option<String>,
3502
3503    /// A unique identifier representing your end-user, which can help OpenAI to
3504    /// monitor and detect abuse.
3505    pub r#user: Option<String>,
3506
3507    /// The quality of the image that will be generated.
3508    pub r#quality: Option<String>,
3509}
3510
3511/// The image(s) to edit.
3512#[derive(Clone, Debug)]
3513#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3514#[cfg_attr(feature = "serde", serde(untagged))]
3515pub enum CreateImageEditRequest_Image {
3516    Text(String),
3517
3518    TextArray(Vec<String>),
3519}
3520
3521/// The model to use for image generation.
3522pub type CreateImageEditRequest_Model = String;
3523
3524#[derive(Clone, Debug, Default)]
3525#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3526pub struct CreateImageRequest {
3527    /// A text description of the desired image(s).
3528    pub r#prompt: String,
3529
3530    pub r#model: Option<CreateImageRequest_Model>,
3531
3532    /// The number of images to generate.
3533    pub r#n: Option<i64>,
3534
3535    /// The quality of the image that will be generated.
3536    pub r#quality: Option<String>,
3537
3538    /// The format in which generated images with `dall-e-2` and `dall-e-3` are
3539    /// returned.
3540    pub r#response_format: Option<String>,
3541
3542    /// The format in which the generated images are returned.
3543    pub r#output_format: Option<String>,
3544
3545    /// The compression level (0-100%) for the generated images.
3546    pub r#output_compression: Option<i64>,
3547
3548    /// The size of the generated images.
3549    pub r#size: Option<String>,
3550
3551    /// Control the content-moderation level for images generated by
3552    /// `gpt-image-1`.
3553    pub r#moderation: Option<String>,
3554
3555    /// Allows to set transparency for the background of the generated image(s).
3556    pub r#background: Option<String>,
3557
3558    /// The style of the generated images.
3559    pub r#style: Option<String>,
3560
3561    /// A unique identifier representing your end-user, which can help OpenAI to
3562    /// monitor and detect abuse.
3563    pub r#user: Option<String>,
3564}
3565
3566/// The model to use for image generation.
3567pub type CreateImageRequest_Model = String;
3568
3569#[derive(Clone, Debug, Default)]
3570#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3571pub struct CreateImageVariationRequest {
3572    /// The image to use as the basis for the variation(s).
3573    pub r#image: String,
3574
3575    pub r#model: Option<CreateImageVariationRequest_Model>,
3576
3577    /// The number of images to generate.
3578    pub r#n: Option<i64>,
3579
3580    /// The format in which the generated images are returned.
3581    pub r#response_format: Option<String>,
3582
3583    /// The size of the generated images.
3584    pub r#size: Option<String>,
3585
3586    /// A unique identifier representing your end-user, which can help OpenAI to
3587    /// monitor and detect abuse.
3588    pub r#user: Option<String>,
3589}
3590
3591/// The model to use for image generation.
3592pub type CreateImageVariationRequest_Model = String;
3593
3594#[derive(Clone, Debug)]
3595#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3596pub struct CreateMessageRequest {
3597    /// The role of the entity that is creating the message.
3598    pub r#role: String,
3599
3600    pub r#content: CreateMessageRequest_Content,
3601
3602    /// A list of files attached to the message, and the tools they should be
3603    /// added to.
3604    pub r#attachments: Option<Vec<CreateMessageRequest_Attachments>>,
3605
3606    pub r#metadata: Option<Metadata>,
3607}
3608
3609#[derive(Clone, Debug, Default)]
3610#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3611pub struct CreateMessageRequest_Attachments {
3612    /// The ID of the file to attach to the message.
3613    pub r#file_id: Option<String>,
3614
3615    /// The tools to add this file to.
3616    pub r#tools: Option<Vec<CreateMessageRequest_Attachments_Tools>>,
3617}
3618
3619#[derive(Clone, Debug)]
3620#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3621#[cfg_attr(feature = "serde", serde(untagged))]
3622pub enum CreateMessageRequest_Attachments_Tools {
3623    AssistantToolsCode(AssistantToolsCode),
3624
3625    AssistantToolsFileSearchTypeOnly(AssistantToolsFileSearchTypeOnly),
3626}
3627
3628#[derive(Clone, Debug)]
3629#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3630#[cfg_attr(feature = "serde", serde(untagged))]
3631pub enum CreateMessageRequest_Content {
3632    /// The text contents of the message.
3633    Text(String),
3634
3635    /// An array of content parts with a defined type, each can be of type
3636    /// `text` or images can be passed with `image_url` or `image_file`.
3637    Array(Vec<CreateMessageRequest_Content_Variant2>),
3638}
3639
3640#[derive(Clone, Debug)]
3641#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3642#[cfg_attr(feature = "serde", serde(untagged))]
3643pub enum CreateMessageRequest_Content_Variant2 {
3644    MessageContentImageFileObject(MessageContentImageFileObject),
3645
3646    MessageContentImageUrlObject(MessageContentImageUrlObject),
3647
3648    MessageRequestContentTextObject(MessageRequestContentTextObject),
3649}
3650
3651#[derive(Clone, Debug)]
3652#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3653pub struct CreateModerationRequest {
3654    pub r#input: CreateModerationRequest_Input,
3655
3656    pub r#model: Option<CreateModerationRequest_Model>,
3657}
3658
3659/// Input (or inputs) to classify.
3660#[derive(Clone, Debug)]
3661#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3662#[cfg_attr(feature = "serde", serde(untagged))]
3663pub enum CreateModerationRequest_Input {
3664    /// A string of text to classify for moderation.
3665    Text(String),
3666
3667    /// An array of strings to classify for moderation.
3668    TextArray(Vec<String>),
3669
3670    /// An array of multi-modal inputs to the moderation model.
3671    Array(Vec<CreateModerationRequest_Input_Variant3>),
3672}
3673
3674#[derive(Clone, Debug)]
3675#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3676#[cfg_attr(feature = "serde", serde(untagged))]
3677pub enum CreateModerationRequest_Input_Variant3 {
3678    CreateModerationRequest_Input_Variant3_Variant1(CreateModerationRequest_Input_Variant3_Variant1),
3679
3680    CreateModerationRequest_Input_Variant3_Variant2(CreateModerationRequest_Input_Variant3_Variant2),
3681}
3682
3683/// An object describing an image to classify.
3684#[derive(Clone, Debug)]
3685#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3686pub struct CreateModerationRequest_Input_Variant3_Variant1 {
3687    /// Always `image_url`.
3688    pub r#type: String,
3689
3690    pub r#image_url: CreateModerationRequest_Input_Variant3_Variant1_ImageUrl,
3691}
3692
3693/// Contains either an image URL or a data URL for a base64 encoded image.
3694#[derive(Clone, Debug, Default)]
3695#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3696pub struct CreateModerationRequest_Input_Variant3_Variant1_ImageUrl {
3697    /// Either a URL of the image or the base64 encoded image data.
3698    pub r#url: String,
3699}
3700
3701/// An object describing text to classify.
3702#[derive(Clone, Debug, Default)]
3703#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3704pub struct CreateModerationRequest_Input_Variant3_Variant2 {
3705    /// Always `text`.
3706    pub r#type: String,
3707
3708    /// A string of text to classify.
3709    pub r#text: String,
3710}
3711
3712/// The content moderation model you would like to use.
3713pub type CreateModerationRequest_Model = String;
3714
3715/// Represents if a given text input is potentially harmful.
3716#[derive(Clone, Debug, Default)]
3717#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3718pub struct CreateModerationResponse {
3719    /// The unique identifier for the moderation request.
3720    pub r#id: String,
3721
3722    /// The model used to generate the moderation results.
3723    pub r#model: String,
3724
3725    /// A list of moderation objects.
3726    pub r#results: Vec<CreateModerationResponse_Results>,
3727}
3728
3729#[derive(Clone, Debug)]
3730#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3731pub struct CreateModerationResponse_Results {
3732    /// Whether any of the below categories are flagged.
3733    pub r#flagged: bool,
3734
3735    pub r#categories: CreateModerationResponse_Results_Categories,
3736
3737    pub r#category_scores: CreateModerationResponse_Results_CategoryScores,
3738
3739    pub r#category_applied_input_types: CreateModerationResponse_Results_CategoryAppliedInputTypes,
3740}
3741
3742/// A list of the categories, and whether they are flagged or not.
3743#[derive(Clone, Debug, Default)]
3744#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3745pub struct CreateModerationResponse_Results_Categories {
3746    /// Content that expresses, incites, or promotes hate based on race, gender,
3747    /// ethnicity, religion, nationality, sexual orientation, disability status,
3748    /// or caste.
3749    pub r#hate: bool,
3750
3751    /// Hateful content that also includes violence or serious harm towards the
3752    /// targeted group based on race, gender, ethnicity, religion, nationality,
3753    /// sexual orientation, disability status, or caste.
3754    pub r#hate_threatening: bool,
3755
3756    /// Content that expresses, incites, or promotes harassing language towards
3757    /// any target.
3758    pub r#harassment: bool,
3759
3760    /// Harassment content that also includes violence or serious harm towards
3761    /// any target.
3762    pub r#harassment_threatening: bool,
3763
3764    /// Content that includes instructions or advice that facilitate the
3765    /// planning or execution of wrongdoing, or that gives advice or instruction
3766    /// on how to commit illicit acts.
3767    pub r#illicit: Option<bool>,
3768
3769    /// Content that includes instructions or advice that facilitate the
3770    /// planning or execution of wrongdoing that also includes violence, or that
3771    /// gives advice or instruction on the procurement of any weapon.
3772    pub r#illicit_violent: Option<bool>,
3773
3774    /// Content that promotes, encourages, or depicts acts of self-harm, such as
3775    /// suicide, cutting, and eating disorders.
3776    pub r#self_harm: bool,
3777
3778    /// Content where the speaker expresses that they are engaging or intend to
3779    /// engage in acts of self-harm, such as suicide, cutting, and eating
3780    /// disorders.
3781    pub r#self_harm_intent: bool,
3782
3783    /// Content that encourages performing acts of self-harm, such as suicide,
3784    /// cutting, and eating disorders, or that gives instructions or advice on
3785    /// how to commit such acts.
3786    pub r#self_harm_instructions: bool,
3787
3788    /// Content meant to arouse sexual excitement, such as the description of
3789    /// sexual activity, or that promotes sexual services (excluding sex
3790    /// education and wellness).
3791    pub r#sexual: bool,
3792
3793    /// Sexual content that includes an individual who is under 18 years old.
3794    pub r#sexual_minors: bool,
3795
3796    /// Content that depicts death, violence, or physical injury.
3797    pub r#violence: bool,
3798
3799    /// Content that depicts death, violence, or physical injury in graphic
3800    /// detail.
3801    pub r#violence_graphic: bool,
3802}
3803
3804/// A list of the categories along with the input type(s) that the score applies
3805/// to.
3806#[derive(Clone, Debug, Default)]
3807#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3808pub struct CreateModerationResponse_Results_CategoryAppliedInputTypes {
3809    /// The applied input type(s) for the category 'hate'.
3810    pub r#hate: Vec<String>,
3811
3812    /// The applied input type(s) for the category 'hate/threatening'.
3813    pub r#hate_threatening: Vec<String>,
3814
3815    /// The applied input type(s) for the category 'harassment'.
3816    pub r#harassment: Vec<String>,
3817
3818    /// The applied input type(s) for the category 'harassment/threatening'.
3819    pub r#harassment_threatening: Vec<String>,
3820
3821    /// The applied input type(s) for the category 'illicit'.
3822    pub r#illicit: Vec<String>,
3823
3824    /// The applied input type(s) for the category 'illicit/violent'.
3825    pub r#illicit_violent: Vec<String>,
3826
3827    /// The applied input type(s) for the category 'self-harm'.
3828    pub r#self_harm: Vec<String>,
3829
3830    /// The applied input type(s) for the category 'self-harm/intent'.
3831    pub r#self_harm_intent: Vec<String>,
3832
3833    /// The applied input type(s) for the category 'self-harm/instructions'.
3834    pub r#self_harm_instructions: Vec<String>,
3835
3836    /// The applied input type(s) for the category 'sexual'.
3837    pub r#sexual: Vec<String>,
3838
3839    /// The applied input type(s) for the category 'sexual/minors'.
3840    pub r#sexual_minors: Vec<String>,
3841
3842    /// The applied input type(s) for the category 'violence'.
3843    pub r#violence: Vec<String>,
3844
3845    /// The applied input type(s) for the category 'violence/graphic'.
3846    pub r#violence_graphic: Vec<String>,
3847}
3848
3849/// A list of the categories along with their scores as predicted by model.
3850#[derive(Clone, Debug, Default)]
3851#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3852pub struct CreateModerationResponse_Results_CategoryScores {
3853    /// The score for the category 'hate'.
3854    pub r#hate: f64,
3855
3856    /// The score for the category 'hate/threatening'.
3857    pub r#hate_threatening: f64,
3858
3859    /// The score for the category 'harassment'.
3860    pub r#harassment: f64,
3861
3862    /// The score for the category 'harassment/threatening'.
3863    pub r#harassment_threatening: f64,
3864
3865    /// The score for the category 'illicit'.
3866    pub r#illicit: f64,
3867
3868    /// The score for the category 'illicit/violent'.
3869    pub r#illicit_violent: f64,
3870
3871    /// The score for the category 'self-harm'.
3872    pub r#self_harm: f64,
3873
3874    /// The score for the category 'self-harm/intent'.
3875    pub r#self_harm_intent: f64,
3876
3877    /// The score for the category 'self-harm/instructions'.
3878    pub r#self_harm_instructions: f64,
3879
3880    /// The score for the category 'sexual'.
3881    pub r#sexual: f64,
3882
3883    /// The score for the category 'sexual/minors'.
3884    pub r#sexual_minors: f64,
3885
3886    /// The score for the category 'violence'.
3887    pub r#violence: f64,
3888
3889    /// The score for the category 'violence/graphic'.
3890    pub r#violence_graphic: f64,
3891}
3892
3893#[derive(Clone, Debug)]
3894#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3895pub struct CreateResponse {
3896    pub r#metadata: Option<Metadata>,
3897
3898    /// What sampling temperature to use, between 0 and 2.
3899    pub r#temperature: Option<f64>,
3900
3901    /// An alternative to sampling with temperature, called nucleus sampling,
3902    /// where the model considers the results of the tokens with top_p
3903    /// probability mass.
3904    pub r#top_p: Option<f64>,
3905
3906    /// A unique identifier representing your end-user, which can help OpenAI to
3907    /// monitor and detect abuse.
3908    pub r#user: Option<String>,
3909
3910    pub r#service_tier: Option<ServiceTier>,
3911
3912    /// The unique ID of the previous response to the model.
3913    pub r#previous_response_id: Option<String>,
3914
3915    /// Model ID used to generate the response, like `gpt-4o` or `o3`.
3916    pub r#model: ModelIdsResponses,
3917
3918    pub r#reasoning: Option<Reasoning>,
3919
3920    /// An upper bound for the number of tokens that can be generated for a
3921    /// response, including visible output tokens and [reasoning
3922    /// tokens](/docs/guides/reasoning).
3923    pub r#max_output_tokens: Option<i64>,
3924
3925    /// Inserts a system (or developer) message as the first item in the model's
3926    /// context.
3927    pub r#instructions: Option<String>,
3928
3929    pub r#text: Option<ResponseProperties_Text>,
3930
3931    /// An array of tools the model may call while generating a response.
3932    pub r#tools: Option<Vec<Tool>>,
3933
3934    pub r#tool_choice: Option<ResponseProperties_ToolChoice>,
3935
3936    /// The truncation strategy to use for the model response.
3937    pub r#truncation: Option<String>,
3938
3939    pub r#input: CreateResponse_Variant3_Input,
3940
3941    /// Specify additional output data to include in the model response.
3942    pub r#include: Option<Vec<Includable>>,
3943
3944    /// Whether to allow the model to run tool calls in parallel.
3945    pub r#parallel_tool_calls: Option<bool>,
3946
3947    /// Whether to store the generated model response for later retrieval via
3948    /// API.
3949    pub r#store: Option<bool>,
3950
3951    /// If set to true, the model response data will be streamed to the client
3952    /// as it is generated using [server-sent
3953    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
3954    pub r#stream: Option<bool>,
3955}
3956
3957#[derive(Clone, Debug)]
3958#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3959pub struct CreateResponse_Variant3 {
3960    pub r#input: CreateResponse_Variant3_Input,
3961
3962    /// Specify additional output data to include in the model response.
3963    pub r#include: Option<Vec<Includable>>,
3964
3965    /// Whether to allow the model to run tool calls in parallel.
3966    pub r#parallel_tool_calls: Option<bool>,
3967
3968    /// Whether to store the generated model response for later retrieval via
3969    /// API.
3970    pub r#store: Option<bool>,
3971
3972    /// If set to true, the model response data will be streamed to the client
3973    /// as it is generated using [server-sent
3974    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
3975    pub r#stream: Option<bool>,
3976}
3977
3978/// Text, image, or file inputs to the model, used to generate a response.
3979#[derive(Clone, Debug)]
3980#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3981#[cfg_attr(feature = "serde", serde(untagged))]
3982pub enum CreateResponse_Variant3_Input {
3983    /// A text input to the model, equivalent to a text input with the `user`
3984    /// role.
3985    Text(String),
3986
3987    /// A list of one or many input items to the model, containing different
3988    /// content types.
3989    Array(Vec<InputItem>),
3990}
3991
3992#[derive(Clone, Debug, Default)]
3993#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3994pub struct CreateRunRequest {
3995    /// The ID of the [assistant](/docs/api-reference/assistants) to use to
3996    /// execute this run.
3997    pub r#assistant_id: String,
3998
3999    pub r#model: Option<CreateRunRequest_Model>,
4000
4001    pub r#reasoning_effort: Option<ReasoningEffort>,
4002
4003    /// Overrides the
4004    /// [instructions](/docs/api-reference/assistants/createAssistant) of the
4005    /// assistant.
4006    pub r#instructions: Option<String>,
4007
4008    /// Appends additional instructions at the end of the instructions for the
4009    /// run.
4010    pub r#additional_instructions: Option<String>,
4011
4012    /// Adds additional messages to the thread before creating the run.
4013    pub r#additional_messages: Option<Vec<CreateMessageRequest>>,
4014
4015    /// Override the tools the assistant can use for this run.
4016    pub r#tools: Option<Vec<CreateRunRequest_Tools>>,
4017
4018    pub r#metadata: Option<Metadata>,
4019
4020    /// What sampling temperature to use, between 0 and 2.
4021    pub r#temperature: Option<f64>,
4022
4023    /// An alternative to sampling with temperature, called nucleus sampling,
4024    /// where the model considers the results of the tokens with top_p
4025    /// probability mass.
4026    pub r#top_p: Option<f64>,
4027
4028    /// If `true`, returns a stream of events that happen during the Run as
4029    /// server-sent events, terminating when the Run enters a terminal state
4030    /// with a `data: [DONE]` message.
4031    pub r#stream: Option<bool>,
4032
4033    /// The maximum number of prompt tokens that may be used over the course of
4034    /// the run.
4035    pub r#max_prompt_tokens: Option<i64>,
4036
4037    /// The maximum number of completion tokens that may be used over the course
4038    /// of the run.
4039    pub r#max_completion_tokens: Option<i64>,
4040
4041    pub r#truncation_strategy: Option<TruncationObject>,
4042
4043    pub r#tool_choice: Option<AssistantsApiToolChoiceOption>,
4044
4045    pub r#parallel_tool_calls: Option<ParallelToolCalls>,
4046
4047    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
4048}
4049
4050/// The ID of the [Model](/docs/api-reference/models) to be used to execute this
4051/// run.
4052#[derive(Clone, Debug)]
4053#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4054#[cfg_attr(feature = "serde", serde(untagged))]
4055pub enum CreateRunRequest_Model {
4056    Text(String),
4057
4058    AssistantSupportedModels(AssistantSupportedModels),
4059}
4060
4061#[derive(Clone, Debug)]
4062#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4063#[cfg_attr(feature = "serde", serde(untagged))]
4064pub enum CreateRunRequest_Tools {
4065    AssistantToolsCode(AssistantToolsCode),
4066
4067    AssistantToolsFileSearch(AssistantToolsFileSearch),
4068
4069    AssistantToolsFunction(AssistantToolsFunction),
4070}
4071
4072#[derive(Clone, Debug)]
4073#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4074pub struct CreateSpeechRequest {
4075    pub r#model: CreateSpeechRequest_Model,
4076
4077    /// The text to generate audio for.
4078    pub r#input: String,
4079
4080    /// Control the voice of your generated audio with additional instructions.
4081    pub r#instructions: Option<String>,
4082
4083    /// The voice to use when generating the audio.
4084    pub r#voice: VoiceIdsShared,
4085
4086    /// The format to audio in.
4087    pub r#response_format: Option<String>,
4088
4089    /// The speed of the generated audio.
4090    pub r#speed: Option<f64>,
4091}
4092
4093/// One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd` or
4094/// `gpt-4o-mini-tts`.
4095pub type CreateSpeechRequest_Model = String;
4096
4097#[derive(Clone, Debug, Default)]
4098#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4099pub struct CreateThreadAndRunRequest {
4100    /// The ID of the [assistant](/docs/api-reference/assistants) to use to
4101    /// execute this run.
4102    pub r#assistant_id: String,
4103
4104    pub r#thread: Option<CreateThreadRequest>,
4105
4106    pub r#model: Option<CreateThreadAndRunRequest_Model>,
4107
4108    /// Override the default system message of the assistant.
4109    pub r#instructions: Option<String>,
4110
4111    /// Override the tools the assistant can use for this run.
4112    pub r#tools: Option<Vec<CreateThreadAndRunRequest_Tools>>,
4113
4114    pub r#tool_resources: Option<CreateThreadAndRunRequest_ToolResources>,
4115
4116    pub r#metadata: Option<Metadata>,
4117
4118    /// What sampling temperature to use, between 0 and 2.
4119    pub r#temperature: Option<f64>,
4120
4121    /// An alternative to sampling with temperature, called nucleus sampling,
4122    /// where the model considers the results of the tokens with top_p
4123    /// probability mass.
4124    pub r#top_p: Option<f64>,
4125
4126    /// If `true`, returns a stream of events that happen during the Run as
4127    /// server-sent events, terminating when the Run enters a terminal state
4128    /// with a `data: [DONE]` message.
4129    pub r#stream: Option<bool>,
4130
4131    /// The maximum number of prompt tokens that may be used over the course of
4132    /// the run.
4133    pub r#max_prompt_tokens: Option<i64>,
4134
4135    /// The maximum number of completion tokens that may be used over the course
4136    /// of the run.
4137    pub r#max_completion_tokens: Option<i64>,
4138
4139    pub r#truncation_strategy: Option<TruncationObject>,
4140
4141    pub r#tool_choice: Option<AssistantsApiToolChoiceOption>,
4142
4143    pub r#parallel_tool_calls: Option<ParallelToolCalls>,
4144
4145    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
4146}
4147
4148/// The ID of the [Model](/docs/api-reference/models) to be used to execute this
4149/// run.
4150pub type CreateThreadAndRunRequest_Model = String;
4151
4152/// A set of resources that are used by the assistant's tools.
4153#[derive(Clone, Debug, Default)]
4154#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4155pub struct CreateThreadAndRunRequest_ToolResources {
4156    pub r#code_interpreter: Option<CreateThreadAndRunRequest_ToolResources_CodeInterpreter>,
4157
4158    pub r#file_search: Option<CreateThreadAndRunRequest_ToolResources_FileSearch>,
4159}
4160
4161#[derive(Clone, Debug, Default)]
4162#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4163pub struct CreateThreadAndRunRequest_ToolResources_CodeInterpreter {
4164    /// A list of [file](/docs/api-reference/files) IDs made available to the
4165    /// `code_interpreter` tool.
4166    pub r#file_ids: Option<Vec<String>>,
4167}
4168
4169#[derive(Clone, Debug, Default)]
4170#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4171pub struct CreateThreadAndRunRequest_ToolResources_FileSearch {
4172    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
4173    /// attached to this assistant.
4174    pub r#vector_store_ids: Option<Vec<String>>,
4175}
4176
4177#[derive(Clone, Debug)]
4178#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4179#[cfg_attr(feature = "serde", serde(untagged))]
4180pub enum CreateThreadAndRunRequest_Tools {
4181    AssistantToolsCode(AssistantToolsCode),
4182
4183    AssistantToolsFileSearch(AssistantToolsFileSearch),
4184
4185    AssistantToolsFunction(AssistantToolsFunction),
4186}
4187
4188/// Options to create a new thread.
4189#[derive(Clone, Debug, Default)]
4190#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4191pub struct CreateThreadRequest {
4192    /// A list of [messages](/docs/api-reference/messages) to start the thread
4193    /// with.
4194    pub r#messages: Option<Vec<CreateMessageRequest>>,
4195
4196    pub r#tool_resources: Option<CreateThreadRequest_ToolResources>,
4197
4198    pub r#metadata: Option<Metadata>,
4199}
4200
4201/// A set of resources that are made available to the assistant's tools in this
4202/// thread.
4203#[derive(Clone, Debug, Default)]
4204#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4205pub struct CreateThreadRequest_ToolResources {
4206    pub r#code_interpreter: Option<CreateThreadRequest_ToolResources_CodeInterpreter>,
4207
4208    pub r#file_search: Option<CreateThreadRequest_ToolResources_FileSearch>,
4209}
4210
4211#[derive(Clone, Debug, Default)]
4212#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4213pub struct CreateThreadRequest_ToolResources_CodeInterpreter {
4214    /// A list of [file](/docs/api-reference/files) IDs made available to the
4215    /// `code_interpreter` tool.
4216    pub r#file_ids: Option<Vec<String>>,
4217}
4218
4219#[derive(Clone, Debug, Default)]
4220#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4221pub struct CreateThreadRequest_ToolResources_FileSearch {
4222    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
4223    /// this thread.
4224    pub r#vector_store_ids: Option<Vec<String>>,
4225
4226    /// A helper to create a [vector
4227    /// store](/docs/api-reference/vector-stores/object) with file_ids and
4228    /// attach it to this thread.
4229    pub r#vector_stores: Option<Vec<CreateThreadRequest_ToolResources_FileSearch_VectorStores>>,
4230}
4231
4232#[derive(Clone, Debug, Default)]
4233#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4234pub struct CreateThreadRequest_ToolResources_FileSearch_VectorStores {
4235    /// A list of [file](/docs/api-reference/files) IDs to add to the vector
4236    /// store.
4237    pub r#file_ids: Option<Vec<String>>,
4238
4239    pub r#metadata: Option<Metadata>,
4240}
4241
4242#[derive(Clone, Debug)]
4243#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4244pub struct CreateTranscriptionRequest {
4245    /// The audio file object (not file name) to transcribe, in one of these
4246    /// formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
4247    pub r#file: String,
4248
4249    pub r#model: CreateTranscriptionRequest_Model,
4250
4251    /// The language of the input audio.
4252    pub r#language: Option<String>,
4253
4254    /// An optional text to guide the model's style or continue a previous audio
4255    /// segment.
4256    pub r#prompt: Option<String>,
4257
4258    pub r#response_format: Option<AudioResponseFormat>,
4259
4260    /// The sampling temperature, between 0 and 1.
4261    pub r#temperature: Option<f64>,
4262
4263    /// Additional information to include in the transcription response.
4264    #[cfg_attr(feature = "serde", serde(rename = "include[]"))]
4265    pub r#include: Option<Vec<TranscriptionInclude>>,
4266
4267    /// The timestamp granularities to populate for this transcription.
4268    #[cfg_attr(feature = "serde", serde(rename = "timestamp_granularities[]"))]
4269    pub r#timestamp_granularities: Option<Vec<String>>,
4270
4271    /// If set to true, the model response data will be streamed to the client
4272    /// as it is generated using [server-sent
4273    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
4274    pub r#stream: Option<bool>,
4275}
4276
4277/// ID of the model to use.
4278pub type CreateTranscriptionRequest_Model = String;
4279
4280/// Represents a transcription response returned by model, based on the provided
4281/// input.
4282#[derive(Clone, Debug, Default)]
4283#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4284pub struct CreateTranscriptionResponseJson {
4285    /// The transcribed text.
4286    pub r#text: String,
4287
4288    /// The log probabilities of the tokens in the transcription.
4289    pub r#logprobs: Option<Vec<CreateTranscriptionResponseJson_Logprobs>>,
4290}
4291
4292#[derive(Clone, Debug, Default)]
4293#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4294pub struct CreateTranscriptionResponseJson_Logprobs {
4295    /// The token in the transcription.
4296    pub r#token: Option<String>,
4297
4298    /// The log probability of the token.
4299    pub r#logprob: Option<f64>,
4300
4301    /// The bytes of the token.
4302    pub r#bytes: Option<Vec<f64>>,
4303}
4304
4305#[derive(Clone, Debug)]
4306#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4307#[cfg_attr(feature = "serde", serde(untagged))]
4308pub enum CreateTranscriptionResponseStreamEvent {
4309    TranscriptTextDeltaEvent(TranscriptTextDeltaEvent),
4310
4311    TranscriptTextDoneEvent(TranscriptTextDoneEvent),
4312}
4313
4314/// Represents a verbose json transcription response returned by model, based on
4315/// the provided input.
4316#[derive(Clone, Debug, Default)]
4317#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4318pub struct CreateTranscriptionResponseVerboseJson {
4319    /// The language of the input audio.
4320    pub r#language: String,
4321
4322    /// The duration of the input audio.
4323    pub r#duration: f64,
4324
4325    /// The transcribed text.
4326    pub r#text: String,
4327
4328    /// Extracted words and their corresponding timestamps.
4329    pub r#words: Option<Vec<TranscriptionWord>>,
4330
4331    /// Segments of the transcribed text and their corresponding details.
4332    pub r#segments: Option<Vec<TranscriptionSegment>>,
4333}
4334
4335#[derive(Clone, Debug)]
4336#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4337pub struct CreateTranslationRequest {
4338    /// The audio file object (not file name) translate, in one of these
4339    /// formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
4340    pub r#file: String,
4341
4342    pub r#model: CreateTranslationRequest_Model,
4343
4344    /// An optional text to guide the model's style or continue a previous audio
4345    /// segment.
4346    pub r#prompt: Option<String>,
4347
4348    /// The format of the output, in one of these options: `json`, `text`,
4349    /// `srt`, `verbose_json`, or `vtt`.
4350    pub r#response_format: Option<String>,
4351
4352    /// The sampling temperature, between 0 and 1.
4353    pub r#temperature: Option<f64>,
4354}
4355
4356/// ID of the model to use.
4357pub type CreateTranslationRequest_Model = String;
4358
4359#[derive(Clone, Debug, Default)]
4360#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4361pub struct CreateTranslationResponseJson {
4362    pub r#text: String,
4363}
4364
4365#[derive(Clone, Debug, Default)]
4366#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4367pub struct CreateTranslationResponseVerboseJson {
4368    /// The language of the output translation (always `english`).
4369    pub r#language: String,
4370
4371    /// The duration of the input audio.
4372    pub r#duration: f64,
4373
4374    /// The translated text.
4375    pub r#text: String,
4376
4377    /// Segments of the translated text and their corresponding details.
4378    pub r#segments: Option<Vec<TranscriptionSegment>>,
4379}
4380
4381#[derive(Clone, Debug, Default)]
4382#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4383pub struct CreateUploadRequest {
4384    /// The name of the file to upload.
4385    pub r#filename: String,
4386
4387    /// The intended purpose of the uploaded file.
4388    pub r#purpose: String,
4389
4390    /// The number of bytes in the file you are uploading.
4391    pub r#bytes: i64,
4392
4393    /// The MIME type of the file.
4394    pub r#mime_type: String,
4395}
4396
4397#[derive(Clone, Debug, Default)]
4398#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4399pub struct CreateVectorStoreFileBatchRequest {
4400    /// A list of [File](/docs/api-reference/files) IDs that the vector store
4401    /// should use.
4402    pub r#file_ids: Vec<String>,
4403
4404    pub r#chunking_strategy: Option<ChunkingStrategyRequestParam>,
4405
4406    pub r#attributes: Option<VectorStoreFileAttributes>,
4407}
4408
4409#[derive(Clone, Debug, Default)]
4410#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4411pub struct CreateVectorStoreFileRequest {
4412    /// A [File](/docs/api-reference/files) ID that the vector store should use.
4413    pub r#file_id: String,
4414
4415    pub r#chunking_strategy: Option<ChunkingStrategyRequestParam>,
4416
4417    pub r#attributes: Option<VectorStoreFileAttributes>,
4418}
4419
4420#[derive(Clone, Debug, Default)]
4421#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4422pub struct CreateVectorStoreRequest {
4423    /// A list of [File](/docs/api-reference/files) IDs that the vector store
4424    /// should use.
4425    pub r#file_ids: Option<Vec<String>>,
4426
4427    /// The name of the vector store.
4428    pub r#name: Option<String>,
4429
4430    pub r#expires_after: Option<VectorStoreExpirationAfter>,
4431
4432    pub r#chunking_strategy: Option<CreateVectorStoreRequest_ChunkingStrategy>,
4433
4434    pub r#metadata: Option<Metadata>,
4435}
4436
4437/// The chunking strategy used to chunk the file(s).
4438#[derive(Clone, Debug)]
4439#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4440#[cfg_attr(feature = "serde", serde(untagged))]
4441pub enum CreateVectorStoreRequest_ChunkingStrategy {
4442    AutoChunkingStrategyRequestParam(AutoChunkingStrategyRequestParam),
4443
4444    StaticChunkingStrategyRequestParam(StaticChunkingStrategyRequestParam),
4445}
4446
4447#[derive(Clone, Debug, Default)]
4448#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4449pub struct DeleteAssistantResponse {
4450    pub r#id: String,
4451
4452    pub r#deleted: bool,
4453
4454    pub r#object: String,
4455}
4456
4457#[derive(Clone, Debug, Default)]
4458#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4459pub struct DeleteCertificateResponse {
4460    /// The object type, must be `certificate.deleted`.
4461    pub r#object: String,
4462
4463    /// The ID of the certificate that was deleted.
4464    pub r#id: String,
4465}
4466
4467#[derive(Clone, Debug, Default)]
4468#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4469pub struct DeleteFileResponse {
4470    pub r#id: String,
4471
4472    pub r#object: String,
4473
4474    pub r#deleted: bool,
4475}
4476
4477#[derive(Clone, Debug, Default)]
4478#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4479pub struct DeleteFineTuningCheckpointPermissionResponse {
4480    /// The ID of the fine-tuned model checkpoint permission that was deleted.
4481    pub r#id: String,
4482
4483    /// The object type, which is always "checkpoint.permission".
4484    pub r#object: String,
4485
4486    /// Whether the fine-tuned model checkpoint permission was successfully
4487    /// deleted.
4488    pub r#deleted: bool,
4489}
4490
4491#[derive(Clone, Debug, Default)]
4492#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4493pub struct DeleteMessageResponse {
4494    pub r#id: String,
4495
4496    pub r#deleted: bool,
4497
4498    pub r#object: String,
4499}
4500
4501#[derive(Clone, Debug, Default)]
4502#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4503pub struct DeleteModelResponse {
4504    pub r#id: String,
4505
4506    pub r#deleted: bool,
4507
4508    pub r#object: String,
4509}
4510
4511#[derive(Clone, Debug, Default)]
4512#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4513pub struct DeleteThreadResponse {
4514    pub r#id: String,
4515
4516    pub r#deleted: bool,
4517
4518    pub r#object: String,
4519}
4520
4521#[derive(Clone, Debug, Default)]
4522#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4523pub struct DeleteVectorStoreFileResponse {
4524    pub r#id: String,
4525
4526    pub r#deleted: bool,
4527
4528    pub r#object: String,
4529}
4530
4531#[derive(Clone, Debug, Default)]
4532#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4533pub struct DeleteVectorStoreResponse {
4534    pub r#id: String,
4535
4536    pub r#deleted: bool,
4537
4538    pub r#object: String,
4539}
4540
4541/// Occurs when a stream ends.
4542#[derive(Clone, Debug, Default)]
4543#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4544pub struct DoneEvent {
4545    pub r#event: String,
4546
4547    pub r#data: String,
4548}
4549
4550/// A double click action.
4551#[derive(Clone, Debug, Default)]
4552#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4553pub struct DoubleClick {
4554    /// Specifies the event type.
4555    pub r#type: String,
4556
4557    /// The x-coordinate where the double click occurred.
4558    pub r#x: i64,
4559
4560    /// The y-coordinate where the double click occurred.
4561    pub r#y: i64,
4562}
4563
4564/// A drag action.
4565#[derive(Clone, Debug, Default)]
4566#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4567pub struct Drag {
4568    /// Specifies the event type.
4569    pub r#type: String,
4570
4571    /// An array of coordinates representing the path of the drag action.
4572    pub r#path: Vec<Coordinate>,
4573}
4574
4575/// A message input to the model with a role indicating instruction following
4576/// hierarchy.
4577#[derive(Clone, Debug)]
4578#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4579pub struct EasyInputMessage {
4580    /// The role of the message input.
4581    pub r#role: String,
4582
4583    pub r#content: EasyInputMessage_Content,
4584
4585    /// The type of the message input.
4586    pub r#type: Option<String>,
4587}
4588
4589/// Text, image, or audio input to the model, used to generate a response.
4590#[derive(Clone, Debug)]
4591#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4592#[cfg_attr(feature = "serde", serde(untagged))]
4593pub enum EasyInputMessage_Content {
4594    /// A text input to the model.
4595    Text(String),
4596
4597    InputMessageContentList(InputMessageContentList),
4598}
4599
4600/// Represents an embedding vector returned by embedding endpoint.
4601#[derive(Clone, Debug, Default)]
4602#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4603pub struct Embedding {
4604    /// The index of the embedding in the list of embeddings.
4605    pub r#index: i64,
4606
4607    /// The embedding vector, which is a list of floats.
4608    pub r#embedding: Vec<f64>,
4609
4610    /// The object type, which is always "embedding".
4611    pub r#object: String,
4612}
4613
4614#[derive(Clone, Debug, Default)]
4615#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4616pub struct Error {
4617    pub r#code: Option<String>,
4618
4619    pub r#message: String,
4620
4621    pub r#param: Option<String>,
4622
4623    pub r#type: String,
4624}
4625
4626/// Occurs when an [error](/docs/guides/error-codes#api-errors) occurs.
4627#[derive(Clone, Debug)]
4628#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4629pub struct ErrorEvent {
4630    pub r#event: String,
4631
4632    pub r#data: Error,
4633}
4634
4635#[derive(Clone, Debug)]
4636#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4637pub struct ErrorResponse {
4638    pub r#error: Error,
4639}
4640
4641/// An Eval object with a data source config and testing criteria.
4642#[derive(Clone, Debug)]
4643#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4644pub struct Eval {
4645    /// The object type.
4646    pub r#object: String,
4647
4648    /// Unique identifier for the evaluation.
4649    pub r#id: String,
4650
4651    /// The name of the evaluation.
4652    pub r#name: String,
4653
4654    pub r#data_source_config: Eval_DataSourceConfig,
4655
4656    /// A list of testing criteria.
4657    pub r#testing_criteria: Vec<Eval_TestingCriteria>,
4658
4659    /// The Unix timestamp (in seconds) for when the eval was created.
4660    pub r#created_at: i64,
4661
4662    pub r#metadata: Option<Metadata>,
4663}
4664
4665/// An object representing an error response from the Eval API.
4666#[derive(Clone, Debug, Default)]
4667#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4668pub struct EvalApiError {
4669    /// The error code.
4670    pub r#code: String,
4671
4672    /// The error message.
4673    pub r#message: String,
4674}
4675
4676/// A CustomDataSourceConfig which specifies the schema of your `item` and
4677/// optionally `sample` namespaces.
4678#[derive(Clone, Debug, Default)]
4679#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4680pub struct EvalCustomDataSourceConfig {
4681    /// The type of data source.
4682    pub r#type: String,
4683
4684    /// The json schema for the run data source items.
4685    pub r#schema: EvalCustomDataSourceConfig_Schema,
4686}
4687
4688/// The json schema for the run data source items.
4689#[derive(Clone, Debug, Default)]
4690#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4691pub struct EvalCustomDataSourceConfig_Schema;
4692
4693/// A message input to the model with a role indicating instruction following
4694/// hierarchy.
4695#[derive(Clone, Debug)]
4696#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4697pub struct EvalItem {
4698    /// The role of the message input.
4699    pub r#role: String,
4700
4701    pub r#content: EvalItem_Content,
4702
4703    /// The type of the message input.
4704    pub r#type: Option<String>,
4705}
4706
4707/// Text inputs to the model - can contain template strings.
4708#[derive(Clone, Debug)]
4709#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4710#[cfg_attr(feature = "serde", serde(untagged))]
4711pub enum EvalItem_Content {
4712    /// A text input to the model.
4713    Text(String),
4714
4715    InputTextContent(InputTextContent),
4716
4717    EvalItem_Content_Variant3(EvalItem_Content_Variant3),
4718}
4719
4720/// A text output from the model.
4721#[derive(Clone, Debug, Default)]
4722#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4723pub struct EvalItem_Content_Variant3 {
4724    /// The type of the output text.
4725    pub r#type: String,
4726
4727    /// The text output from the model.
4728    pub r#text: String,
4729}
4730
4731#[derive(Clone, Debug, Default)]
4732#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4733pub struct EvalJsonlFileContentSource {
4734    /// The type of jsonl source.
4735    pub r#type: String,
4736
4737    /// The content of the jsonl file.
4738    pub r#content: Vec<EvalJsonlFileContentSource_Content>,
4739}
4740
4741#[derive(Clone, Debug, Default)]
4742#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4743pub struct EvalJsonlFileContentSource_Content {
4744    pub r#item: EvalJsonlFileContentSource_Content_Item,
4745
4746    pub r#sample: Option<EvalJsonlFileContentSource_Content_Sample>,
4747}
4748
4749#[derive(Clone, Debug, Default)]
4750#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4751pub struct EvalJsonlFileContentSource_Content_Item;
4752
4753#[derive(Clone, Debug, Default)]
4754#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4755pub struct EvalJsonlFileContentSource_Content_Sample;
4756
4757#[derive(Clone, Debug, Default)]
4758#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4759pub struct EvalJsonlFileIdSource {
4760    /// The type of jsonl source.
4761    pub r#type: String,
4762
4763    /// The identifier of the file.
4764    pub r#id: String,
4765}
4766
4767/// A LabelModelGrader object which uses a model to assign labels to each item
4768/// in the evaluation.
4769#[derive(Clone, Debug, Default)]
4770#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4771pub struct EvalLabelModelGrader {
4772    /// The object type, which is always `label_model`.
4773    pub r#type: String,
4774
4775    /// The name of the grader.
4776    pub r#name: String,
4777
4778    /// The model to use for the evaluation.
4779    pub r#model: String,
4780
4781    pub r#input: Vec<EvalItem>,
4782
4783    /// The labels to assign to each item in the evaluation.
4784    pub r#labels: Vec<String>,
4785
4786    /// The labels that indicate a passing result.
4787    pub r#passing_labels: Vec<String>,
4788}
4789
4790/// An object representing a list of evals.
4791#[derive(Clone, Debug, Default)]
4792#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4793pub struct EvalList {
4794    /// The type of this object.
4795    pub r#object: String,
4796
4797    /// An array of eval objects.
4798    pub r#data: Vec<Eval>,
4799
4800    /// The identifier of the first eval in the data array.
4801    pub r#first_id: String,
4802
4803    /// The identifier of the last eval in the data array.
4804    pub r#last_id: String,
4805
4806    /// Indicates whether there are more evals available.
4807    pub r#has_more: bool,
4808}
4809
4810/// A PythonGrader object that runs a python script on the input.
4811#[derive(Clone, Debug, Default)]
4812#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4813pub struct EvalPythonGrader {
4814    /// The object type, which is always `python`.
4815    pub r#type: String,
4816
4817    /// The name of the grader.
4818    pub r#name: String,
4819
4820    /// The source code of the python script.
4821    pub r#source: String,
4822
4823    /// The threshold for the score.
4824    pub r#pass_threshold: Option<f64>,
4825
4826    /// The image tag to use for the python script.
4827    pub r#image_tag: Option<String>,
4828}
4829
4830/// A EvalResponsesSource object describing a run data source configuration.
4831#[derive(Clone, Debug, Default)]
4832#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4833pub struct EvalResponsesSource {
4834    /// The type of run data source.
4835    pub r#type: String,
4836
4837    /// Metadata filter for the responses.
4838    pub r#metadata: Option<EvalResponsesSource_Metadata>,
4839
4840    /// The name of the model to find responses for.
4841    pub r#model: Option<String>,
4842
4843    /// Optional search string for instructions.
4844    pub r#instructions_search: Option<String>,
4845
4846    /// Only include items created after this timestamp (inclusive).
4847    pub r#created_after: Option<i64>,
4848
4849    /// Only include items created before this timestamp (inclusive).
4850    pub r#created_before: Option<i64>,
4851
4852    /// Whether the response has tool calls.
4853    pub r#has_tool_calls: Option<bool>,
4854
4855    /// Optional reasoning effort parameter.
4856    pub r#reasoning_effort: Option<ReasoningEffort>,
4857
4858    /// Sampling temperature.
4859    pub r#temperature: Option<f64>,
4860
4861    /// Nucleus sampling parameter.
4862    pub r#top_p: Option<f64>,
4863
4864    /// List of user identifiers.
4865    pub r#users: Option<Vec<String>>,
4866
4867    /// Whether to allow parallel tool calls.
4868    pub r#allow_parallel_tool_calls: Option<bool>,
4869}
4870
4871/// Metadata filter for the responses.
4872#[derive(Clone, Debug, Default)]
4873#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4874pub struct EvalResponsesSource_Metadata;
4875
4876/// A schema representing an evaluation run.
4877#[derive(Clone, Debug)]
4878#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4879pub struct EvalRun {
4880    /// The type of the object.
4881    pub r#object: String,
4882
4883    /// Unique identifier for the evaluation run.
4884    pub r#id: String,
4885
4886    /// The identifier of the associated evaluation.
4887    pub r#eval_id: String,
4888
4889    /// The status of the evaluation run.
4890    pub r#status: String,
4891
4892    /// The model that is evaluated, if applicable.
4893    pub r#model: String,
4894
4895    /// The name of the evaluation run.
4896    pub r#name: String,
4897
4898    /// Unix timestamp (in seconds) when the evaluation run was created.
4899    pub r#created_at: i64,
4900
4901    /// The URL to the rendered evaluation run report on the UI dashboard.
4902    pub r#report_url: String,
4903
4904    pub r#result_counts: EvalRun_ResultCounts,
4905
4906    /// Usage statistics for each model during the evaluation run.
4907    pub r#per_model_usage: Vec<EvalRun_PerModelUsage>,
4908
4909    /// Results per testing criteria applied during the evaluation run.
4910    pub r#per_testing_criteria_results: Vec<EvalRun_PerTestingCriteriaResults>,
4911
4912    pub r#data_source: EvalRun_DataSource,
4913
4914    pub r#metadata: Option<Metadata>,
4915
4916    pub r#error: EvalApiError,
4917}
4918
4919/// An object representing a list of runs for an evaluation.
4920#[derive(Clone, Debug, Default)]
4921#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4922pub struct EvalRunList {
4923    /// The type of this object.
4924    pub r#object: String,
4925
4926    /// An array of eval run objects.
4927    pub r#data: Vec<EvalRun>,
4928
4929    /// The identifier of the first eval run in the data array.
4930    pub r#first_id: String,
4931
4932    /// The identifier of the last eval run in the data array.
4933    pub r#last_id: String,
4934
4935    /// Indicates whether there are more evals available.
4936    pub r#has_more: bool,
4937}
4938
4939/// A schema representing an evaluation run output item.
4940#[derive(Clone, Debug)]
4941#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4942pub struct EvalRunOutputItem {
4943    /// The type of the object.
4944    pub r#object: String,
4945
4946    /// Unique identifier for the evaluation run output item.
4947    pub r#id: String,
4948
4949    /// The identifier of the evaluation run associated with this output item.
4950    pub r#run_id: String,
4951
4952    /// The identifier of the evaluation group.
4953    pub r#eval_id: String,
4954
4955    /// Unix timestamp (in seconds) when the evaluation run was created.
4956    pub r#created_at: i64,
4957
4958    /// The status of the evaluation run.
4959    pub r#status: String,
4960
4961    /// The identifier for the data source item.
4962    pub r#datasource_item_id: i64,
4963
4964    /// Details of the input data source item.
4965    pub r#datasource_item: EvalRunOutputItem_DatasourceItem,
4966
4967    /// A list of results from the evaluation run.
4968    pub r#results: Vec<EvalRunOutputItem_Results>,
4969
4970    pub r#sample: EvalRunOutputItem_Sample,
4971}
4972
4973/// Details of the input data source item.
4974#[derive(Clone, Debug, Default)]
4975#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4976pub struct EvalRunOutputItem_DatasourceItem;
4977
4978/// A result object.
4979#[derive(Clone, Debug, Default)]
4980#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4981pub struct EvalRunOutputItem_Results;
4982
4983/// An object representing a list of output items for an evaluation run.
4984#[derive(Clone, Debug, Default)]
4985#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4986pub struct EvalRunOutputItemList {
4987    /// The type of this object.
4988    pub r#object: String,
4989
4990    /// An array of eval run output item objects.
4991    pub r#data: Vec<EvalRunOutputItem>,
4992
4993    /// The identifier of the first eval run output item in the data array.
4994    pub r#first_id: String,
4995
4996    /// The identifier of the last eval run output item in the data array.
4997    pub r#last_id: String,
4998
4999    /// Indicates whether there are more eval run output items available.
5000    pub r#has_more: bool,
5001}
5002
5003/// A sample containing the input and output of the evaluation run.
5004#[derive(Clone, Debug)]
5005#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5006pub struct EvalRunOutputItem_Sample {
5007    /// An array of input messages.
5008    pub r#input: Vec<EvalRunOutputItem_Sample_Input>,
5009
5010    /// An array of output messages.
5011    pub r#output: Vec<EvalRunOutputItem_Sample_Output>,
5012
5013    /// The reason why the sample generation was finished.
5014    pub r#finish_reason: String,
5015
5016    /// The model used for generating the sample.
5017    pub r#model: String,
5018
5019    pub r#usage: EvalRunOutputItem_Sample_Usage,
5020
5021    pub r#error: EvalApiError,
5022
5023    /// The sampling temperature used.
5024    pub r#temperature: f64,
5025
5026    /// The maximum number of tokens allowed for completion.
5027    pub r#max_completion_tokens: i64,
5028
5029    /// The top_p value used for sampling.
5030    pub r#top_p: f64,
5031
5032    /// The seed used for generating the sample.
5033    pub r#seed: i64,
5034}
5035
5036/// An input message.
5037#[derive(Clone, Debug, Default)]
5038#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5039pub struct EvalRunOutputItem_Sample_Input {
5040    /// The role of the message sender (e.g., system, user, developer).
5041    pub r#role: String,
5042
5043    /// The content of the message.
5044    pub r#content: String,
5045}
5046
5047#[derive(Clone, Debug, Default)]
5048#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5049pub struct EvalRunOutputItem_Sample_Output {
5050    /// The role of the message (e.g.
5051    pub r#role: Option<String>,
5052
5053    /// The content of the message.
5054    pub r#content: Option<String>,
5055}
5056
5057/// Token usage details for the sample.
5058#[derive(Clone, Debug, Default)]
5059#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5060pub struct EvalRunOutputItem_Sample_Usage {
5061    /// The total number of tokens used.
5062    pub r#total_tokens: i64,
5063
5064    /// The number of completion tokens generated.
5065    pub r#completion_tokens: i64,
5066
5067    /// The number of prompt tokens used.
5068    pub r#prompt_tokens: i64,
5069
5070    /// The number of tokens retrieved from cache.
5071    pub r#cached_tokens: i64,
5072}
5073
5074/// Information about the run's data source.
5075#[derive(Clone, Debug)]
5076#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5077#[cfg_attr(feature = "serde", serde(untagged))]
5078pub enum EvalRun_DataSource {
5079    CreateEvalJsonlRunDataSource(CreateEvalJsonlRunDataSource),
5080
5081    CreateEvalCompletionsRunDataSource(CreateEvalCompletionsRunDataSource),
5082
5083    CreateEvalResponsesRunDataSource(CreateEvalResponsesRunDataSource),
5084}
5085
5086#[derive(Clone, Debug, Default)]
5087#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5088pub struct EvalRun_PerModelUsage {
5089    /// The name of the model.
5090    pub r#model_name: String,
5091
5092    /// The number of invocations.
5093    pub r#invocation_count: i64,
5094
5095    /// The number of prompt tokens used.
5096    pub r#prompt_tokens: i64,
5097
5098    /// The number of completion tokens generated.
5099    pub r#completion_tokens: i64,
5100
5101    /// The total number of tokens used.
5102    pub r#total_tokens: i64,
5103
5104    /// The number of tokens retrieved from cache.
5105    pub r#cached_tokens: i64,
5106}
5107
5108#[derive(Clone, Debug, Default)]
5109#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5110pub struct EvalRun_PerTestingCriteriaResults {
5111    /// A description of the testing criteria.
5112    pub r#testing_criteria: String,
5113
5114    /// Number of tests passed for this criteria.
5115    pub r#passed: i64,
5116
5117    /// Number of tests failed for this criteria.
5118    pub r#failed: i64,
5119}
5120
5121/// Counters summarizing the outcomes of the evaluation run.
5122#[derive(Clone, Debug, Default)]
5123#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5124pub struct EvalRun_ResultCounts {
5125    /// Total number of executed output items.
5126    pub r#total: i64,
5127
5128    /// Number of output items that resulted in an error.
5129    pub r#errored: i64,
5130
5131    /// Number of output items that failed to pass the evaluation.
5132    pub r#failed: i64,
5133
5134    /// Number of output items that passed the evaluation.
5135    pub r#passed: i64,
5136}
5137
5138/// A ScoreModelGrader object that uses a model to assign a score to the input.
5139#[derive(Clone, Debug, Default)]
5140#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5141pub struct EvalScoreModelGrader {
5142    /// The object type, which is always `score_model`.
5143    pub r#type: String,
5144
5145    /// The name of the grader.
5146    pub r#name: String,
5147
5148    /// The model to use for the evaluation.
5149    pub r#model: String,
5150
5151    /// The sampling parameters for the model.
5152    pub r#sampling_params: Option<EvalScoreModelGrader_SamplingParams>,
5153
5154    /// The input text.
5155    pub r#input: Vec<EvalItem>,
5156
5157    /// The threshold for the score.
5158    pub r#pass_threshold: Option<f64>,
5159
5160    /// The range of the score.
5161    pub r#range: Option<Vec<f64>>,
5162}
5163
5164/// The sampling parameters for the model.
5165#[derive(Clone, Debug, Default)]
5166#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5167pub struct EvalScoreModelGrader_SamplingParams;
5168
5169/// A StoredCompletionsDataSourceConfig which specifies the metadata property of
5170/// your stored completions query.
5171#[derive(Clone, Debug, Default)]
5172#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5173pub struct EvalStoredCompletionsDataSourceConfig {
5174    /// The type of data source.
5175    pub r#type: String,
5176
5177    pub r#metadata: Option<Metadata>,
5178
5179    /// The json schema for the run data source items.
5180    pub r#schema: EvalStoredCompletionsDataSourceConfig_Schema,
5181}
5182
5183/// The json schema for the run data source items.
5184#[derive(Clone, Debug, Default)]
5185#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5186pub struct EvalStoredCompletionsDataSourceConfig_Schema;
5187
5188/// A StoredCompletionsRunDataSource configuration describing a set of filters
5189#[derive(Clone, Debug, Default)]
5190#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5191pub struct EvalStoredCompletionsSource {
5192    /// The type of source.
5193    pub r#type: String,
5194
5195    pub r#metadata: Option<Metadata>,
5196
5197    /// An optional model to filter by (e.g., 'gpt-4o').
5198    pub r#model: Option<String>,
5199
5200    /// An optional Unix timestamp to filter items created after this time.
5201    pub r#created_after: Option<i64>,
5202
5203    /// An optional Unix timestamp to filter items created before this time.
5204    pub r#created_before: Option<i64>,
5205
5206    /// An optional maximum number of items to return.
5207    pub r#limit: Option<i64>,
5208}
5209
5210/// A StringCheckGrader object that performs a string comparison between input
5211/// and reference using a specified operation.
5212#[derive(Clone, Debug, Default)]
5213#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5214pub struct EvalStringCheckGrader {
5215    /// The object type, which is always `string_check`.
5216    pub r#type: String,
5217
5218    /// The name of the grader.
5219    pub r#name: String,
5220
5221    /// The input text.
5222    pub r#input: String,
5223
5224    /// The reference text.
5225    pub r#reference: String,
5226
5227    /// The string check operation to perform.
5228    pub r#operation: String,
5229}
5230
5231/// A TextSimilarityGrader object which grades text based on similarity metrics.
5232#[derive(Clone, Debug, Default)]
5233#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5234pub struct EvalTextSimilarityGrader {
5235    /// The type of grader.
5236    pub r#type: String,
5237
5238    /// The name of the grader.
5239    pub r#name: Option<String>,
5240
5241    /// The text being graded.
5242    pub r#input: String,
5243
5244    /// The text being graded against.
5245    pub r#reference: String,
5246
5247    /// A float score where a value greater than or equal indicates a passing
5248    /// grade.
5249    pub r#pass_threshold: f64,
5250
5251    /// The evaluation metric to use.
5252    pub r#evaluation_metric: String,
5253}
5254
5255/// Configuration of data sources used in runs of the evaluation.
5256#[derive(Clone, Debug)]
5257#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5258#[cfg_attr(feature = "serde", serde(untagged))]
5259pub enum Eval_DataSourceConfig {
5260    EvalCustomDataSourceConfig(EvalCustomDataSourceConfig),
5261
5262    EvalStoredCompletionsDataSourceConfig(EvalStoredCompletionsDataSourceConfig),
5263}
5264
5265#[derive(Clone, Debug)]
5266#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5267#[cfg_attr(feature = "serde", serde(untagged))]
5268pub enum Eval_TestingCriteria {
5269    EvalLabelModelGrader(EvalLabelModelGrader),
5270
5271    EvalStringCheckGrader(EvalStringCheckGrader),
5272
5273    EvalTextSimilarityGrader(EvalTextSimilarityGrader),
5274
5275    EvalPythonGrader(EvalPythonGrader),
5276
5277    EvalScoreModelGrader(EvalScoreModelGrader),
5278}
5279
5280/// A citation to a file.
5281#[derive(Clone, Debug, Default)]
5282#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5283pub struct FileCitationBody {
5284    /// The type of the file citation.
5285    pub r#type: String,
5286
5287    /// The ID of the file.
5288    pub r#file_id: String,
5289
5290    /// The index of the file in the list of files.
5291    pub r#index: i64,
5292}
5293
5294/// A path to a file.
5295#[derive(Clone, Debug, Default)]
5296#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5297pub struct FilePath {
5298    /// The type of the file path.
5299    pub r#type: String,
5300
5301    /// The ID of the file.
5302    pub r#file_id: String,
5303
5304    /// The index of the file in the list of files.
5305    pub r#index: i64,
5306}
5307
5308/// The ranker to use for the file search.
5309#[derive(Clone, Debug)]
5310#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5311pub enum FileSearchRanker {
5312    #[cfg_attr(feature = "serde", serde(rename = "auto"))]
5313    Auto,
5314
5315    #[cfg_attr(feature = "serde", serde(rename = "default_2024_08_21"))]
5316    Default20240821,
5317
5318    #[cfg_attr(feature = "serde", serde(untagged))]
5319    Other(String),
5320}
5321
5322/// The ranking options for the file search.
5323#[derive(Clone, Debug, Default)]
5324#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5325pub struct FileSearchRankingOptions {
5326    pub r#ranker: Option<FileSearchRanker>,
5327
5328    /// The score threshold for the file search.
5329    pub r#score_threshold: f64,
5330}
5331
5332/// A tool that searches for relevant content from uploaded files.
5333#[derive(Clone, Debug, Default)]
5334#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5335pub struct FileSearchTool {
5336    /// The type of the file search tool.
5337    pub r#type: String,
5338
5339    /// The IDs of the vector stores to search.
5340    pub r#vector_store_ids: Vec<String>,
5341
5342    /// The maximum number of results to return.
5343    pub r#max_num_results: Option<i64>,
5344
5345    /// Ranking options for search.
5346    pub r#ranking_options: Option<RankingOptions>,
5347
5348    pub r#filters: Option<FileSearchTool_Filters>,
5349}
5350
5351/// The results of a file search tool call.
5352#[derive(Clone, Debug, Default)]
5353#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5354pub struct FileSearchToolCall {
5355    /// The unique ID of the file search tool call.
5356    pub r#id: String,
5357
5358    /// The type of the file search tool call.
5359    pub r#type: String,
5360
5361    /// The status of the file search tool call.
5362    pub r#status: String,
5363
5364    /// The queries used to search for files.
5365    pub r#queries: Vec<String>,
5366
5367    /// The results of the file search tool call.
5368    pub r#results: Option<Vec<FileSearchToolCall_Results>>,
5369}
5370
5371#[derive(Clone, Debug, Default)]
5372#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5373pub struct FileSearchToolCall_Results {
5374    /// The unique ID of the file.
5375    pub r#file_id: Option<String>,
5376
5377    /// The text that was retrieved from the file.
5378    pub r#text: Option<String>,
5379
5380    /// The name of the file.
5381    pub r#filename: Option<String>,
5382
5383    pub r#attributes: Option<VectorStoreFileAttributes>,
5384
5385    /// The relevance score of the file - a value between 0 and 1.
5386    pub r#score: Option<f64>,
5387}
5388
5389pub type FileSearchTool_Filters = Option<FileSearchTool_Filters_1>;
5390
5391/// A filter to apply.
5392pub type FileSearchTool_Filters_1 = Filters;
5393
5394#[derive(Clone, Debug)]
5395#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5396#[cfg_attr(feature = "serde", serde(untagged))]
5397pub enum Filters {
5398    ComparisonFilter(ComparisonFilter),
5399
5400    CompoundFilter(CompoundFilter),
5401}
5402
5403#[derive(Clone, Debug, Default)]
5404#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5405pub struct FineTuneChatCompletionRequestAssistantMessage {
5406    /// Controls whether the assistant message is trained against (0 or 1)
5407    pub r#weight: Option<i64>,
5408
5409    pub r#content: Option<ChatCompletionRequestAssistantMessage_Content>,
5410
5411    /// The refusal message by the assistant.
5412    pub r#refusal: Option<String>,
5413
5414    /// The role of the messages author, in this case `assistant`.
5415    pub r#role: String,
5416
5417    /// An optional name for the participant.
5418    pub r#name: Option<String>,
5419
5420    pub r#audio: Option<ChatCompletionRequestAssistantMessage_Audio>,
5421
5422    pub r#tool_calls: Option<ChatCompletionMessageToolCalls>,
5423
5424    pub r#function_call: Option<ChatCompletionRequestAssistantMessage_FunctionCall>,
5425}
5426
5427#[derive(Clone, Debug, Default)]
5428#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5429pub struct FineTuneChatCompletionRequestAssistantMessage_Variant1 {
5430    /// Controls whether the assistant message is trained against (0 or 1)
5431    pub r#weight: Option<i64>,
5432}
5433
5434/// The per-line training example of a fine-tuning input file for chat models
5435/// using the supervised method.
5436#[derive(Clone, Debug, Default)]
5437#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5438pub struct FineTuneChatRequestInput {
5439    pub r#messages: Option<Vec<FineTuneChatRequestInput_Messages>>,
5440
5441    /// A list of tools the model may generate JSON inputs for.
5442    pub r#tools: Option<Vec<ChatCompletionTool>>,
5443
5444    pub r#parallel_tool_calls: Option<ParallelToolCalls>,
5445
5446    /// A list of functions the model may generate JSON inputs for.
5447    pub r#functions: Option<Vec<ChatCompletionFunctions>>,
5448}
5449
5450#[derive(Clone, Debug)]
5451#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5452#[cfg_attr(feature = "serde", serde(untagged))]
5453pub enum FineTuneChatRequestInput_Messages {
5454    ChatCompletionRequestSystemMessage(ChatCompletionRequestSystemMessage),
5455
5456    ChatCompletionRequestUserMessage(ChatCompletionRequestUserMessage),
5457
5458    FineTuneChatCompletionRequestAssistantMessage(FineTuneChatCompletionRequestAssistantMessage),
5459
5460    ChatCompletionRequestToolMessage(ChatCompletionRequestToolMessage),
5461
5462    ChatCompletionRequestFunctionMessage(ChatCompletionRequestFunctionMessage),
5463}
5464
5465/// The per-line training example of a fine-tuning input file for completions
5466/// models
5467#[derive(Clone, Debug, Default)]
5468#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5469pub struct FineTuneCompletionRequestInput {
5470    /// The input prompt for this training example.
5471    pub r#prompt: Option<String>,
5472
5473    /// The desired completion for this training example.
5474    pub r#completion: Option<String>,
5475}
5476
5477/// Configuration for the DPO fine-tuning method.
5478#[derive(Clone, Debug, Default)]
5479#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5480pub struct FineTuneDPOMethod {
5481    pub r#hyperparameters: Option<FineTuneDPOMethod_Hyperparameters>,
5482}
5483
5484/// The hyperparameters used for the fine-tuning job.
5485#[derive(Clone, Debug, Default)]
5486#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5487pub struct FineTuneDPOMethod_Hyperparameters {
5488    pub r#beta: Option<FineTuneDPOMethod_Hyperparameters_Beta>,
5489
5490    pub r#batch_size: Option<FineTuneDPOMethod_Hyperparameters_BatchSize>,
5491
5492    pub r#learning_rate_multiplier: Option<FineTuneDPOMethod_Hyperparameters_LearningRateMultiplier>,
5493
5494    pub r#n_epochs: Option<FineTuneDPOMethod_Hyperparameters_NEpochs>,
5495}
5496
5497/// Number of examples in each batch.
5498#[derive(Clone, Debug)]
5499#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5500#[cfg_attr(feature = "serde", serde(untagged))]
5501pub enum FineTuneDPOMethod_Hyperparameters_BatchSize {
5502    Text(String),
5503
5504    Integer(i64),
5505}
5506
5507/// The beta value for the DPO method.
5508#[derive(Clone, Debug)]
5509#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5510#[cfg_attr(feature = "serde", serde(untagged))]
5511pub enum FineTuneDPOMethod_Hyperparameters_Beta {
5512    Text(String),
5513
5514    Number(f64),
5515}
5516
5517/// Scaling factor for the learning rate.
5518#[derive(Clone, Debug)]
5519#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5520#[cfg_attr(feature = "serde", serde(untagged))]
5521pub enum FineTuneDPOMethod_Hyperparameters_LearningRateMultiplier {
5522    Text(String),
5523
5524    Number(f64),
5525}
5526
5527/// The number of epochs to train the model for.
5528#[derive(Clone, Debug)]
5529#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5530#[cfg_attr(feature = "serde", serde(untagged))]
5531pub enum FineTuneDPOMethod_Hyperparameters_NEpochs {
5532    Text(String),
5533
5534    Integer(i64),
5535}
5536
5537/// The method used for fine-tuning.
5538#[derive(Clone, Debug, Default)]
5539#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5540pub struct FineTuneMethod {
5541    /// The type of method.
5542    pub r#type: Option<String>,
5543
5544    pub r#supervised: Option<FineTuneSupervisedMethod>,
5545
5546    pub r#dpo: Option<FineTuneDPOMethod>,
5547}
5548
5549/// The per-line training example of a fine-tuning input file for chat models
5550/// using the dpo method.
5551#[derive(Clone, Debug, Default)]
5552#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5553pub struct FineTunePreferenceRequestInput {
5554    pub r#input: Option<FineTunePreferenceRequestInput_Input>,
5555
5556    /// The preferred completion message for the output.
5557    pub r#preferred_completion: Option<Vec<ChatCompletionRequestAssistantMessage>>,
5558
5559    /// The non-preferred completion message for the output.
5560    pub r#non_preferred_completion: Option<Vec<ChatCompletionRequestAssistantMessage>>,
5561}
5562
5563#[derive(Clone, Debug, Default)]
5564#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5565pub struct FineTunePreferenceRequestInput_Input {
5566    pub r#messages: Option<Vec<FineTunePreferenceRequestInput_Input_Messages>>,
5567
5568    /// A list of tools the model may generate JSON inputs for.
5569    pub r#tools: Option<Vec<ChatCompletionTool>>,
5570
5571    pub r#parallel_tool_calls: Option<ParallelToolCalls>,
5572}
5573
5574#[derive(Clone, Debug)]
5575#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5576#[cfg_attr(feature = "serde", serde(untagged))]
5577pub enum FineTunePreferenceRequestInput_Input_Messages {
5578    ChatCompletionRequestSystemMessage(ChatCompletionRequestSystemMessage),
5579
5580    ChatCompletionRequestUserMessage(ChatCompletionRequestUserMessage),
5581
5582    FineTuneChatCompletionRequestAssistantMessage(FineTuneChatCompletionRequestAssistantMessage),
5583
5584    ChatCompletionRequestToolMessage(ChatCompletionRequestToolMessage),
5585
5586    ChatCompletionRequestFunctionMessage(ChatCompletionRequestFunctionMessage),
5587}
5588
5589/// Configuration for the supervised fine-tuning method.
5590#[derive(Clone, Debug, Default)]
5591#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5592pub struct FineTuneSupervisedMethod {
5593    pub r#hyperparameters: Option<FineTuneSupervisedMethod_Hyperparameters>,
5594}
5595
5596/// The hyperparameters used for the fine-tuning job.
5597#[derive(Clone, Debug, Default)]
5598#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5599pub struct FineTuneSupervisedMethod_Hyperparameters {
5600    pub r#batch_size: Option<FineTuneSupervisedMethod_Hyperparameters_BatchSize>,
5601
5602    pub r#learning_rate_multiplier: Option<FineTuneSupervisedMethod_Hyperparameters_LearningRateMultiplier>,
5603
5604    pub r#n_epochs: Option<FineTuneSupervisedMethod_Hyperparameters_NEpochs>,
5605}
5606
5607/// Number of examples in each batch.
5608#[derive(Clone, Debug)]
5609#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5610#[cfg_attr(feature = "serde", serde(untagged))]
5611pub enum FineTuneSupervisedMethod_Hyperparameters_BatchSize {
5612    Text(String),
5613
5614    Integer(i64),
5615}
5616
5617/// Scaling factor for the learning rate.
5618#[derive(Clone, Debug)]
5619#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5620#[cfg_attr(feature = "serde", serde(untagged))]
5621pub enum FineTuneSupervisedMethod_Hyperparameters_LearningRateMultiplier {
5622    Text(String),
5623
5624    Number(f64),
5625}
5626
5627/// The number of epochs to train the model for.
5628#[derive(Clone, Debug)]
5629#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5630#[cfg_attr(feature = "serde", serde(untagged))]
5631pub enum FineTuneSupervisedMethod_Hyperparameters_NEpochs {
5632    Text(String),
5633
5634    Integer(i64),
5635}
5636
5637/// The `checkpoint.permission` object represents a permission for a fine-tuned
5638/// model checkpoint.
5639#[derive(Clone, Debug, Default)]
5640#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5641pub struct FineTuningCheckpointPermission {
5642    /// The permission identifier, which can be referenced in the API endpoints.
5643    pub r#id: String,
5644
5645    /// The Unix timestamp (in seconds) for when the permission was created.
5646    pub r#created_at: i64,
5647
5648    /// The project identifier that the permission is for.
5649    pub r#project_id: String,
5650
5651    /// The object type, which is always "checkpoint.permission".
5652    pub r#object: String,
5653}
5654
5655#[derive(Clone, Debug)]
5656#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5657pub struct FineTuningIntegration {
5658    /// The type of the integration being enabled for the fine-tuning job
5659    pub r#type: String,
5660
5661    pub r#wandb: FineTuningIntegration_Wandb,
5662}
5663
5664/// The settings for your integration with Weights and Biases.
5665#[derive(Clone, Debug, Default)]
5666#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5667pub struct FineTuningIntegration_Wandb {
5668    /// The name of the project that the new run will be created under.
5669    pub r#project: String,
5670
5671    /// A display name to set for the run.
5672    pub r#name: Option<String>,
5673
5674    /// The entity to use for the run.
5675    pub r#entity: Option<String>,
5676
5677    /// A list of tags to be attached to the newly created run.
5678    pub r#tags: Option<Vec<String>>,
5679}
5680
5681/// The `fine_tuning.job` object represents a fine-tuning job that has been
5682/// created through the API.
5683#[derive(Clone, Debug)]
5684#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5685pub struct FineTuningJob {
5686    /// The object identifier, which can be referenced in the API endpoints.
5687    pub r#id: String,
5688
5689    /// The Unix timestamp (in seconds) for when the fine-tuning job was
5690    /// created.
5691    pub r#created_at: i64,
5692
5693    pub r#error: Option<FineTuningJob_Error>,
5694
5695    /// The name of the fine-tuned model that is being created.
5696    pub r#fine_tuned_model: Option<String>,
5697
5698    /// The Unix timestamp (in seconds) for when the fine-tuning job was
5699    /// finished.
5700    pub r#finished_at: Option<i64>,
5701
5702    pub r#hyperparameters: FineTuningJob_Hyperparameters,
5703
5704    /// The base model that is being fine-tuned.
5705    pub r#model: String,
5706
5707    /// The object type, which is always "fine_tuning.job".
5708    pub r#object: String,
5709
5710    /// The organization that owns the fine-tuning job.
5711    pub r#organization_id: String,
5712
5713    /// The compiled results file ID(s) for the fine-tuning job.
5714    pub r#result_files: Vec<String>,
5715
5716    /// The current status of the fine-tuning job, which can be either
5717    /// `validating_files`, `queued`, `running`, `succeeded`, `failed`, or
5718    /// `cancelled`.
5719    pub r#status: String,
5720
5721    /// The total number of billable tokens processed by this fine-tuning job.
5722    pub r#trained_tokens: Option<i64>,
5723
5724    /// The file ID used for training.
5725    pub r#training_file: String,
5726
5727    /// The file ID used for validation.
5728    pub r#validation_file: Option<String>,
5729
5730    /// A list of integrations to enable for this fine-tuning job.
5731    pub r#integrations: Option<Vec<FineTuningIntegration>>,
5732
5733    /// The seed used for the fine-tuning job.
5734    pub r#seed: i64,
5735
5736    /// The Unix timestamp (in seconds) for when the fine-tuning job is
5737    /// estimated to finish.
5738    pub r#estimated_finish: Option<i64>,
5739
5740    pub r#method: Option<FineTuneMethod>,
5741
5742    pub r#metadata: Option<Metadata>,
5743}
5744
5745/// The `fine_tuning.job.checkpoint` object represents a model checkpoint for a
5746/// fine-tuning job that is ready to use.
5747#[derive(Clone, Debug)]
5748#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5749pub struct FineTuningJobCheckpoint {
5750    /// The checkpoint identifier, which can be referenced in the API endpoints.
5751    pub r#id: String,
5752
5753    /// The Unix timestamp (in seconds) for when the checkpoint was created.
5754    pub r#created_at: i64,
5755
5756    /// The name of the fine-tuned checkpoint model that is created.
5757    pub r#fine_tuned_model_checkpoint: String,
5758
5759    /// The step number that the checkpoint was created at.
5760    pub r#step_number: i64,
5761
5762    pub r#metrics: FineTuningJobCheckpoint_Metrics,
5763
5764    /// The name of the fine-tuning job that this checkpoint was created from.
5765    pub r#fine_tuning_job_id: String,
5766
5767    /// The object type, which is always "fine_tuning.job.checkpoint".
5768    pub r#object: String,
5769}
5770
5771/// Metrics at the step number during the fine-tuning job.
5772#[derive(Clone, Debug, Default)]
5773#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5774pub struct FineTuningJobCheckpoint_Metrics {
5775    pub r#step: Option<f64>,
5776
5777    pub r#train_loss: Option<f64>,
5778
5779    pub r#train_mean_token_accuracy: Option<f64>,
5780
5781    pub r#valid_loss: Option<f64>,
5782
5783    pub r#valid_mean_token_accuracy: Option<f64>,
5784
5785    pub r#full_valid_loss: Option<f64>,
5786
5787    pub r#full_valid_mean_token_accuracy: Option<f64>,
5788}
5789
5790/// Fine-tuning job event object
5791#[derive(Clone, Debug, Default)]
5792#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5793pub struct FineTuningJobEvent {
5794    /// The object type, which is always "fine_tuning.job.event".
5795    pub r#object: String,
5796
5797    /// The object identifier.
5798    pub r#id: String,
5799
5800    /// The Unix timestamp (in seconds) for when the fine-tuning job was
5801    /// created.
5802    pub r#created_at: i64,
5803
5804    /// The log level of the event.
5805    pub r#level: String,
5806
5807    /// The message of the event.
5808    pub r#message: String,
5809
5810    /// The type of event.
5811    pub r#type: Option<String>,
5812
5813    /// The data associated with the event.
5814    pub r#data: Option<FineTuningJobEvent_Data>,
5815}
5816
5817/// The data associated with the event.
5818#[derive(Clone, Debug, Default)]
5819#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5820pub struct FineTuningJobEvent_Data;
5821
5822/// For fine-tuning jobs that have `failed`, this will contain more information
5823/// on the cause of the failure.
5824#[derive(Clone, Debug, Default)]
5825#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5826pub struct FineTuningJob_Error {
5827    /// A machine-readable error code.
5828    pub r#code: String,
5829
5830    /// A human-readable error message.
5831    pub r#message: String,
5832
5833    /// The parameter that was invalid, usually `training_file` or
5834    /// `validation_file`.
5835    pub r#param: Option<String>,
5836}
5837
5838/// The hyperparameters used for the fine-tuning job.
5839#[derive(Clone, Debug, Default)]
5840#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5841pub struct FineTuningJob_Hyperparameters {
5842    pub r#batch_size: Option<FineTuningJob_Hyperparameters_BatchSize>,
5843
5844    pub r#learning_rate_multiplier: Option<FineTuningJob_Hyperparameters_LearningRateMultiplier>,
5845
5846    pub r#n_epochs: Option<FineTuningJob_Hyperparameters_NEpochs>,
5847}
5848
5849/// Number of examples in each batch.
5850#[derive(Clone, Debug)]
5851#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5852#[cfg_attr(feature = "serde", serde(untagged))]
5853pub enum FineTuningJob_Hyperparameters_BatchSize {
5854    Text(String),
5855
5856    Integer(i64),
5857}
5858
5859/// Scaling factor for the learning rate.
5860#[derive(Clone, Debug)]
5861#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5862#[cfg_attr(feature = "serde", serde(untagged))]
5863pub enum FineTuningJob_Hyperparameters_LearningRateMultiplier {
5864    Text(String),
5865
5866    Number(f64),
5867}
5868
5869/// The number of epochs to train the model for.
5870#[derive(Clone, Debug)]
5871#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5872#[cfg_attr(feature = "serde", serde(untagged))]
5873pub enum FineTuningJob_Hyperparameters_NEpochs {
5874    Text(String),
5875
5876    Integer(i64),
5877}
5878
5879/// The output of a function tool call.
5880#[derive(Clone, Debug, Default)]
5881#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5882pub struct FunctionCallOutputItemParam {
5883    pub r#id: Option<FunctionCallOutputItemParam_Id>,
5884
5885    /// The unique ID of the function tool call generated by the model.
5886    pub r#call_id: String,
5887
5888    /// The type of the function tool call output.
5889    pub r#type: String,
5890
5891    /// A JSON string of the output of the function tool call.
5892    pub r#output: String,
5893
5894    pub r#status: Option<FunctionCallOutputItemParam_Status>,
5895}
5896
5897pub type FunctionCallOutputItemParam_Id = Option<String>;
5898
5899pub type FunctionCallOutputItemParam_Status = Option<String>;
5900
5901#[derive(Clone, Debug, Default)]
5902#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5903pub struct FunctionObject {
5904    /// A description of what the function does, used by the model to choose
5905    /// when and how to call the function.
5906    pub r#description: Option<String>,
5907
5908    /// The name of the function to be called.
5909    pub r#name: String,
5910
5911    pub r#parameters: Option<FunctionParameters>,
5912
5913    /// Whether to enable strict schema adherence when generating the function
5914    /// call.
5915    pub r#strict: Option<bool>,
5916}
5917
5918/// The parameters the functions accepts, described as a JSON Schema object.
5919#[derive(Clone, Debug, Default)]
5920#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5921pub struct FunctionParameters;
5922
5923/// Defines a function in your own code the model can choose to call.
5924#[derive(Clone, Debug)]
5925#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5926pub struct FunctionTool {
5927    /// The type of the function tool.
5928    pub r#type: String,
5929
5930    /// The name of the function to call.
5931    pub r#name: String,
5932
5933    pub r#description: Option<FunctionTool_Description>,
5934
5935    pub r#parameters: FunctionTool_Parameters,
5936
5937    pub r#strict: FunctionTool_Strict,
5938}
5939
5940/// A tool call to run a function.
5941#[derive(Clone, Debug, Default)]
5942#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5943pub struct FunctionToolCall {
5944    /// The unique ID of the function tool call.
5945    pub r#id: Option<String>,
5946
5947    /// The type of the function tool call.
5948    pub r#type: String,
5949
5950    /// The unique ID of the function tool call generated by the model.
5951    pub r#call_id: String,
5952
5953    /// The name of the function to run.
5954    pub r#name: String,
5955
5956    /// A JSON string of the arguments to pass to the function.
5957    pub r#arguments: String,
5958
5959    /// The status of the item.
5960    pub r#status: Option<String>,
5961}
5962
5963/// The output of a function tool call.
5964#[derive(Clone, Debug, Default)]
5965#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5966pub struct FunctionToolCallOutput {
5967    /// The unique ID of the function tool call output.
5968    pub r#id: Option<String>,
5969
5970    /// The type of the function tool call output.
5971    pub r#type: String,
5972
5973    /// The unique ID of the function tool call generated by the model.
5974    pub r#call_id: String,
5975
5976    /// A JSON string of the output of the function tool call.
5977    pub r#output: String,
5978
5979    /// The status of the item.
5980    pub r#status: Option<String>,
5981}
5982
5983#[derive(Clone, Debug, Default)]
5984#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5985pub struct FunctionToolCallOutputResource {
5986    /// The unique ID of the function call tool output.
5987    pub r#id: String,
5988
5989    /// The type of the function tool call output.
5990    pub r#type: String,
5991
5992    /// The unique ID of the function tool call generated by the model.
5993    pub r#call_id: String,
5994
5995    /// A JSON string of the output of the function tool call.
5996    pub r#output: String,
5997
5998    /// The status of the item.
5999    pub r#status: Option<String>,
6000}
6001
6002#[derive(Clone, Debug, Default)]
6003#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6004pub struct FunctionToolCallOutputResource_Variant2 {
6005    /// The unique ID of the function call tool output.
6006    pub r#id: String,
6007}
6008
6009#[derive(Clone, Debug, Default)]
6010#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6011pub struct FunctionToolCallResource {
6012    /// The unique ID of the function tool call.
6013    pub r#id: String,
6014
6015    /// The type of the function tool call.
6016    pub r#type: String,
6017
6018    /// The unique ID of the function tool call generated by the model.
6019    pub r#call_id: String,
6020
6021    /// The name of the function to run.
6022    pub r#name: String,
6023
6024    /// A JSON string of the arguments to pass to the function.
6025    pub r#arguments: String,
6026
6027    /// The status of the item.
6028    pub r#status: Option<String>,
6029}
6030
6031#[derive(Clone, Debug, Default)]
6032#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6033pub struct FunctionToolCallResource_Variant2 {
6034    /// The unique ID of the function tool call.
6035    pub r#id: String,
6036}
6037
6038pub type FunctionTool_Description = Option<String>;
6039
6040pub type FunctionTool_Parameters = Option<FunctionTool_Parameters_1>;
6041
6042/// A JSON schema object describing the parameters of the function.
6043#[derive(Clone, Debug, Default)]
6044#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6045pub struct FunctionTool_Parameters_1;
6046
6047pub type FunctionTool_Strict = Option<FunctionTool_Strict_1>;
6048
6049/// Whether to enforce strict parameter validation.
6050pub type FunctionTool_Strict_1 = bool;
6051
6052/// Represents the content or the URL of an image generated by the OpenAI API.
6053#[derive(Clone, Debug, Default)]
6054#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6055pub struct Image {
6056    /// The base64-encoded JSON of the generated image.
6057    pub r#b64_json: Option<String>,
6058
6059    /// When using `dall-e-2` or `dall-e-3`, the URL of the generated image if
6060    /// `response_format` is set to `url` (default value).
6061    pub r#url: Option<String>,
6062
6063    /// For `dall-e-3` only, the revised prompt that was used to generate the
6064    /// image.
6065    pub r#revised_prompt: Option<String>,
6066}
6067
6068/// The response from the image generation endpoint.
6069#[derive(Clone, Debug, Default)]
6070#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6071pub struct ImagesResponse {
6072    /// The Unix timestamp (in seconds) of when the image was created.
6073    pub r#created: i64,
6074
6075    /// The list of generated images.
6076    pub r#data: Option<Vec<Image>>,
6077
6078    pub r#usage: Option<ImagesResponse_Usage>,
6079}
6080
6081/// For `gpt-image-1` only, the token usage information for the image
6082/// generation.
6083#[derive(Clone, Debug)]
6084#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6085pub struct ImagesResponse_Usage {
6086    /// The total number of tokens (images and text) used for the image
6087    /// generation.
6088    pub r#total_tokens: i64,
6089
6090    /// The number of tokens (images and text) in the input prompt.
6091    pub r#input_tokens: i64,
6092
6093    /// The number of image tokens in the output image.
6094    pub r#output_tokens: i64,
6095
6096    pub r#input_tokens_details: ImagesResponse_Usage_InputTokensDetails,
6097}
6098
6099/// The input tokens detailed information for the image generation.
6100#[derive(Clone, Debug, Default)]
6101#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6102pub struct ImagesResponse_Usage_InputTokensDetails {
6103    /// The number of text tokens in the input prompt.
6104    pub r#text_tokens: i64,
6105
6106    /// The number of image tokens in the input prompt.
6107    pub r#image_tokens: i64,
6108}
6109
6110/// Specify additional output data to include in the model response.
6111#[derive(Clone, Debug)]
6112#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6113pub enum Includable {
6114    #[cfg_attr(feature = "serde", serde(rename = "file_search_call.results"))]
6115    FileSearchCallResults,
6116
6117    #[cfg_attr(feature = "serde", serde(rename = "message.input_image.image_url"))]
6118    MessageInputImageImageUrl,
6119
6120    #[cfg_attr(feature = "serde", serde(rename = "computer_call_output.output.image_url"))]
6121    ComputerCallOutputOutputImageUrl,
6122
6123    #[cfg_attr(feature = "serde", serde(untagged))]
6124    Other(String),
6125}
6126
6127/// An audio input to the model.
6128#[derive(Clone, Debug, Default)]
6129#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6130pub struct InputAudio {
6131    /// The type of the input item.
6132    pub r#type: String,
6133
6134    /// Base64-encoded audio data.
6135    pub r#data: String,
6136
6137    /// The format of the audio data.
6138    pub r#format: String,
6139}
6140
6141#[derive(Clone, Debug)]
6142#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6143#[cfg_attr(feature = "serde", serde(untagged))]
6144pub enum InputContent {
6145    InputTextContent(InputTextContent),
6146
6147    InputImageContent(InputImageContent),
6148
6149    InputFileContent(InputFileContent),
6150}
6151
6152/// A file input to the model.
6153#[derive(Clone, Debug, Default)]
6154#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6155pub struct InputFileContent {
6156    /// The type of the input item.
6157    pub r#type: String,
6158
6159    pub r#file_id: Option<InputFileContent_FileId>,
6160
6161    /// The name of the file to be sent to the model.
6162    pub r#filename: Option<String>,
6163
6164    /// The content of the file to be sent to the model.
6165    pub r#file_data: Option<String>,
6166}
6167
6168pub type InputFileContent_FileId = Option<String>;
6169
6170/// An image input to the model.
6171#[derive(Clone, Debug, Default)]
6172#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6173pub struct InputImageContent {
6174    /// The type of the input item.
6175    pub r#type: String,
6176
6177    pub r#image_url: Option<InputImageContent_ImageUrl>,
6178
6179    pub r#file_id: Option<InputImageContent_FileId>,
6180
6181    /// The detail level of the image to be sent to the model.
6182    pub r#detail: String,
6183}
6184
6185pub type InputImageContent_FileId = Option<String>;
6186
6187pub type InputImageContent_ImageUrl = Option<String>;
6188
6189#[derive(Clone, Debug)]
6190#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6191#[cfg_attr(feature = "serde", serde(untagged))]
6192pub enum InputItem {
6193    EasyInputMessage(EasyInputMessage),
6194
6195    /// An item representing part of the context for the response to be
6196    /// generated by the model.
6197    Item(Item),
6198
6199    ItemReferenceParam(ItemReferenceParam),
6200}
6201
6202/// A message input to the model with a role indicating instruction following
6203/// hierarchy.
6204#[derive(Clone, Debug)]
6205#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6206pub struct InputMessage {
6207    /// The type of the message input.
6208    pub r#type: Option<String>,
6209
6210    /// The role of the message input.
6211    pub r#role: String,
6212
6213    /// The status of item.
6214    pub r#status: Option<String>,
6215
6216    pub r#content: InputMessageContentList,
6217}
6218
6219/// A list of one or many input items to the model, containing different content
6220/// types.
6221pub type InputMessageContentList = Vec<InputContent>;
6222
6223#[derive(Clone, Debug)]
6224#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6225pub struct InputMessageResource {
6226    /// The type of the message input.
6227    pub r#type: Option<String>,
6228
6229    /// The role of the message input.
6230    pub r#role: String,
6231
6232    /// The status of item.
6233    pub r#status: Option<String>,
6234
6235    pub r#content: InputMessageContentList,
6236
6237    /// The unique ID of the message input.
6238    pub r#id: String,
6239}
6240
6241#[derive(Clone, Debug, Default)]
6242#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6243pub struct InputMessageResource_Variant2 {
6244    /// The unique ID of the message input.
6245    pub r#id: String,
6246}
6247
6248/// A text input to the model.
6249#[derive(Clone, Debug, Default)]
6250#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6251pub struct InputTextContent {
6252    /// The type of the input item.
6253    pub r#type: String,
6254
6255    /// The text input to the model.
6256    pub r#text: String,
6257}
6258
6259/// Represents an individual `invite` to the organization.
6260#[derive(Clone, Debug, Default)]
6261#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6262pub struct Invite {
6263    /// The object type, which is always `organization.invite`
6264    pub r#object: String,
6265
6266    /// The identifier, which can be referenced in API endpoints
6267    pub r#id: String,
6268
6269    /// The email address of the individual to whom the invite was sent
6270    pub r#email: String,
6271
6272    /// `owner` or `reader`
6273    pub r#role: String,
6274
6275    /// `accepted`,`expired`, or `pending`
6276    pub r#status: String,
6277
6278    /// The Unix timestamp (in seconds) of when the invite was sent.
6279    pub r#invited_at: i64,
6280
6281    /// The Unix timestamp (in seconds) of when the invite expires.
6282    pub r#expires_at: i64,
6283
6284    /// The Unix timestamp (in seconds) of when the invite was accepted.
6285    pub r#accepted_at: Option<i64>,
6286
6287    /// The projects that were granted membership upon acceptance of the invite.
6288    pub r#projects: Option<Vec<Invite_Projects>>,
6289}
6290
6291#[derive(Clone, Debug, Default)]
6292#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6293pub struct InviteDeleteResponse {
6294    /// The object type, which is always `organization.invite.deleted`
6295    pub r#object: String,
6296
6297    pub r#id: String,
6298
6299    pub r#deleted: bool,
6300}
6301
6302#[derive(Clone, Debug, Default)]
6303#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6304pub struct InviteListResponse {
6305    /// The object type, which is always `list`
6306    pub r#object: String,
6307
6308    pub r#data: Vec<Invite>,
6309
6310    /// The first `invite_id` in the retrieved `list`
6311    pub r#first_id: Option<String>,
6312
6313    /// The last `invite_id` in the retrieved `list`
6314    pub r#last_id: Option<String>,
6315
6316    /// The `has_more` property is used for pagination to indicate there are
6317    /// additional results.
6318    pub r#has_more: Option<bool>,
6319}
6320
6321#[derive(Clone, Debug, Default)]
6322#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6323pub struct InviteRequest {
6324    /// Send an email to this address
6325    pub r#email: String,
6326
6327    /// `owner` or `reader`
6328    pub r#role: String,
6329
6330    /// An array of projects to which membership is granted at the same time the
6331    /// org invite is accepted.
6332    pub r#projects: Option<Vec<InviteRequest_Projects>>,
6333}
6334
6335#[derive(Clone, Debug, Default)]
6336#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6337pub struct InviteRequest_Projects {
6338    /// Project's public ID
6339    pub r#id: String,
6340
6341    /// Project membership role
6342    pub r#role: String,
6343}
6344
6345#[derive(Clone, Debug, Default)]
6346#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6347pub struct Invite_Projects {
6348    /// Project's public ID
6349    pub r#id: Option<String>,
6350
6351    /// Project membership role
6352    pub r#role: Option<String>,
6353}
6354
6355/// Content item used to generate a response.
6356#[derive(Clone, Debug)]
6357#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6358#[cfg_attr(feature = "serde", serde(untagged))]
6359pub enum Item {
6360    InputMessage(InputMessage),
6361
6362    OutputMessage(OutputMessage),
6363
6364    FileSearchToolCall(FileSearchToolCall),
6365
6366    ComputerToolCall(ComputerToolCall),
6367
6368    ComputerCallOutputItemParam(ComputerCallOutputItemParam),
6369
6370    WebSearchToolCall(WebSearchToolCall),
6371
6372    FunctionToolCall(FunctionToolCall),
6373
6374    FunctionCallOutputItemParam(FunctionCallOutputItemParam),
6375
6376    ReasoningItem(ReasoningItem),
6377}
6378
6379/// An internal identifier for an item to reference.
6380#[derive(Clone, Debug, Default)]
6381#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6382pub struct ItemReferenceParam {
6383    pub r#type: Option<ItemReferenceParam_Type>,
6384
6385    /// The ID of the item to reference.
6386    pub r#id: String,
6387}
6388
6389pub type ItemReferenceParam_Type = Option<String>;
6390
6391/// Content item used to generate a response.
6392#[derive(Clone, Debug)]
6393#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6394#[cfg_attr(feature = "serde", serde(untagged))]
6395pub enum ItemResource {
6396    InputMessageResource(InputMessageResource),
6397
6398    OutputMessage(OutputMessage),
6399
6400    FileSearchToolCall(FileSearchToolCall),
6401
6402    ComputerToolCall(ComputerToolCall),
6403
6404    ComputerToolCallOutputResource(ComputerToolCallOutputResource),
6405
6406    WebSearchToolCall(WebSearchToolCall),
6407
6408    FunctionToolCallResource(FunctionToolCallResource),
6409
6410    FunctionToolCallOutputResource(FunctionToolCallOutputResource),
6411}
6412
6413/// A collection of keypresses the model would like to perform.
6414#[derive(Clone, Debug, Default)]
6415#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6416pub struct KeyPress {
6417    /// Specifies the event type.
6418    pub r#type: String,
6419
6420    /// The combination of keys the model is requesting to be pressed.
6421    pub r#keys: Vec<String>,
6422}
6423
6424#[derive(Clone, Debug, Default)]
6425#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6426pub struct ListAssistantsResponse {
6427    pub r#object: String,
6428
6429    pub r#data: Vec<AssistantObject>,
6430
6431    pub r#first_id: String,
6432
6433    pub r#last_id: String,
6434
6435    pub r#has_more: bool,
6436}
6437
6438#[derive(Clone, Debug, Default)]
6439#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6440pub struct ListAuditLogsResponse {
6441    pub r#object: String,
6442
6443    pub r#data: Vec<AuditLog>,
6444
6445    pub r#first_id: String,
6446
6447    pub r#last_id: String,
6448
6449    pub r#has_more: bool,
6450}
6451
6452#[derive(Clone, Debug, Default)]
6453#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6454pub struct ListBatchesResponse {
6455    pub r#data: Vec<Batch>,
6456
6457    pub r#first_id: Option<String>,
6458
6459    pub r#last_id: Option<String>,
6460
6461    pub r#has_more: bool,
6462
6463    pub r#object: String,
6464}
6465
6466#[derive(Clone, Debug, Default)]
6467#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6468pub struct ListCertificatesResponse {
6469    pub r#data: Vec<Certificate>,
6470
6471    pub r#first_id: Option<String>,
6472
6473    pub r#last_id: Option<String>,
6474
6475    pub r#has_more: bool,
6476
6477    pub r#object: String,
6478}
6479
6480#[derive(Clone, Debug, Default)]
6481#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6482pub struct ListFilesResponse {
6483    pub r#object: String,
6484
6485    pub r#data: Vec<OpenAIFile>,
6486
6487    pub r#first_id: String,
6488
6489    pub r#last_id: String,
6490
6491    pub r#has_more: bool,
6492}
6493
6494#[derive(Clone, Debug, Default)]
6495#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6496pub struct ListFineTuningCheckpointPermissionResponse {
6497    pub r#data: Vec<FineTuningCheckpointPermission>,
6498
6499    pub r#object: String,
6500
6501    pub r#first_id: Option<String>,
6502
6503    pub r#last_id: Option<String>,
6504
6505    pub r#has_more: bool,
6506}
6507
6508#[derive(Clone, Debug, Default)]
6509#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6510pub struct ListFineTuningJobCheckpointsResponse {
6511    pub r#data: Vec<FineTuningJobCheckpoint>,
6512
6513    pub r#object: String,
6514
6515    pub r#first_id: Option<String>,
6516
6517    pub r#last_id: Option<String>,
6518
6519    pub r#has_more: bool,
6520}
6521
6522#[derive(Clone, Debug, Default)]
6523#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6524pub struct ListFineTuningJobEventsResponse {
6525    pub r#data: Vec<FineTuningJobEvent>,
6526
6527    pub r#object: String,
6528
6529    pub r#has_more: bool,
6530}
6531
6532#[derive(Clone, Debug, Default)]
6533#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6534pub struct ListMessagesResponse {
6535    pub r#object: String,
6536
6537    pub r#data: Vec<MessageObject>,
6538
6539    pub r#first_id: String,
6540
6541    pub r#last_id: String,
6542
6543    pub r#has_more: bool,
6544}
6545
6546#[derive(Clone, Debug, Default)]
6547#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6548pub struct ListModelsResponse {
6549    pub r#object: String,
6550
6551    pub r#data: Vec<Model>,
6552}
6553
6554#[derive(Clone, Debug, Default)]
6555#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6556pub struct ListPaginatedFineTuningJobsResponse {
6557    pub r#data: Vec<FineTuningJob>,
6558
6559    pub r#has_more: bool,
6560
6561    pub r#object: String,
6562}
6563
6564#[derive(Clone, Debug, Default)]
6565#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6566pub struct ListRunStepsResponse {
6567    pub r#object: String,
6568
6569    pub r#data: Vec<RunStepObject>,
6570
6571    pub r#first_id: String,
6572
6573    pub r#last_id: String,
6574
6575    pub r#has_more: bool,
6576}
6577
6578#[derive(Clone, Debug, Default)]
6579#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6580pub struct ListRunsResponse {
6581    pub r#object: String,
6582
6583    pub r#data: Vec<RunObject>,
6584
6585    pub r#first_id: String,
6586
6587    pub r#last_id: String,
6588
6589    pub r#has_more: bool,
6590}
6591
6592#[derive(Clone, Debug, Default)]
6593#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6594pub struct ListVectorStoreFilesResponse {
6595    pub r#object: String,
6596
6597    pub r#data: Vec<VectorStoreFileObject>,
6598
6599    pub r#first_id: String,
6600
6601    pub r#last_id: String,
6602
6603    pub r#has_more: bool,
6604}
6605
6606#[derive(Clone, Debug, Default)]
6607#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6608pub struct ListVectorStoresResponse {
6609    pub r#object: String,
6610
6611    pub r#data: Vec<VectorStoreObject>,
6612
6613    pub r#first_id: String,
6614
6615    pub r#last_id: String,
6616
6617    pub r#has_more: bool,
6618}
6619
6620/// A log probability object.
6621#[derive(Clone, Debug, Default)]
6622#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6623pub struct LogProbProperties {
6624    /// The token that was used to generate the log probability.
6625    pub r#token: String,
6626
6627    /// The log probability of the token.
6628    pub r#logprob: f64,
6629
6630    /// The bytes that were used to generate the log probability.
6631    pub r#bytes: Vec<i64>,
6632}
6633
6634/// References an image [File](/docs/api-reference/files) in the content of a
6635/// message.
6636#[derive(Clone, Debug)]
6637#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6638pub struct MessageContentImageFileObject {
6639    /// Always `image_file`.
6640    pub r#type: String,
6641
6642    pub r#image_file: MessageContentImageFileObject_ImageFile,
6643}
6644
6645#[derive(Clone, Debug, Default)]
6646#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6647pub struct MessageContentImageFileObject_ImageFile {
6648    /// The [File](/docs/api-reference/files) ID of the image in the message
6649    /// content.
6650    pub r#file_id: String,
6651
6652    /// Specifies the detail level of the image if specified by the user.
6653    pub r#detail: Option<String>,
6654}
6655
6656/// References an image URL in the content of a message.
6657#[derive(Clone, Debug)]
6658#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6659pub struct MessageContentImageUrlObject {
6660    /// The type of the content part.
6661    pub r#type: String,
6662
6663    pub r#image_url: MessageContentImageUrlObject_ImageUrl,
6664}
6665
6666#[derive(Clone, Debug, Default)]
6667#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6668pub struct MessageContentImageUrlObject_ImageUrl {
6669    /// The external URL of the image, must be a supported image types: jpeg,
6670    /// jpg, png, gif, webp.
6671    pub r#url: String,
6672
6673    /// Specifies the detail level of the image.
6674    pub r#detail: Option<String>,
6675}
6676
6677/// The refusal content generated by the assistant.
6678#[derive(Clone, Debug, Default)]
6679#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6680pub struct MessageContentRefusalObject {
6681    /// Always `refusal`.
6682    pub r#type: String,
6683
6684    pub r#refusal: String,
6685}
6686
6687/// A citation within the message that points to a specific quote from a
6688/// specific File associated with the assistant or the message.
6689#[derive(Clone, Debug)]
6690#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6691pub struct MessageContentTextAnnotationsFileCitationObject {
6692    /// Always `file_citation`.
6693    pub r#type: String,
6694
6695    /// The text in the message content that needs to be replaced.
6696    pub r#text: String,
6697
6698    pub r#file_citation: MessageContentTextAnnotationsFileCitationObject_FileCitation,
6699
6700    pub r#start_index: i64,
6701
6702    pub r#end_index: i64,
6703}
6704
6705#[derive(Clone, Debug, Default)]
6706#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6707pub struct MessageContentTextAnnotationsFileCitationObject_FileCitation {
6708    /// The ID of the specific File the citation is from.
6709    pub r#file_id: String,
6710}
6711
6712/// A URL for the file that's generated when the assistant used the
6713/// `code_interpreter` tool to generate a file.
6714#[derive(Clone, Debug)]
6715#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6716pub struct MessageContentTextAnnotationsFilePathObject {
6717    /// Always `file_path`.
6718    pub r#type: String,
6719
6720    /// The text in the message content that needs to be replaced.
6721    pub r#text: String,
6722
6723    pub r#file_path: MessageContentTextAnnotationsFilePathObject_FilePath,
6724
6725    pub r#start_index: i64,
6726
6727    pub r#end_index: i64,
6728}
6729
6730#[derive(Clone, Debug, Default)]
6731#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6732pub struct MessageContentTextAnnotationsFilePathObject_FilePath {
6733    /// The ID of the file that was generated.
6734    pub r#file_id: String,
6735}
6736
6737/// The text content that is part of a message.
6738#[derive(Clone, Debug)]
6739#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6740pub struct MessageContentTextObject {
6741    /// Always `text`.
6742    pub r#type: String,
6743
6744    pub r#text: MessageContentTextObject_Text,
6745}
6746
6747#[derive(Clone, Debug, Default)]
6748#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6749pub struct MessageContentTextObject_Text {
6750    /// The data that makes up the text.
6751    pub r#value: String,
6752
6753    pub r#annotations: Vec<MessageContentTextObject_Text_Annotations>,
6754}
6755
6756#[derive(Clone, Debug)]
6757#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6758#[cfg_attr(feature = "serde", serde(untagged))]
6759pub enum MessageContentTextObject_Text_Annotations {
6760    MessageContentTextAnnotationsFileCitationObject(MessageContentTextAnnotationsFileCitationObject),
6761
6762    MessageContentTextAnnotationsFilePathObject(MessageContentTextAnnotationsFilePathObject),
6763}
6764
6765/// References an image [File](/docs/api-reference/files) in the content of a
6766/// message.
6767#[derive(Clone, Debug, Default)]
6768#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6769pub struct MessageDeltaContentImageFileObject {
6770    /// The index of the content part in the message.
6771    pub r#index: i64,
6772
6773    /// Always `image_file`.
6774    pub r#type: String,
6775
6776    pub r#image_file: Option<MessageDeltaContentImageFileObject_ImageFile>,
6777}
6778
6779#[derive(Clone, Debug, Default)]
6780#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6781pub struct MessageDeltaContentImageFileObject_ImageFile {
6782    /// The [File](/docs/api-reference/files) ID of the image in the message
6783    /// content.
6784    pub r#file_id: Option<String>,
6785
6786    /// Specifies the detail level of the image if specified by the user.
6787    pub r#detail: Option<String>,
6788}
6789
6790/// References an image URL in the content of a message.
6791#[derive(Clone, Debug, Default)]
6792#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6793pub struct MessageDeltaContentImageUrlObject {
6794    /// The index of the content part in the message.
6795    pub r#index: i64,
6796
6797    /// Always `image_url`.
6798    pub r#type: String,
6799
6800    pub r#image_url: Option<MessageDeltaContentImageUrlObject_ImageUrl>,
6801}
6802
6803#[derive(Clone, Debug, Default)]
6804#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6805pub struct MessageDeltaContentImageUrlObject_ImageUrl {
6806    /// The URL of the image, must be a supported image types: jpeg, jpg, png,
6807    /// gif, webp.
6808    pub r#url: Option<String>,
6809
6810    /// Specifies the detail level of the image.
6811    pub r#detail: Option<String>,
6812}
6813
6814/// The refusal content that is part of a message.
6815#[derive(Clone, Debug, Default)]
6816#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6817pub struct MessageDeltaContentRefusalObject {
6818    /// The index of the refusal part in the message.
6819    pub r#index: i64,
6820
6821    /// Always `refusal`.
6822    pub r#type: String,
6823
6824    pub r#refusal: Option<String>,
6825}
6826
6827/// A citation within the message that points to a specific quote from a
6828/// specific File associated with the assistant or the message.
6829#[derive(Clone, Debug, Default)]
6830#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6831pub struct MessageDeltaContentTextAnnotationsFileCitationObject {
6832    /// The index of the annotation in the text content part.
6833    pub r#index: i64,
6834
6835    /// Always `file_citation`.
6836    pub r#type: String,
6837
6838    /// The text in the message content that needs to be replaced.
6839    pub r#text: Option<String>,
6840
6841    pub r#file_citation: Option<MessageDeltaContentTextAnnotationsFileCitationObject_FileCitation>,
6842
6843    pub r#start_index: Option<i64>,
6844
6845    pub r#end_index: Option<i64>,
6846}
6847
6848#[derive(Clone, Debug, Default)]
6849#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6850pub struct MessageDeltaContentTextAnnotationsFileCitationObject_FileCitation {
6851    /// The ID of the specific File the citation is from.
6852    pub r#file_id: Option<String>,
6853
6854    /// The specific quote in the file.
6855    pub r#quote: Option<String>,
6856}
6857
6858/// A URL for the file that's generated when the assistant used the
6859/// `code_interpreter` tool to generate a file.
6860#[derive(Clone, Debug, Default)]
6861#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6862pub struct MessageDeltaContentTextAnnotationsFilePathObject {
6863    /// The index of the annotation in the text content part.
6864    pub r#index: i64,
6865
6866    /// Always `file_path`.
6867    pub r#type: String,
6868
6869    /// The text in the message content that needs to be replaced.
6870    pub r#text: Option<String>,
6871
6872    pub r#file_path: Option<MessageDeltaContentTextAnnotationsFilePathObject_FilePath>,
6873
6874    pub r#start_index: Option<i64>,
6875
6876    pub r#end_index: Option<i64>,
6877}
6878
6879#[derive(Clone, Debug, Default)]
6880#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6881pub struct MessageDeltaContentTextAnnotationsFilePathObject_FilePath {
6882    /// The ID of the file that was generated.
6883    pub r#file_id: Option<String>,
6884}
6885
6886/// The text content that is part of a message.
6887#[derive(Clone, Debug, Default)]
6888#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6889pub struct MessageDeltaContentTextObject {
6890    /// The index of the content part in the message.
6891    pub r#index: i64,
6892
6893    /// Always `text`.
6894    pub r#type: String,
6895
6896    pub r#text: Option<MessageDeltaContentTextObject_Text>,
6897}
6898
6899#[derive(Clone, Debug, Default)]
6900#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6901pub struct MessageDeltaContentTextObject_Text {
6902    /// The data that makes up the text.
6903    pub r#value: Option<String>,
6904
6905    pub r#annotations: Option<Vec<MessageDeltaContentTextObject_Text_Annotations>>,
6906}
6907
6908#[derive(Clone, Debug)]
6909#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6910#[cfg_attr(feature = "serde", serde(untagged))]
6911pub enum MessageDeltaContentTextObject_Text_Annotations {
6912    MessageDeltaContentTextAnnotationsFileCitationObject(MessageDeltaContentTextAnnotationsFileCitationObject),
6913
6914    MessageDeltaContentTextAnnotationsFilePathObject(MessageDeltaContentTextAnnotationsFilePathObject),
6915}
6916
6917/// Represents a message delta i.e.
6918#[derive(Clone, Debug)]
6919#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6920pub struct MessageDeltaObject {
6921    /// The identifier of the message, which can be referenced in API endpoints.
6922    pub r#id: String,
6923
6924    /// The object type, which is always `thread.message.delta`.
6925    pub r#object: String,
6926
6927    pub r#delta: MessageDeltaObject_Delta,
6928}
6929
6930/// The delta containing the fields that have changed on the Message.
6931#[derive(Clone, Debug, Default)]
6932#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6933pub struct MessageDeltaObject_Delta {
6934    /// The entity that produced the message.
6935    pub r#role: Option<String>,
6936
6937    /// The content of the message in array of text and/or images.
6938    pub r#content: Option<Vec<MessageDeltaObject_Delta_Content>>,
6939}
6940
6941#[derive(Clone, Debug)]
6942#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6943#[cfg_attr(feature = "serde", serde(untagged))]
6944pub enum MessageDeltaObject_Delta_Content {
6945    MessageDeltaContentImageFileObject(MessageDeltaContentImageFileObject),
6946
6947    MessageDeltaContentTextObject(MessageDeltaContentTextObject),
6948
6949    MessageDeltaContentRefusalObject(MessageDeltaContentRefusalObject),
6950
6951    MessageDeltaContentImageUrlObject(MessageDeltaContentImageUrlObject),
6952}
6953
6954/// Represents a message within a [thread](/docs/api-reference/threads).
6955#[derive(Clone, Debug, Default)]
6956#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6957pub struct MessageObject {
6958    /// The identifier, which can be referenced in API endpoints.
6959    pub r#id: String,
6960
6961    /// The object type, which is always `thread.message`.
6962    pub r#object: String,
6963
6964    /// The Unix timestamp (in seconds) for when the message was created.
6965    pub r#created_at: i64,
6966
6967    /// The [thread](/docs/api-reference/threads) ID that this message belongs
6968    /// to.
6969    pub r#thread_id: String,
6970
6971    /// The status of the message, which can be either `in_progress`,
6972    /// `incomplete`, or `completed`.
6973    pub r#status: String,
6974
6975    pub r#incomplete_details: Option<MessageObject_IncompleteDetails>,
6976
6977    /// The Unix timestamp (in seconds) for when the message was completed.
6978    pub r#completed_at: Option<i64>,
6979
6980    /// The Unix timestamp (in seconds) for when the message was marked as
6981    /// incomplete.
6982    pub r#incomplete_at: Option<i64>,
6983
6984    /// The entity that produced the message.
6985    pub r#role: String,
6986
6987    /// The content of the message in array of text and/or images.
6988    pub r#content: Vec<MessageObject_Content>,
6989
6990    /// If applicable, the ID of the [assistant](/docs/api-reference/assistants)
6991    /// that authored this message.
6992    pub r#assistant_id: Option<String>,
6993
6994    /// The ID of the [run](/docs/api-reference/runs) associated with the
6995    /// creation of this message.
6996    pub r#run_id: Option<String>,
6997
6998    /// A list of files attached to the message, and the tools they were added
6999    /// to.
7000    pub r#attachments: Option<Vec<MessageObject_Attachments>>,
7001
7002    pub r#metadata: Option<Metadata>,
7003}
7004
7005#[derive(Clone, Debug, Default)]
7006#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7007pub struct MessageObject_Attachments {
7008    /// The ID of the file to attach to the message.
7009    pub r#file_id: Option<String>,
7010
7011    /// The tools to add this file to.
7012    pub r#tools: Option<Vec<MessageObject_Attachments_Tools>>,
7013}
7014
7015#[derive(Clone, Debug)]
7016#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7017#[cfg_attr(feature = "serde", serde(untagged))]
7018pub enum MessageObject_Attachments_Tools {
7019    AssistantToolsCode(AssistantToolsCode),
7020
7021    AssistantToolsFileSearchTypeOnly(AssistantToolsFileSearchTypeOnly),
7022}
7023
7024#[derive(Clone, Debug)]
7025#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7026#[cfg_attr(feature = "serde", serde(untagged))]
7027pub enum MessageObject_Content {
7028    MessageContentImageFileObject(MessageContentImageFileObject),
7029
7030    MessageContentImageUrlObject(MessageContentImageUrlObject),
7031
7032    MessageContentTextObject(MessageContentTextObject),
7033
7034    MessageContentRefusalObject(MessageContentRefusalObject),
7035}
7036
7037/// On an incomplete message, details about why the message is incomplete.
7038#[derive(Clone, Debug, Default)]
7039#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7040pub struct MessageObject_IncompleteDetails {
7041    /// The reason the message is incomplete.
7042    pub r#reason: String,
7043}
7044
7045/// The text content that is part of a message.
7046#[derive(Clone, Debug, Default)]
7047#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7048pub struct MessageRequestContentTextObject {
7049    /// Always `text`.
7050    pub r#type: String,
7051
7052    /// Text content to be sent to the model
7053    pub r#text: String,
7054}
7055
7056include!("schemas/message_stream_event.rs");
7057
7058/// Occurs when a [message](/docs/api-reference/messages/object) is created.
7059#[derive(Clone, Debug)]
7060#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7061pub struct MessageStreamEvent_Variant1 {
7062    pub r#event: String,
7063
7064    pub r#data: MessageObject,
7065}
7066
7067/// Occurs when a [message](/docs/api-reference/messages/object) moves to an
7068/// `in_progress` state.
7069#[derive(Clone, Debug)]
7070#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7071pub struct MessageStreamEvent_Variant2 {
7072    pub r#event: String,
7073
7074    pub r#data: MessageObject,
7075}
7076
7077/// Occurs when parts of a [Message](/docs/api-reference/messages/object) are
7078/// being streamed.
7079#[derive(Clone, Debug)]
7080#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7081pub struct MessageStreamEvent_Variant3 {
7082    pub r#event: String,
7083
7084    pub r#data: MessageDeltaObject,
7085}
7086
7087/// Occurs when a [message](/docs/api-reference/messages/object) is completed.
7088#[derive(Clone, Debug)]
7089#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7090pub struct MessageStreamEvent_Variant4 {
7091    pub r#event: String,
7092
7093    pub r#data: MessageObject,
7094}
7095
7096/// Occurs when a [message](/docs/api-reference/messages/object) ends before it
7097/// is completed.
7098#[derive(Clone, Debug)]
7099#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7100pub struct MessageStreamEvent_Variant5 {
7101    pub r#event: String,
7102
7103    pub r#data: MessageObject,
7104}
7105
7106/// Set of 16 key-value pairs that can be attached to an object.
7107#[derive(Clone, Debug, Default)]
7108#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7109pub struct Metadata;
7110
7111/// Describes an OpenAI model offering that can be used with the API.
7112#[derive(Clone, Debug, Default)]
7113#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7114pub struct Model {
7115    /// The model identifier, which can be referenced in the API endpoints.
7116    pub r#id: String,
7117
7118    /// The Unix timestamp (in seconds) when the model was created.
7119    pub r#created: i64,
7120
7121    /// The object type, which is always "model".
7122    pub r#object: String,
7123
7124    /// The organization that owns the model.
7125    pub r#owned_by: String,
7126}
7127
7128#[derive(Clone, Debug)]
7129#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7130#[cfg_attr(feature = "serde", serde(untagged))]
7131pub enum ModelIds {
7132    ModelIdsShared(ModelIdsShared),
7133
7134    ModelIdsResponses(ModelIdsResponses),
7135}
7136
7137#[derive(Clone, Debug)]
7138#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7139#[cfg_attr(feature = "serde", serde(untagged))]
7140pub enum ModelIdsResponses {
7141    ModelIdsShared(ModelIdsShared),
7142
7143    Text(String),
7144}
7145
7146pub type ModelIdsShared = String;
7147
7148#[derive(Clone, Debug, Default)]
7149#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7150pub struct ModelResponseProperties {
7151    pub r#metadata: Option<Metadata>,
7152
7153    /// What sampling temperature to use, between 0 and 2.
7154    pub r#temperature: Option<f64>,
7155
7156    /// An alternative to sampling with temperature, called nucleus sampling,
7157    /// where the model considers the results of the tokens with top_p
7158    /// probability mass.
7159    pub r#top_p: Option<f64>,
7160
7161    /// A unique identifier representing your end-user, which can help OpenAI to
7162    /// monitor and detect abuse.
7163    pub r#user: Option<String>,
7164
7165    pub r#service_tier: Option<ServiceTier>,
7166}
7167
7168#[derive(Clone, Debug, Default)]
7169#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7170pub struct ModifyAssistantRequest {
7171    pub r#model: Option<ModifyAssistantRequest_Model>,
7172
7173    pub r#reasoning_effort: Option<ReasoningEffort>,
7174
7175    /// The name of the assistant.
7176    pub r#name: Option<String>,
7177
7178    /// The description of the assistant.
7179    pub r#description: Option<String>,
7180
7181    /// The system instructions that the assistant uses.
7182    pub r#instructions: Option<String>,
7183
7184    /// A list of tool enabled on the assistant.
7185    pub r#tools: Option<Vec<ModifyAssistantRequest_Tools>>,
7186
7187    pub r#tool_resources: Option<ModifyAssistantRequest_ToolResources>,
7188
7189    pub r#metadata: Option<Metadata>,
7190
7191    /// What sampling temperature to use, between 0 and 2.
7192    pub r#temperature: Option<f64>,
7193
7194    /// An alternative to sampling with temperature, called nucleus sampling,
7195    /// where the model considers the results of the tokens with top_p
7196    /// probability mass.
7197    pub r#top_p: Option<f64>,
7198
7199    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
7200}
7201
7202/// ID of the model to use.
7203#[derive(Clone, Debug)]
7204#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7205#[cfg_attr(feature = "serde", serde(untagged))]
7206pub enum ModifyAssistantRequest_Model {
7207    Text(String),
7208
7209    AssistantSupportedModels(AssistantSupportedModels),
7210}
7211
7212/// A set of resources that are used by the assistant's tools.
7213#[derive(Clone, Debug, Default)]
7214#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7215pub struct ModifyAssistantRequest_ToolResources {
7216    pub r#code_interpreter: Option<ModifyAssistantRequest_ToolResources_CodeInterpreter>,
7217
7218    pub r#file_search: Option<ModifyAssistantRequest_ToolResources_FileSearch>,
7219}
7220
7221#[derive(Clone, Debug, Default)]
7222#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7223pub struct ModifyAssistantRequest_ToolResources_CodeInterpreter {
7224    /// Overrides the list of [file](/docs/api-reference/files) IDs made
7225    /// available to the `code_interpreter` tool.
7226    pub r#file_ids: Option<Vec<String>>,
7227}
7228
7229#[derive(Clone, Debug, Default)]
7230#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7231pub struct ModifyAssistantRequest_ToolResources_FileSearch {
7232    /// Overrides the [vector store](/docs/api-reference/vector-stores/object)
7233    /// attached to this assistant.
7234    pub r#vector_store_ids: Option<Vec<String>>,
7235}
7236
7237#[derive(Clone, Debug)]
7238#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7239#[cfg_attr(feature = "serde", serde(untagged))]
7240pub enum ModifyAssistantRequest_Tools {
7241    AssistantToolsCode(AssistantToolsCode),
7242
7243    AssistantToolsFileSearch(AssistantToolsFileSearch),
7244
7245    AssistantToolsFunction(AssistantToolsFunction),
7246}
7247
7248#[derive(Clone, Debug, Default)]
7249#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7250pub struct ModifyCertificateRequest {
7251    /// The updated name for the certificate
7252    pub r#name: String,
7253}
7254
7255#[derive(Clone, Debug, Default)]
7256#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7257pub struct ModifyMessageRequest {
7258    pub r#metadata: Option<Metadata>,
7259}
7260
7261#[derive(Clone, Debug, Default)]
7262#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7263pub struct ModifyRunRequest {
7264    pub r#metadata: Option<Metadata>,
7265}
7266
7267#[derive(Clone, Debug, Default)]
7268#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7269pub struct ModifyThreadRequest {
7270    pub r#tool_resources: Option<ModifyThreadRequest_ToolResources>,
7271
7272    pub r#metadata: Option<Metadata>,
7273}
7274
7275/// A set of resources that are made available to the assistant's tools in this
7276/// thread.
7277#[derive(Clone, Debug, Default)]
7278#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7279pub struct ModifyThreadRequest_ToolResources {
7280    pub r#code_interpreter: Option<ModifyThreadRequest_ToolResources_CodeInterpreter>,
7281
7282    pub r#file_search: Option<ModifyThreadRequest_ToolResources_FileSearch>,
7283}
7284
7285#[derive(Clone, Debug, Default)]
7286#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7287pub struct ModifyThreadRequest_ToolResources_CodeInterpreter {
7288    /// A list of [file](/docs/api-reference/files) IDs made available to the
7289    /// `code_interpreter` tool.
7290    pub r#file_ids: Option<Vec<String>>,
7291}
7292
7293#[derive(Clone, Debug, Default)]
7294#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7295pub struct ModifyThreadRequest_ToolResources_FileSearch {
7296    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
7297    /// this thread.
7298    pub r#vector_store_ids: Option<Vec<String>>,
7299}
7300
7301/// A mouse move action.
7302#[derive(Clone, Debug, Default)]
7303#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7304pub struct Move {
7305    /// Specifies the event type.
7306    pub r#type: String,
7307
7308    /// The x-coordinate to move to.
7309    pub r#x: i64,
7310
7311    /// The y-coordinate to move to.
7312    pub r#y: i64,
7313}
7314
7315/// The `File` object represents a document that has been uploaded to OpenAI.
7316#[derive(Clone, Debug, Default)]
7317#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7318pub struct OpenAIFile {
7319    /// The file identifier, which can be referenced in the API endpoints.
7320    pub r#id: String,
7321
7322    /// The size of the file, in bytes.
7323    pub r#bytes: i64,
7324
7325    /// The Unix timestamp (in seconds) for when the file was created.
7326    pub r#created_at: i64,
7327
7328    /// The Unix timestamp (in seconds) for when the file will expire.
7329    pub r#expires_at: Option<i64>,
7330
7331    /// The name of the file.
7332    pub r#filename: String,
7333
7334    /// The object type, which is always `file`.
7335    pub r#object: String,
7336
7337    /// The intended purpose of the file.
7338    pub r#purpose: String,
7339
7340    /// Deprecated.
7341    pub r#status: String,
7342
7343    /// Deprecated.
7344    pub r#status_details: Option<String>,
7345}
7346
7347/// This is returned when the chunking strategy is unknown.
7348#[derive(Clone, Debug, Default)]
7349#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7350pub struct OtherChunkingStrategyResponseParam {
7351    /// Always `other`.
7352    pub r#type: String,
7353}
7354
7355/// An audio output from the model.
7356#[derive(Clone, Debug, Default)]
7357#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7358pub struct OutputAudio {
7359    /// The type of the output audio.
7360    pub r#type: String,
7361
7362    /// Base64-encoded audio data from the model.
7363    pub r#data: String,
7364
7365    /// The transcript of the audio data from the model.
7366    pub r#transcript: String,
7367}
7368
7369#[derive(Clone, Debug)]
7370#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7371#[cfg_attr(feature = "serde", serde(untagged))]
7372pub enum OutputContent {
7373    OutputTextContent(OutputTextContent),
7374
7375    RefusalContent(RefusalContent),
7376}
7377
7378#[derive(Clone, Debug)]
7379#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7380#[cfg_attr(feature = "serde", serde(untagged))]
7381pub enum OutputItem {
7382    OutputMessage(OutputMessage),
7383
7384    FileSearchToolCall(FileSearchToolCall),
7385
7386    FunctionToolCall(FunctionToolCall),
7387
7388    WebSearchToolCall(WebSearchToolCall),
7389
7390    ComputerToolCall(ComputerToolCall),
7391
7392    ReasoningItem(ReasoningItem),
7393}
7394
7395/// An output message from the model.
7396#[derive(Clone, Debug, Default)]
7397#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7398pub struct OutputMessage {
7399    /// The unique ID of the output message.
7400    pub r#id: String,
7401
7402    /// The type of the output message.
7403    pub r#type: String,
7404
7405    /// The role of the output message.
7406    pub r#role: String,
7407
7408    /// The content of the output message.
7409    pub r#content: Vec<OutputContent>,
7410
7411    /// The status of the message input.
7412    pub r#status: String,
7413}
7414
7415/// A text output from the model.
7416#[derive(Clone, Debug, Default)]
7417#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7418pub struct OutputTextContent {
7419    /// The type of the output text.
7420    pub r#type: String,
7421
7422    /// The text output from the model.
7423    pub r#text: String,
7424
7425    /// The annotations of the text output.
7426    pub r#annotations: Vec<Annotation>,
7427}
7428
7429/// Whether to enable [parallel function
7430/// calling](/docs/guides/function-calling#configuring-parallel-function-calling)
7431/// during tool use.
7432pub type ParallelToolCalls = bool;
7433
7434/// Static predicted output content, such as the content of a text file that is
7435/// being regenerated.
7436#[derive(Clone, Debug)]
7437#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7438pub struct PredictionContent {
7439    /// The type of the predicted content you want to provide.
7440    pub r#type: String,
7441
7442    pub r#content: PredictionContent_Content,
7443}
7444
7445/// The content that should be matched when generating a model response.
7446#[derive(Clone, Debug)]
7447#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7448#[cfg_attr(feature = "serde", serde(untagged))]
7449pub enum PredictionContent_Content {
7450    /// The content used for a Predicted Output.
7451    Text(String),
7452
7453    /// An array of content parts with a defined type.
7454    Array(Vec<ChatCompletionRequestMessageContentPartText>),
7455}
7456
7457/// Represents an individual project.
7458#[derive(Clone, Debug, Default)]
7459#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7460pub struct Project {
7461    /// The identifier, which can be referenced in API endpoints
7462    pub r#id: String,
7463
7464    /// The object type, which is always `organization.project`
7465    pub r#object: String,
7466
7467    /// The name of the project.
7468    pub r#name: String,
7469
7470    /// The Unix timestamp (in seconds) of when the project was created.
7471    pub r#created_at: i64,
7472
7473    /// The Unix timestamp (in seconds) of when the project was archived or
7474    /// `null`.
7475    pub r#archived_at: Option<i64>,
7476
7477    /// `active` or `archived`
7478    pub r#status: String,
7479}
7480
7481/// Represents an individual API key in a project.
7482#[derive(Clone, Debug)]
7483#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7484pub struct ProjectApiKey {
7485    /// The object type, which is always `organization.project.api_key`
7486    pub r#object: String,
7487
7488    /// The redacted value of the API key
7489    pub r#redacted_value: String,
7490
7491    /// The name of the API key
7492    pub r#name: String,
7493
7494    /// The Unix timestamp (in seconds) of when the API key was created
7495    pub r#created_at: i64,
7496
7497    /// The Unix timestamp (in seconds) of when the API key was last used.
7498    pub r#last_used_at: i64,
7499
7500    /// The identifier, which can be referenced in API endpoints
7501    pub r#id: String,
7502
7503    pub r#owner: ProjectApiKey_Owner,
7504}
7505
7506#[derive(Clone, Debug, Default)]
7507#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7508pub struct ProjectApiKeyDeleteResponse {
7509    pub r#object: String,
7510
7511    pub r#id: String,
7512
7513    pub r#deleted: bool,
7514}
7515
7516#[derive(Clone, Debug, Default)]
7517#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7518pub struct ProjectApiKeyListResponse {
7519    pub r#object: String,
7520
7521    pub r#data: Vec<ProjectApiKey>,
7522
7523    pub r#first_id: String,
7524
7525    pub r#last_id: String,
7526
7527    pub r#has_more: bool,
7528}
7529
7530#[derive(Clone, Debug, Default)]
7531#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7532pub struct ProjectApiKey_Owner {
7533    /// `user` or `service_account`
7534    pub r#type: Option<String>,
7535
7536    pub r#user: Option<ProjectUser>,
7537
7538    pub r#service_account: Option<ProjectServiceAccount>,
7539}
7540
7541#[derive(Clone, Debug, Default)]
7542#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7543pub struct ProjectCreateRequest {
7544    /// The friendly name of the project, this name appears in reports.
7545    pub r#name: String,
7546}
7547
7548#[derive(Clone, Debug, Default)]
7549#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7550pub struct ProjectListResponse {
7551    pub r#object: String,
7552
7553    pub r#data: Vec<Project>,
7554
7555    pub r#first_id: String,
7556
7557    pub r#last_id: String,
7558
7559    pub r#has_more: bool,
7560}
7561
7562/// Represents a project rate limit config.
7563#[derive(Clone, Debug, Default)]
7564#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7565pub struct ProjectRateLimit {
7566    /// The object type, which is always `project.rate_limit`
7567    pub r#object: String,
7568
7569    /// The identifier, which can be referenced in API endpoints.
7570    pub r#id: String,
7571
7572    /// The model this rate limit applies to.
7573    pub r#model: String,
7574
7575    /// The maximum requests per minute.
7576    pub r#max_requests_per_1_minute: i64,
7577
7578    /// The maximum tokens per minute.
7579    pub r#max_tokens_per_1_minute: i64,
7580
7581    /// The maximum images per minute.
7582    pub r#max_images_per_1_minute: Option<i64>,
7583
7584    /// The maximum audio megabytes per minute.
7585    pub r#max_audio_megabytes_per_1_minute: Option<i64>,
7586
7587    /// The maximum requests per day.
7588    pub r#max_requests_per_1_day: Option<i64>,
7589
7590    /// The maximum batch input tokens per day.
7591    pub r#batch_1_day_max_input_tokens: Option<i64>,
7592}
7593
7594#[derive(Clone, Debug, Default)]
7595#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7596pub struct ProjectRateLimitListResponse {
7597    pub r#object: String,
7598
7599    pub r#data: Vec<ProjectRateLimit>,
7600
7601    pub r#first_id: String,
7602
7603    pub r#last_id: String,
7604
7605    pub r#has_more: bool,
7606}
7607
7608#[derive(Clone, Debug, Default)]
7609#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7610pub struct ProjectRateLimitUpdateRequest {
7611    /// The maximum requests per minute.
7612    pub r#max_requests_per_1_minute: Option<i64>,
7613
7614    /// The maximum tokens per minute.
7615    pub r#max_tokens_per_1_minute: Option<i64>,
7616
7617    /// The maximum images per minute.
7618    pub r#max_images_per_1_minute: Option<i64>,
7619
7620    /// The maximum audio megabytes per minute.
7621    pub r#max_audio_megabytes_per_1_minute: Option<i64>,
7622
7623    /// The maximum requests per day.
7624    pub r#max_requests_per_1_day: Option<i64>,
7625
7626    /// The maximum batch input tokens per day.
7627    pub r#batch_1_day_max_input_tokens: Option<i64>,
7628}
7629
7630/// Represents an individual service account in a project.
7631#[derive(Clone, Debug, Default)]
7632#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7633pub struct ProjectServiceAccount {
7634    /// The object type, which is always `organization.project.service_account`
7635    pub r#object: String,
7636
7637    /// The identifier, which can be referenced in API endpoints
7638    pub r#id: String,
7639
7640    /// The name of the service account
7641    pub r#name: String,
7642
7643    /// `owner` or `member`
7644    pub r#role: String,
7645
7646    /// The Unix timestamp (in seconds) of when the service account was created
7647    pub r#created_at: i64,
7648}
7649
7650#[derive(Clone, Debug, Default)]
7651#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7652pub struct ProjectServiceAccountApiKey {
7653    /// The object type, which is always
7654    /// `organization.project.service_account.api_key`
7655    pub r#object: String,
7656
7657    pub r#value: String,
7658
7659    pub r#name: String,
7660
7661    pub r#created_at: i64,
7662
7663    pub r#id: String,
7664}
7665
7666#[derive(Clone, Debug, Default)]
7667#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7668pub struct ProjectServiceAccountCreateRequest {
7669    /// The name of the service account being created.
7670    pub r#name: String,
7671}
7672
7673#[derive(Clone, Debug)]
7674#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7675pub struct ProjectServiceAccountCreateResponse {
7676    pub r#object: String,
7677
7678    pub r#id: String,
7679
7680    pub r#name: String,
7681
7682    /// Service accounts can only have one role of type `member`
7683    pub r#role: String,
7684
7685    pub r#created_at: i64,
7686
7687    pub r#api_key: ProjectServiceAccountApiKey,
7688}
7689
7690#[derive(Clone, Debug, Default)]
7691#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7692pub struct ProjectServiceAccountDeleteResponse {
7693    pub r#object: String,
7694
7695    pub r#id: String,
7696
7697    pub r#deleted: bool,
7698}
7699
7700#[derive(Clone, Debug, Default)]
7701#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7702pub struct ProjectServiceAccountListResponse {
7703    pub r#object: String,
7704
7705    pub r#data: Vec<ProjectServiceAccount>,
7706
7707    pub r#first_id: String,
7708
7709    pub r#last_id: String,
7710
7711    pub r#has_more: bool,
7712}
7713
7714#[derive(Clone, Debug, Default)]
7715#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7716pub struct ProjectUpdateRequest {
7717    /// The updated name of the project, this name appears in reports.
7718    pub r#name: String,
7719}
7720
7721/// Represents an individual user in a project.
7722#[derive(Clone, Debug, Default)]
7723#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7724pub struct ProjectUser {
7725    /// The object type, which is always `organization.project.user`
7726    pub r#object: String,
7727
7728    /// The identifier, which can be referenced in API endpoints
7729    pub r#id: String,
7730
7731    /// The name of the user
7732    pub r#name: String,
7733
7734    /// The email address of the user
7735    pub r#email: String,
7736
7737    /// `owner` or `member`
7738    pub r#role: String,
7739
7740    /// The Unix timestamp (in seconds) of when the project was added.
7741    pub r#added_at: i64,
7742}
7743
7744#[derive(Clone, Debug, Default)]
7745#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7746pub struct ProjectUserCreateRequest {
7747    /// The ID of the user.
7748    pub r#user_id: String,
7749
7750    /// `owner` or `member`
7751    pub r#role: String,
7752}
7753
7754#[derive(Clone, Debug, Default)]
7755#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7756pub struct ProjectUserDeleteResponse {
7757    pub r#object: String,
7758
7759    pub r#id: String,
7760
7761    pub r#deleted: bool,
7762}
7763
7764#[derive(Clone, Debug, Default)]
7765#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7766pub struct ProjectUserListResponse {
7767    pub r#object: String,
7768
7769    pub r#data: Vec<ProjectUser>,
7770
7771    pub r#first_id: String,
7772
7773    pub r#last_id: String,
7774
7775    pub r#has_more: bool,
7776}
7777
7778#[derive(Clone, Debug, Default)]
7779#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7780pub struct ProjectUserUpdateRequest {
7781    /// `owner` or `member`
7782    pub r#role: String,
7783}
7784
7785#[derive(Clone, Debug, Default)]
7786#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7787pub struct RankingOptions {
7788    /// The ranker to use for the file search.
7789    pub r#ranker: Option<String>,
7790
7791    /// The score threshold for the file search, a number between 0 and 1.
7792    pub r#score_threshold: Option<f64>,
7793}
7794
7795/// A realtime client event.
7796#[derive(Clone, Debug)]
7797#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7798#[cfg_attr(feature = "serde", serde(untagged))]
7799pub enum RealtimeClientEvent {
7800    RealtimeClientEventConversationItemCreate(RealtimeClientEventConversationItemCreate),
7801
7802    RealtimeClientEventConversationItemDelete(RealtimeClientEventConversationItemDelete),
7803
7804    RealtimeClientEventConversationItemRetrieve(RealtimeClientEventConversationItemRetrieve),
7805
7806    RealtimeClientEventConversationItemTruncate(RealtimeClientEventConversationItemTruncate),
7807
7808    RealtimeClientEventInputAudioBufferAppend(RealtimeClientEventInputAudioBufferAppend),
7809
7810    RealtimeClientEventInputAudioBufferClear(RealtimeClientEventInputAudioBufferClear),
7811
7812    RealtimeClientEventOutputAudioBufferClear(RealtimeClientEventOutputAudioBufferClear),
7813
7814    RealtimeClientEventInputAudioBufferCommit(RealtimeClientEventInputAudioBufferCommit),
7815
7816    RealtimeClientEventResponseCancel(RealtimeClientEventResponseCancel),
7817
7818    RealtimeClientEventResponseCreate(RealtimeClientEventResponseCreate),
7819
7820    RealtimeClientEventSessionUpdate(RealtimeClientEventSessionUpdate),
7821
7822    RealtimeClientEventTranscriptionSessionUpdate(RealtimeClientEventTranscriptionSessionUpdate),
7823}
7824
7825/// Add a new Item to the Conversation's context, including messages, function
7826/// calls, and function call responses.
7827#[derive(Clone, Debug)]
7828#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7829pub struct RealtimeClientEventConversationItemCreate {
7830    /// Optional client-generated ID used to identify this event.
7831    pub r#event_id: Option<String>,
7832
7833    /// The event type, must be `conversation.item.create`.
7834    pub r#type: String,
7835
7836    /// The ID of the preceding item after which the new item will be inserted.
7837    pub r#previous_item_id: Option<String>,
7838
7839    pub r#item: RealtimeConversationItem,
7840}
7841
7842/// Send this event when you want to remove any item from the conversation
7843/// history.
7844#[derive(Clone, Debug, Default)]
7845#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7846pub struct RealtimeClientEventConversationItemDelete {
7847    /// Optional client-generated ID used to identify this event.
7848    pub r#event_id: Option<String>,
7849
7850    /// The event type, must be `conversation.item.delete`.
7851    pub r#type: String,
7852
7853    /// The ID of the item to delete.
7854    pub r#item_id: String,
7855}
7856
7857/// Send this event when you want to retrieve the server's representation of a
7858/// specific item in the conversation history.
7859#[derive(Clone, Debug, Default)]
7860#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7861pub struct RealtimeClientEventConversationItemRetrieve {
7862    /// Optional client-generated ID used to identify this event.
7863    pub r#event_id: Option<String>,
7864
7865    /// The event type, must be `conversation.item.retrieve`.
7866    pub r#type: String,
7867
7868    /// The ID of the item to retrieve.
7869    pub r#item_id: String,
7870}
7871
7872/// Send this event to truncate a previous assistant message’s audio.
7873#[derive(Clone, Debug, Default)]
7874#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7875pub struct RealtimeClientEventConversationItemTruncate {
7876    /// Optional client-generated ID used to identify this event.
7877    pub r#event_id: Option<String>,
7878
7879    /// The event type, must be `conversation.item.truncate`.
7880    pub r#type: String,
7881
7882    /// The ID of the assistant message item to truncate.
7883    pub r#item_id: String,
7884
7885    /// The index of the content part to truncate.
7886    pub r#content_index: i64,
7887
7888    /// Inclusive duration up to which audio is truncated, in milliseconds.
7889    pub r#audio_end_ms: i64,
7890}
7891
7892/// Send this event to append audio bytes to the input audio buffer.
7893#[derive(Clone, Debug, Default)]
7894#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7895pub struct RealtimeClientEventInputAudioBufferAppend {
7896    /// Optional client-generated ID used to identify this event.
7897    pub r#event_id: Option<String>,
7898
7899    /// The event type, must be `input_audio_buffer.append`.
7900    pub r#type: String,
7901
7902    /// Base64-encoded audio bytes.
7903    pub r#audio: String,
7904}
7905
7906/// Send this event to clear the audio bytes in the buffer.
7907#[derive(Clone, Debug, Default)]
7908#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7909pub struct RealtimeClientEventInputAudioBufferClear {
7910    /// Optional client-generated ID used to identify this event.
7911    pub r#event_id: Option<String>,
7912
7913    /// The event type, must be `input_audio_buffer.clear`.
7914    pub r#type: String,
7915}
7916
7917/// Send this event to commit the user input audio buffer, which will create a
7918/// new user message item in the conversation.
7919#[derive(Clone, Debug, Default)]
7920#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7921pub struct RealtimeClientEventInputAudioBufferCommit {
7922    /// Optional client-generated ID used to identify this event.
7923    pub r#event_id: Option<String>,
7924
7925    /// The event type, must be `input_audio_buffer.commit`.
7926    pub r#type: String,
7927}
7928
7929/// **WebRTC Only:** Emit to cut off the current audio response.
7930#[derive(Clone, Debug, Default)]
7931#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7932pub struct RealtimeClientEventOutputAudioBufferClear {
7933    /// The unique ID of the client event used for error handling.
7934    pub r#event_id: Option<String>,
7935
7936    /// The event type, must be `output_audio_buffer.clear`.
7937    pub r#type: String,
7938}
7939
7940/// Send this event to cancel an in-progress response.
7941#[derive(Clone, Debug, Default)]
7942#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7943pub struct RealtimeClientEventResponseCancel {
7944    /// Optional client-generated ID used to identify this event.
7945    pub r#event_id: Option<String>,
7946
7947    /// The event type, must be `response.cancel`.
7948    pub r#type: String,
7949
7950    /// A specific response ID to cancel - if not provided, will cancel an
7951    /// in-progress response in the default conversation.
7952    pub r#response_id: Option<String>,
7953}
7954
7955/// This event instructs the server to create a Response, which means triggering
7956/// model inference.
7957#[derive(Clone, Debug, Default)]
7958#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7959pub struct RealtimeClientEventResponseCreate {
7960    /// Optional client-generated ID used to identify this event.
7961    pub r#event_id: Option<String>,
7962
7963    /// The event type, must be `response.create`.
7964    pub r#type: String,
7965
7966    pub r#response: Option<RealtimeResponseCreateParams>,
7967}
7968
7969/// Send this event to update the session’s default configuration.
7970#[derive(Clone, Debug)]
7971#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7972pub struct RealtimeClientEventSessionUpdate {
7973    /// Optional client-generated ID used to identify this event.
7974    pub r#event_id: Option<String>,
7975
7976    /// The event type, must be `session.update`.
7977    pub r#type: String,
7978
7979    pub r#session: RealtimeSessionCreateRequest,
7980}
7981
7982/// Send this event to update a transcription session.
7983#[derive(Clone, Debug)]
7984#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7985pub struct RealtimeClientEventTranscriptionSessionUpdate {
7986    /// Optional client-generated ID used to identify this event.
7987    pub r#event_id: Option<String>,
7988
7989    /// The event type, must be `transcription_session.update`.
7990    pub r#type: String,
7991
7992    pub r#session: RealtimeTranscriptionSessionCreateRequest,
7993}
7994
7995/// The item to add to the conversation.
7996#[derive(Clone, Debug, Default)]
7997#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7998pub struct RealtimeConversationItem {
7999    /// The unique ID of the item, this can be generated by the client to help
8000    /// manage server-side context, but is not required because the server will
8001    /// generate one if not provided.
8002    pub r#id: Option<String>,
8003
8004    /// The type of the item (`message`, `function_call`,
8005    /// `function_call_output`).
8006    pub r#type: Option<String>,
8007
8008    /// Identifier for the API object being returned - always `realtime.item`.
8009    pub r#object: Option<String>,
8010
8011    /// The status of the item (`completed`, `incomplete`).
8012    pub r#status: Option<String>,
8013
8014    /// The role of the message sender (`user`, `assistant`, `system`), only
8015    /// applicable for `message` items.
8016    pub r#role: Option<String>,
8017
8018    /// The content of the message, applicable for `message` items.
8019    pub r#content: Option<Vec<RealtimeConversationItem_Content>>,
8020
8021    /// The ID of the function call (for `function_call` and
8022    /// `function_call_output` items).
8023    pub r#call_id: Option<String>,
8024
8025    /// The name of the function being called (for `function_call` items).
8026    pub r#name: Option<String>,
8027
8028    /// The arguments of the function call (for `function_call` items).
8029    pub r#arguments: Option<String>,
8030
8031    /// The output of the function call (for `function_call_output` items).
8032    pub r#output: Option<String>,
8033}
8034
8035/// The item to add to the conversation.
8036#[derive(Clone, Debug, Default)]
8037#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8038pub struct RealtimeConversationItemWithReference {
8039    /// For an item of type (`message` | `function_call` |
8040    /// `function_call_output`) this field allows the client to assign the
8041    /// unique ID of the item.
8042    pub r#id: Option<String>,
8043
8044    /// The type of the item (`message`, `function_call`,
8045    /// `function_call_output`, `item_reference`).
8046    pub r#type: Option<String>,
8047
8048    /// Identifier for the API object being returned - always `realtime.item`.
8049    pub r#object: Option<String>,
8050
8051    /// The status of the item (`completed`, `incomplete`).
8052    pub r#status: Option<String>,
8053
8054    /// The role of the message sender (`user`, `assistant`, `system`), only
8055    /// applicable for `message` items.
8056    pub r#role: Option<String>,
8057
8058    /// The content of the message, applicable for `message` items.
8059    pub r#content: Option<Vec<RealtimeConversationItemWithReference_Content>>,
8060
8061    /// The ID of the function call (for `function_call` and
8062    /// `function_call_output` items).
8063    pub r#call_id: Option<String>,
8064
8065    /// The name of the function being called (for `function_call` items).
8066    pub r#name: Option<String>,
8067
8068    /// The arguments of the function call (for `function_call` items).
8069    pub r#arguments: Option<String>,
8070
8071    /// The output of the function call (for `function_call_output` items).
8072    pub r#output: Option<String>,
8073}
8074
8075#[derive(Clone, Debug, Default)]
8076#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8077pub struct RealtimeConversationItemWithReference_Content {
8078    /// The content type (`input_text`, `input_audio`, `item_reference`,
8079    /// `text`).
8080    pub r#type: Option<String>,
8081
8082    /// The text content, used for `input_text` and `text` content types.
8083    pub r#text: Option<String>,
8084
8085    /// ID of a previous conversation item to reference (for `item_reference`
8086    /// content types in `response.create` events).
8087    pub r#id: Option<String>,
8088
8089    /// Base64-encoded audio bytes, used for `input_audio` content type.
8090    pub r#audio: Option<String>,
8091
8092    /// The transcript of the audio, used for `input_audio` content type.
8093    pub r#transcript: Option<String>,
8094}
8095
8096#[derive(Clone, Debug, Default)]
8097#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8098pub struct RealtimeConversationItem_Content {
8099    /// The content type (`input_text`, `input_audio`, `item_reference`,
8100    /// `text`).
8101    pub r#type: Option<String>,
8102
8103    /// The text content, used for `input_text` and `text` content types.
8104    pub r#text: Option<String>,
8105
8106    /// ID of a previous conversation item to reference (for `item_reference`
8107    /// content types in `response.create` events).
8108    pub r#id: Option<String>,
8109
8110    /// Base64-encoded audio bytes, used for `input_audio` content type.
8111    pub r#audio: Option<String>,
8112
8113    /// The transcript of the audio, used for `input_audio` content type.
8114    pub r#transcript: Option<String>,
8115}
8116
8117/// The response resource.
8118#[derive(Clone, Debug, Default)]
8119#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8120pub struct RealtimeResponse {
8121    /// The unique ID of the response.
8122    pub r#id: Option<String>,
8123
8124    /// The object type, must be `realtime.response`.
8125    pub r#object: Option<String>,
8126
8127    /// The final status of the response (`completed`, `cancelled`, `failed`, or
8128    /// `incomplete`).
8129    pub r#status: Option<String>,
8130
8131    pub r#status_details: Option<RealtimeResponse_StatusDetails>,
8132
8133    /// The list of output items generated by the response.
8134    pub r#output: Option<Vec<RealtimeConversationItem>>,
8135
8136    pub r#metadata: Option<Metadata>,
8137
8138    pub r#usage: Option<RealtimeResponse_Usage>,
8139
8140    /// Which conversation the response is added to, determined by the
8141    /// `conversation` field in the `response.create` event.
8142    pub r#conversation_id: Option<String>,
8143
8144    /// The voice the model used to respond.
8145    pub r#voice: Option<VoiceIdsShared>,
8146
8147    /// The set of modalities the model used to respond.
8148    pub r#modalities: Option<Vec<String>>,
8149
8150    /// The format of output audio.
8151    pub r#output_audio_format: Option<String>,
8152
8153    /// Sampling temperature for the model, limited to [0.6, 1.2].
8154    pub r#temperature: Option<f64>,
8155
8156    pub r#max_output_tokens: Option<RealtimeResponse_MaxOutputTokens>,
8157}
8158
8159/// Create a new Realtime response with these parameters
8160#[derive(Clone, Debug, Default)]
8161#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8162pub struct RealtimeResponseCreateParams {
8163    /// The set of modalities the model can respond with.
8164    pub r#modalities: Option<Vec<String>>,
8165
8166    /// The default system instructions (i.e.
8167    pub r#instructions: Option<String>,
8168
8169    /// The voice the model uses to respond.
8170    pub r#voice: Option<VoiceIdsShared>,
8171
8172    /// The format of output audio.
8173    pub r#output_audio_format: Option<String>,
8174
8175    /// Tools (functions) available to the model.
8176    pub r#tools: Option<Vec<RealtimeResponseCreateParams_Tools>>,
8177
8178    /// How the model chooses tools.
8179    pub r#tool_choice: Option<String>,
8180
8181    /// Sampling temperature for the model, limited to [0.6, 1.2].
8182    pub r#temperature: Option<f64>,
8183
8184    pub r#max_response_output_tokens: Option<RealtimeResponseCreateParams_MaxResponseOutputTokens>,
8185
8186    pub r#conversation: Option<RealtimeResponseCreateParams_Conversation>,
8187
8188    pub r#metadata: Option<Metadata>,
8189
8190    /// Input items to include in the prompt for the model.
8191    pub r#input: Option<Vec<RealtimeConversationItemWithReference>>,
8192}
8193
8194/// Controls which conversation the response is added to.
8195pub type RealtimeResponseCreateParams_Conversation = String;
8196
8197/// Maximum number of output tokens for a single assistant response, inclusive
8198/// of tool calls.
8199#[derive(Clone, Debug)]
8200#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8201#[cfg_attr(feature = "serde", serde(untagged))]
8202pub enum RealtimeResponseCreateParams_MaxResponseOutputTokens {
8203    Integer(i64),
8204
8205    Text(String),
8206}
8207
8208#[derive(Clone, Debug, Default)]
8209#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8210pub struct RealtimeResponseCreateParams_Tools {
8211    /// The type of the tool, i.e.
8212    pub r#type: Option<String>,
8213
8214    /// The name of the function.
8215    pub r#name: Option<String>,
8216
8217    /// The description of the function, including guidance on when and how to
8218    /// call it, and guidance about what to tell the user when calling (if
8219    /// anything).
8220    pub r#description: Option<String>,
8221
8222    /// Parameters of the function in JSON Schema.
8223    pub r#parameters: Option<RealtimeResponseCreateParams_Tools_Parameters>,
8224}
8225
8226/// Parameters of the function in JSON Schema.
8227#[derive(Clone, Debug, Default)]
8228#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8229pub struct RealtimeResponseCreateParams_Tools_Parameters;
8230
8231/// Maximum number of output tokens for a single assistant response, inclusive
8232/// of tool calls, that was used in this response.
8233#[derive(Clone, Debug)]
8234#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8235#[cfg_attr(feature = "serde", serde(untagged))]
8236pub enum RealtimeResponse_MaxOutputTokens {
8237    Integer(i64),
8238
8239    Text(String),
8240}
8241
8242/// Additional details about the status.
8243#[derive(Clone, Debug, Default)]
8244#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8245pub struct RealtimeResponse_StatusDetails {
8246    /// The type of error that caused the response to fail, corresponding with
8247    /// the `status` field (`completed`, `cancelled`, `incomplete`, `failed`).
8248    pub r#type: Option<String>,
8249
8250    /// The reason the Response did not complete.
8251    pub r#reason: Option<String>,
8252
8253    pub r#error: Option<RealtimeResponse_StatusDetails_Error>,
8254}
8255
8256/// A description of the error that caused the response to fail, populated when
8257/// the `status` is `failed`.
8258#[derive(Clone, Debug, Default)]
8259#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8260pub struct RealtimeResponse_StatusDetails_Error {
8261    /// The type of error.
8262    pub r#type: Option<String>,
8263
8264    /// Error code, if any.
8265    pub r#code: Option<String>,
8266}
8267
8268/// Usage statistics for the Response, this will correspond to billing.
8269#[derive(Clone, Debug, Default)]
8270#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8271pub struct RealtimeResponse_Usage {
8272    /// The total number of tokens in the Response including input and output
8273    /// text and audio tokens.
8274    pub r#total_tokens: Option<i64>,
8275
8276    /// The number of input tokens used in the Response, including text and
8277    /// audio tokens.
8278    pub r#input_tokens: Option<i64>,
8279
8280    /// The number of output tokens sent in the Response, including text and
8281    /// audio tokens.
8282    pub r#output_tokens: Option<i64>,
8283
8284    pub r#input_token_details: Option<RealtimeResponse_Usage_InputTokenDetails>,
8285
8286    pub r#output_token_details: Option<RealtimeResponse_Usage_OutputTokenDetails>,
8287}
8288
8289/// Details about the input tokens used in the Response.
8290#[derive(Clone, Debug, Default)]
8291#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8292pub struct RealtimeResponse_Usage_InputTokenDetails {
8293    /// The number of cached tokens used in the Response.
8294    pub r#cached_tokens: Option<i64>,
8295
8296    /// The number of text tokens used in the Response.
8297    pub r#text_tokens: Option<i64>,
8298
8299    /// The number of audio tokens used in the Response.
8300    pub r#audio_tokens: Option<i64>,
8301}
8302
8303/// Details about the output tokens used in the Response.
8304#[derive(Clone, Debug, Default)]
8305#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8306pub struct RealtimeResponse_Usage_OutputTokenDetails {
8307    /// The number of text tokens used in the Response.
8308    pub r#text_tokens: Option<i64>,
8309
8310    /// The number of audio tokens used in the Response.
8311    pub r#audio_tokens: Option<i64>,
8312}
8313
8314/// A realtime server event.
8315#[derive(Clone, Debug)]
8316#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8317#[cfg_attr(feature = "serde", serde(untagged))]
8318pub enum RealtimeServerEvent {
8319    RealtimeServerEventConversationCreated(RealtimeServerEventConversationCreated),
8320
8321    RealtimeServerEventConversationItemCreated(RealtimeServerEventConversationItemCreated),
8322
8323    RealtimeServerEventConversationItemDeleted(RealtimeServerEventConversationItemDeleted),
8324
8325    RealtimeServerEventConversationItemInputAudioTranscriptionCompleted(RealtimeServerEventConversationItemInputAudioTranscriptionCompleted),
8326
8327    RealtimeServerEventConversationItemInputAudioTranscriptionDelta(RealtimeServerEventConversationItemInputAudioTranscriptionDelta),
8328
8329    RealtimeServerEventConversationItemInputAudioTranscriptionFailed(RealtimeServerEventConversationItemInputAudioTranscriptionFailed),
8330
8331    RealtimeServerEventConversationItemRetrieved(RealtimeServerEventConversationItemRetrieved),
8332
8333    RealtimeServerEventConversationItemTruncated(RealtimeServerEventConversationItemTruncated),
8334
8335    RealtimeServerEventError(RealtimeServerEventError),
8336
8337    RealtimeServerEventInputAudioBufferCleared(RealtimeServerEventInputAudioBufferCleared),
8338
8339    RealtimeServerEventInputAudioBufferCommitted(RealtimeServerEventInputAudioBufferCommitted),
8340
8341    RealtimeServerEventInputAudioBufferSpeechStarted(RealtimeServerEventInputAudioBufferSpeechStarted),
8342
8343    RealtimeServerEventInputAudioBufferSpeechStopped(RealtimeServerEventInputAudioBufferSpeechStopped),
8344
8345    RealtimeServerEventRateLimitsUpdated(RealtimeServerEventRateLimitsUpdated),
8346
8347    RealtimeServerEventResponseAudioDelta(RealtimeServerEventResponseAudioDelta),
8348
8349    RealtimeServerEventResponseAudioDone(RealtimeServerEventResponseAudioDone),
8350
8351    RealtimeServerEventResponseAudioTranscriptDelta(RealtimeServerEventResponseAudioTranscriptDelta),
8352
8353    RealtimeServerEventResponseAudioTranscriptDone(RealtimeServerEventResponseAudioTranscriptDone),
8354
8355    RealtimeServerEventResponseContentPartAdded(RealtimeServerEventResponseContentPartAdded),
8356
8357    RealtimeServerEventResponseContentPartDone(RealtimeServerEventResponseContentPartDone),
8358
8359    RealtimeServerEventResponseCreated(RealtimeServerEventResponseCreated),
8360
8361    RealtimeServerEventResponseDone(RealtimeServerEventResponseDone),
8362
8363    RealtimeServerEventResponseFunctionCallArgumentsDelta(RealtimeServerEventResponseFunctionCallArgumentsDelta),
8364
8365    RealtimeServerEventResponseFunctionCallArgumentsDone(RealtimeServerEventResponseFunctionCallArgumentsDone),
8366
8367    RealtimeServerEventResponseOutputItemAdded(RealtimeServerEventResponseOutputItemAdded),
8368
8369    RealtimeServerEventResponseOutputItemDone(RealtimeServerEventResponseOutputItemDone),
8370
8371    RealtimeServerEventResponseTextDelta(RealtimeServerEventResponseTextDelta),
8372
8373    RealtimeServerEventResponseTextDone(RealtimeServerEventResponseTextDone),
8374
8375    RealtimeServerEventSessionCreated(RealtimeServerEventSessionCreated),
8376
8377    RealtimeServerEventSessionUpdated(RealtimeServerEventSessionUpdated),
8378
8379    RealtimeServerEventTranscriptionSessionUpdated(RealtimeServerEventTranscriptionSessionUpdated),
8380
8381    RealtimeServerEventOutputAudioBufferStarted(RealtimeServerEventOutputAudioBufferStarted),
8382
8383    RealtimeServerEventOutputAudioBufferStopped(RealtimeServerEventOutputAudioBufferStopped),
8384
8385    RealtimeServerEventOutputAudioBufferCleared(RealtimeServerEventOutputAudioBufferCleared),
8386}
8387
8388/// Returned when a conversation is created.
8389#[derive(Clone, Debug)]
8390#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8391pub struct RealtimeServerEventConversationCreated {
8392    /// The unique ID of the server event.
8393    pub r#event_id: String,
8394
8395    /// The event type, must be `conversation.created`.
8396    pub r#type: String,
8397
8398    pub r#conversation: RealtimeServerEventConversationCreated_Conversation,
8399}
8400
8401/// The conversation resource.
8402#[derive(Clone, Debug, Default)]
8403#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8404pub struct RealtimeServerEventConversationCreated_Conversation {
8405    /// The unique ID of the conversation.
8406    pub r#id: Option<String>,
8407
8408    /// The object type, must be `realtime.conversation`.
8409    pub r#object: Option<String>,
8410}
8411
8412/// Returned when a conversation item is created.
8413#[derive(Clone, Debug)]
8414#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8415pub struct RealtimeServerEventConversationItemCreated {
8416    /// The unique ID of the server event.
8417    pub r#event_id: String,
8418
8419    /// The event type, must be `conversation.item.created`.
8420    pub r#type: String,
8421
8422    /// The ID of the preceding item in the Conversation context, allows the
8423    /// client to understand the order of the conversation.
8424    pub r#previous_item_id: String,
8425
8426    pub r#item: RealtimeConversationItem,
8427}
8428
8429/// Returned when an item in the conversation is deleted by the client with a
8430/// `conversation.item.delete` event.
8431#[derive(Clone, Debug, Default)]
8432#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8433pub struct RealtimeServerEventConversationItemDeleted {
8434    /// The unique ID of the server event.
8435    pub r#event_id: String,
8436
8437    /// The event type, must be `conversation.item.deleted`.
8438    pub r#type: String,
8439
8440    /// The ID of the item that was deleted.
8441    pub r#item_id: String,
8442}
8443
8444/// This event is the output of audio transcription for user audio written to
8445/// the user audio buffer.
8446#[derive(Clone, Debug, Default)]
8447#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8448pub struct RealtimeServerEventConversationItemInputAudioTranscriptionCompleted {
8449    /// The unique ID of the server event.
8450    pub r#event_id: String,
8451
8452    /// The event type, must be
8453    /// `conversation.item.input_audio_transcription.completed`.
8454    pub r#type: String,
8455
8456    /// The ID of the user message item containing the audio.
8457    pub r#item_id: String,
8458
8459    /// The index of the content part containing the audio.
8460    pub r#content_index: i64,
8461
8462    /// The transcribed text.
8463    pub r#transcript: String,
8464
8465    /// The log probabilities of the transcription.
8466    pub r#logprobs: Option<Vec<LogProbProperties>>,
8467}
8468
8469/// Returned when the text value of an input audio transcription content part is
8470/// updated.
8471#[derive(Clone, Debug, Default)]
8472#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8473pub struct RealtimeServerEventConversationItemInputAudioTranscriptionDelta {
8474    /// The unique ID of the server event.
8475    pub r#event_id: String,
8476
8477    /// The event type, must be
8478    /// `conversation.item.input_audio_transcription.delta`.
8479    pub r#type: String,
8480
8481    /// The ID of the item.
8482    pub r#item_id: String,
8483
8484    /// The index of the content part in the item's content array.
8485    pub r#content_index: Option<i64>,
8486
8487    /// The text delta.
8488    pub r#delta: Option<String>,
8489
8490    /// The log probabilities of the transcription.
8491    pub r#logprobs: Option<Vec<LogProbProperties>>,
8492}
8493
8494/// Returned when input audio transcription is configured, and a transcription
8495/// request for a user message failed.
8496#[derive(Clone, Debug)]
8497#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8498pub struct RealtimeServerEventConversationItemInputAudioTranscriptionFailed {
8499    /// The unique ID of the server event.
8500    pub r#event_id: String,
8501
8502    /// The event type, must be
8503    /// `conversation.item.input_audio_transcription.failed`.
8504    pub r#type: String,
8505
8506    /// The ID of the user message item.
8507    pub r#item_id: String,
8508
8509    /// The index of the content part containing the audio.
8510    pub r#content_index: i64,
8511
8512    pub r#error: RealtimeServerEventConversationItemInputAudioTranscriptionFailed_Error,
8513}
8514
8515/// Details of the transcription error.
8516#[derive(Clone, Debug, Default)]
8517#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8518pub struct RealtimeServerEventConversationItemInputAudioTranscriptionFailed_Error {
8519    /// The type of error.
8520    pub r#type: Option<String>,
8521
8522    /// Error code, if any.
8523    pub r#code: Option<String>,
8524
8525    /// A human-readable error message.
8526    pub r#message: Option<String>,
8527
8528    /// Parameter related to the error, if any.
8529    pub r#param: Option<String>,
8530}
8531
8532/// Returned when a conversation item is retrieved with
8533/// `conversation.item.retrieve`.
8534#[derive(Clone, Debug)]
8535#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8536pub struct RealtimeServerEventConversationItemRetrieved {
8537    /// The unique ID of the server event.
8538    pub r#event_id: String,
8539
8540    /// The event type, must be `conversation.item.retrieved`.
8541    pub r#type: String,
8542
8543    pub r#item: RealtimeConversationItem,
8544}
8545
8546/// Returned when an earlier assistant audio message item is truncated by the
8547/// client with a `conversation.item.truncate` event.
8548#[derive(Clone, Debug, Default)]
8549#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8550pub struct RealtimeServerEventConversationItemTruncated {
8551    /// The unique ID of the server event.
8552    pub r#event_id: String,
8553
8554    /// The event type, must be `conversation.item.truncated`.
8555    pub r#type: String,
8556
8557    /// The ID of the assistant message item that was truncated.
8558    pub r#item_id: String,
8559
8560    /// The index of the content part that was truncated.
8561    pub r#content_index: i64,
8562
8563    /// The duration up to which the audio was truncated, in milliseconds.
8564    pub r#audio_end_ms: i64,
8565}
8566
8567/// Returned when an error occurs, which could be a client problem or a server
8568/// problem.
8569#[derive(Clone, Debug)]
8570#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8571pub struct RealtimeServerEventError {
8572    /// The unique ID of the server event.
8573    pub r#event_id: String,
8574
8575    /// The event type, must be `error`.
8576    pub r#type: String,
8577
8578    pub r#error: RealtimeServerEventError_Error,
8579}
8580
8581/// Details of the error.
8582#[derive(Clone, Debug, Default)]
8583#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8584pub struct RealtimeServerEventError_Error {
8585    /// The type of error (e.g., "invalid_request_error", "server_error").
8586    pub r#type: String,
8587
8588    /// Error code, if any.
8589    pub r#code: Option<String>,
8590
8591    /// A human-readable error message.
8592    pub r#message: String,
8593
8594    /// Parameter related to the error, if any.
8595    pub r#param: Option<String>,
8596
8597    /// The event_id of the client event that caused the error, if applicable.
8598    pub r#event_id: Option<String>,
8599}
8600
8601/// Returned when the input audio buffer is cleared by the client with a
8602/// `input_audio_buffer.clear` event.
8603#[derive(Clone, Debug, Default)]
8604#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8605pub struct RealtimeServerEventInputAudioBufferCleared {
8606    /// The unique ID of the server event.
8607    pub r#event_id: String,
8608
8609    /// The event type, must be `input_audio_buffer.cleared`.
8610    pub r#type: String,
8611}
8612
8613/// Returned when an input audio buffer is committed, either by the client or
8614/// automatically in server VAD mode.
8615#[derive(Clone, Debug, Default)]
8616#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8617pub struct RealtimeServerEventInputAudioBufferCommitted {
8618    /// The unique ID of the server event.
8619    pub r#event_id: String,
8620
8621    /// The event type, must be `input_audio_buffer.committed`.
8622    pub r#type: String,
8623
8624    /// The ID of the preceding item after which the new item will be inserted.
8625    pub r#previous_item_id: String,
8626
8627    /// The ID of the user message item that will be created.
8628    pub r#item_id: String,
8629}
8630
8631/// Sent by the server when in `server_vad` mode to indicate that speech has
8632/// been detected in the audio buffer.
8633#[derive(Clone, Debug, Default)]
8634#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8635pub struct RealtimeServerEventInputAudioBufferSpeechStarted {
8636    /// The unique ID of the server event.
8637    pub r#event_id: String,
8638
8639    /// The event type, must be `input_audio_buffer.speech_started`.
8640    pub r#type: String,
8641
8642    /// Milliseconds from the start of all audio written to the buffer during
8643    /// the session when speech was first detected.
8644    pub r#audio_start_ms: i64,
8645
8646    /// The ID of the user message item that will be created when speech stops.
8647    pub r#item_id: String,
8648}
8649
8650/// Returned in `server_vad` mode when the server detects the end of speech in
8651/// the audio buffer.
8652#[derive(Clone, Debug, Default)]
8653#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8654pub struct RealtimeServerEventInputAudioBufferSpeechStopped {
8655    /// The unique ID of the server event.
8656    pub r#event_id: String,
8657
8658    /// The event type, must be `input_audio_buffer.speech_stopped`.
8659    pub r#type: String,
8660
8661    /// Milliseconds since the session started when speech stopped.
8662    pub r#audio_end_ms: i64,
8663
8664    /// The ID of the user message item that will be created.
8665    pub r#item_id: String,
8666}
8667
8668/// **WebRTC Only:** Emitted when the output audio buffer is cleared.
8669#[derive(Clone, Debug, Default)]
8670#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8671pub struct RealtimeServerEventOutputAudioBufferCleared {
8672    /// The unique ID of the server event.
8673    pub r#event_id: String,
8674
8675    /// The event type, must be `output_audio_buffer.cleared`.
8676    pub r#type: String,
8677
8678    /// The unique ID of the response that produced the audio.
8679    pub r#response_id: String,
8680}
8681
8682/// **WebRTC Only:** Emitted when the server begins streaming audio to the
8683/// client.
8684#[derive(Clone, Debug, Default)]
8685#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8686pub struct RealtimeServerEventOutputAudioBufferStarted {
8687    /// The unique ID of the server event.
8688    pub r#event_id: String,
8689
8690    /// The event type, must be `output_audio_buffer.started`.
8691    pub r#type: String,
8692
8693    /// The unique ID of the response that produced the audio.
8694    pub r#response_id: String,
8695}
8696
8697/// **WebRTC Only:** Emitted when the output audio buffer has been completely
8698/// drained on the server, and no more audio is forthcoming.
8699#[derive(Clone, Debug, Default)]
8700#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8701pub struct RealtimeServerEventOutputAudioBufferStopped {
8702    /// The unique ID of the server event.
8703    pub r#event_id: String,
8704
8705    /// The event type, must be `output_audio_buffer.stopped`.
8706    pub r#type: String,
8707
8708    /// The unique ID of the response that produced the audio.
8709    pub r#response_id: String,
8710}
8711
8712/// Emitted at the beginning of a Response to indicate the updated rate limits.
8713#[derive(Clone, Debug, Default)]
8714#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8715pub struct RealtimeServerEventRateLimitsUpdated {
8716    /// The unique ID of the server event.
8717    pub r#event_id: String,
8718
8719    /// The event type, must be `rate_limits.updated`.
8720    pub r#type: String,
8721
8722    /// List of rate limit information.
8723    pub r#rate_limits: Vec<RealtimeServerEventRateLimitsUpdated_RateLimits>,
8724}
8725
8726#[derive(Clone, Debug, Default)]
8727#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8728pub struct RealtimeServerEventRateLimitsUpdated_RateLimits {
8729    /// The name of the rate limit (`requests`, `tokens`).
8730    pub r#name: Option<String>,
8731
8732    /// The maximum allowed value for the rate limit.
8733    pub r#limit: Option<i64>,
8734
8735    /// The remaining value before the limit is reached.
8736    pub r#remaining: Option<i64>,
8737
8738    /// Seconds until the rate limit resets.
8739    pub r#reset_seconds: Option<f64>,
8740}
8741
8742/// Returned when the model-generated audio is updated.
8743#[derive(Clone, Debug, Default)]
8744#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8745pub struct RealtimeServerEventResponseAudioDelta {
8746    /// The unique ID of the server event.
8747    pub r#event_id: String,
8748
8749    /// The event type, must be `response.audio.delta`.
8750    pub r#type: String,
8751
8752    /// The ID of the response.
8753    pub r#response_id: String,
8754
8755    /// The ID of the item.
8756    pub r#item_id: String,
8757
8758    /// The index of the output item in the response.
8759    pub r#output_index: i64,
8760
8761    /// The index of the content part in the item's content array.
8762    pub r#content_index: i64,
8763
8764    /// Base64-encoded audio data delta.
8765    pub r#delta: String,
8766}
8767
8768/// Returned when the model-generated audio is done.
8769#[derive(Clone, Debug, Default)]
8770#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8771pub struct RealtimeServerEventResponseAudioDone {
8772    /// The unique ID of the server event.
8773    pub r#event_id: String,
8774
8775    /// The event type, must be `response.audio.done`.
8776    pub r#type: String,
8777
8778    /// The ID of the response.
8779    pub r#response_id: String,
8780
8781    /// The ID of the item.
8782    pub r#item_id: String,
8783
8784    /// The index of the output item in the response.
8785    pub r#output_index: i64,
8786
8787    /// The index of the content part in the item's content array.
8788    pub r#content_index: i64,
8789}
8790
8791/// Returned when the model-generated transcription of audio output is updated.
8792#[derive(Clone, Debug, Default)]
8793#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8794pub struct RealtimeServerEventResponseAudioTranscriptDelta {
8795    /// The unique ID of the server event.
8796    pub r#event_id: String,
8797
8798    /// The event type, must be `response.audio_transcript.delta`.
8799    pub r#type: String,
8800
8801    /// The ID of the response.
8802    pub r#response_id: String,
8803
8804    /// The ID of the item.
8805    pub r#item_id: String,
8806
8807    /// The index of the output item in the response.
8808    pub r#output_index: i64,
8809
8810    /// The index of the content part in the item's content array.
8811    pub r#content_index: i64,
8812
8813    /// The transcript delta.
8814    pub r#delta: String,
8815}
8816
8817/// Returned when the model-generated transcription of audio output is done
8818/// streaming.
8819#[derive(Clone, Debug, Default)]
8820#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8821pub struct RealtimeServerEventResponseAudioTranscriptDone {
8822    /// The unique ID of the server event.
8823    pub r#event_id: String,
8824
8825    /// The event type, must be `response.audio_transcript.done`.
8826    pub r#type: String,
8827
8828    /// The ID of the response.
8829    pub r#response_id: String,
8830
8831    /// The ID of the item.
8832    pub r#item_id: String,
8833
8834    /// The index of the output item in the response.
8835    pub r#output_index: i64,
8836
8837    /// The index of the content part in the item's content array.
8838    pub r#content_index: i64,
8839
8840    /// The final transcript of the audio.
8841    pub r#transcript: String,
8842}
8843
8844/// Returned when a new content part is added to an assistant message item
8845/// during response generation.
8846#[derive(Clone, Debug)]
8847#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8848pub struct RealtimeServerEventResponseContentPartAdded {
8849    /// The unique ID of the server event.
8850    pub r#event_id: String,
8851
8852    /// The event type, must be `response.content_part.added`.
8853    pub r#type: String,
8854
8855    /// The ID of the response.
8856    pub r#response_id: String,
8857
8858    /// The ID of the item to which the content part was added.
8859    pub r#item_id: String,
8860
8861    /// The index of the output item in the response.
8862    pub r#output_index: i64,
8863
8864    /// The index of the content part in the item's content array.
8865    pub r#content_index: i64,
8866
8867    pub r#part: RealtimeServerEventResponseContentPartAdded_Part,
8868}
8869
8870/// The content part that was added.
8871#[derive(Clone, Debug, Default)]
8872#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8873pub struct RealtimeServerEventResponseContentPartAdded_Part {
8874    /// The content type ("text", "audio").
8875    pub r#type: Option<String>,
8876
8877    /// The text content (if type is "text").
8878    pub r#text: Option<String>,
8879
8880    /// Base64-encoded audio data (if type is "audio").
8881    pub r#audio: Option<String>,
8882
8883    /// The transcript of the audio (if type is "audio").
8884    pub r#transcript: Option<String>,
8885}
8886
8887/// Returned when a content part is done streaming in an assistant message item.
8888#[derive(Clone, Debug)]
8889#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8890pub struct RealtimeServerEventResponseContentPartDone {
8891    /// The unique ID of the server event.
8892    pub r#event_id: String,
8893
8894    /// The event type, must be `response.content_part.done`.
8895    pub r#type: String,
8896
8897    /// The ID of the response.
8898    pub r#response_id: String,
8899
8900    /// The ID of the item.
8901    pub r#item_id: String,
8902
8903    /// The index of the output item in the response.
8904    pub r#output_index: i64,
8905
8906    /// The index of the content part in the item's content array.
8907    pub r#content_index: i64,
8908
8909    pub r#part: RealtimeServerEventResponseContentPartDone_Part,
8910}
8911
8912/// The content part that is done.
8913#[derive(Clone, Debug, Default)]
8914#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8915pub struct RealtimeServerEventResponseContentPartDone_Part {
8916    /// The content type ("text", "audio").
8917    pub r#type: Option<String>,
8918
8919    /// The text content (if type is "text").
8920    pub r#text: Option<String>,
8921
8922    /// Base64-encoded audio data (if type is "audio").
8923    pub r#audio: Option<String>,
8924
8925    /// The transcript of the audio (if type is "audio").
8926    pub r#transcript: Option<String>,
8927}
8928
8929/// Returned when a new Response is created.
8930#[derive(Clone, Debug)]
8931#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8932pub struct RealtimeServerEventResponseCreated {
8933    /// The unique ID of the server event.
8934    pub r#event_id: String,
8935
8936    /// The event type, must be `response.created`.
8937    pub r#type: String,
8938
8939    pub r#response: RealtimeResponse,
8940}
8941
8942/// Returned when a Response is done streaming.
8943#[derive(Clone, Debug)]
8944#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8945pub struct RealtimeServerEventResponseDone {
8946    /// The unique ID of the server event.
8947    pub r#event_id: String,
8948
8949    /// The event type, must be `response.done`.
8950    pub r#type: String,
8951
8952    pub r#response: RealtimeResponse,
8953}
8954
8955/// Returned when the model-generated function call arguments are updated.
8956#[derive(Clone, Debug, Default)]
8957#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8958pub struct RealtimeServerEventResponseFunctionCallArgumentsDelta {
8959    /// The unique ID of the server event.
8960    pub r#event_id: String,
8961
8962    /// The event type, must be `response.function_call_arguments.delta`.
8963    pub r#type: String,
8964
8965    /// The ID of the response.
8966    pub r#response_id: String,
8967
8968    /// The ID of the function call item.
8969    pub r#item_id: String,
8970
8971    /// The index of the output item in the response.
8972    pub r#output_index: i64,
8973
8974    /// The ID of the function call.
8975    pub r#call_id: String,
8976
8977    /// The arguments delta as a JSON string.
8978    pub r#delta: String,
8979}
8980
8981/// Returned when the model-generated function call arguments are done
8982/// streaming.
8983#[derive(Clone, Debug, Default)]
8984#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8985pub struct RealtimeServerEventResponseFunctionCallArgumentsDone {
8986    /// The unique ID of the server event.
8987    pub r#event_id: String,
8988
8989    /// The event type, must be `response.function_call_arguments.done`.
8990    pub r#type: String,
8991
8992    /// The ID of the response.
8993    pub r#response_id: String,
8994
8995    /// The ID of the function call item.
8996    pub r#item_id: String,
8997
8998    /// The index of the output item in the response.
8999    pub r#output_index: i64,
9000
9001    /// The ID of the function call.
9002    pub r#call_id: String,
9003
9004    /// The final arguments as a JSON string.
9005    pub r#arguments: String,
9006}
9007
9008/// Returned when a new Item is created during Response generation.
9009#[derive(Clone, Debug)]
9010#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9011pub struct RealtimeServerEventResponseOutputItemAdded {
9012    /// The unique ID of the server event.
9013    pub r#event_id: String,
9014
9015    /// The event type, must be `response.output_item.added`.
9016    pub r#type: String,
9017
9018    /// The ID of the Response to which the item belongs.
9019    pub r#response_id: String,
9020
9021    /// The index of the output item in the Response.
9022    pub r#output_index: i64,
9023
9024    pub r#item: RealtimeConversationItem,
9025}
9026
9027/// Returned when an Item is done streaming.
9028#[derive(Clone, Debug)]
9029#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9030pub struct RealtimeServerEventResponseOutputItemDone {
9031    /// The unique ID of the server event.
9032    pub r#event_id: String,
9033
9034    /// The event type, must be `response.output_item.done`.
9035    pub r#type: String,
9036
9037    /// The ID of the Response to which the item belongs.
9038    pub r#response_id: String,
9039
9040    /// The index of the output item in the Response.
9041    pub r#output_index: i64,
9042
9043    pub r#item: RealtimeConversationItem,
9044}
9045
9046/// Returned when the text value of a "text" content part is updated.
9047#[derive(Clone, Debug, Default)]
9048#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9049pub struct RealtimeServerEventResponseTextDelta {
9050    /// The unique ID of the server event.
9051    pub r#event_id: String,
9052
9053    /// The event type, must be `response.text.delta`.
9054    pub r#type: String,
9055
9056    /// The ID of the response.
9057    pub r#response_id: String,
9058
9059    /// The ID of the item.
9060    pub r#item_id: String,
9061
9062    /// The index of the output item in the response.
9063    pub r#output_index: i64,
9064
9065    /// The index of the content part in the item's content array.
9066    pub r#content_index: i64,
9067
9068    /// The text delta.
9069    pub r#delta: String,
9070}
9071
9072/// Returned when the text value of a "text" content part is done streaming.
9073#[derive(Clone, Debug, Default)]
9074#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9075pub struct RealtimeServerEventResponseTextDone {
9076    /// The unique ID of the server event.
9077    pub r#event_id: String,
9078
9079    /// The event type, must be `response.text.done`.
9080    pub r#type: String,
9081
9082    /// The ID of the response.
9083    pub r#response_id: String,
9084
9085    /// The ID of the item.
9086    pub r#item_id: String,
9087
9088    /// The index of the output item in the response.
9089    pub r#output_index: i64,
9090
9091    /// The index of the content part in the item's content array.
9092    pub r#content_index: i64,
9093
9094    /// The final text content.
9095    pub r#text: String,
9096}
9097
9098/// Returned when a Session is created.
9099#[derive(Clone, Debug)]
9100#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9101pub struct RealtimeServerEventSessionCreated {
9102    /// The unique ID of the server event.
9103    pub r#event_id: String,
9104
9105    /// The event type, must be `session.created`.
9106    pub r#type: String,
9107
9108    pub r#session: RealtimeSession,
9109}
9110
9111/// Returned when a session is updated with a `session.update` event, unless
9112/// there is an error.
9113#[derive(Clone, Debug)]
9114#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9115pub struct RealtimeServerEventSessionUpdated {
9116    /// The unique ID of the server event.
9117    pub r#event_id: String,
9118
9119    /// The event type, must be `session.updated`.
9120    pub r#type: String,
9121
9122    pub r#session: RealtimeSession,
9123}
9124
9125/// Returned when a transcription session is updated with a
9126/// `transcription_session.update` event, unless there is an error.
9127#[derive(Clone, Debug)]
9128#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9129pub struct RealtimeServerEventTranscriptionSessionUpdated {
9130    /// The unique ID of the server event.
9131    pub r#event_id: String,
9132
9133    /// The event type, must be `transcription_session.updated`.
9134    pub r#type: String,
9135
9136    pub r#session: RealtimeTranscriptionSessionCreateResponse,
9137}
9138
9139/// Realtime session object configuration.
9140#[derive(Clone, Debug, Default)]
9141#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9142pub struct RealtimeSession {
9143    /// Unique identifier for the session that looks like
9144    /// `sess_1234567890abcdef`.
9145    pub r#id: Option<String>,
9146
9147    /// The set of modalities the model can respond with.
9148    pub r#modalities: Option<Vec<String>>,
9149
9150    /// The Realtime model used for this session.
9151    pub r#model: Option<String>,
9152
9153    /// The default system instructions (i.e.
9154    pub r#instructions: Option<String>,
9155
9156    /// The voice the model uses to respond.
9157    pub r#voice: Option<VoiceIdsShared>,
9158
9159    /// The format of input audio.
9160    pub r#input_audio_format: Option<String>,
9161
9162    /// The format of output audio.
9163    pub r#output_audio_format: Option<String>,
9164
9165    pub r#input_audio_transcription: Option<RealtimeSession_InputAudioTranscription>,
9166
9167    pub r#turn_detection: Option<RealtimeSession_TurnDetection>,
9168
9169    pub r#input_audio_noise_reduction: Option<RealtimeSession_InputAudioNoiseReduction>,
9170
9171    /// Tools (functions) available to the model.
9172    pub r#tools: Option<Vec<RealtimeSession_Tools>>,
9173
9174    /// How the model chooses tools.
9175    pub r#tool_choice: Option<String>,
9176
9177    /// Sampling temperature for the model, limited to [0.6, 1.2].
9178    pub r#temperature: Option<f64>,
9179
9180    pub r#max_response_output_tokens: Option<RealtimeSession_MaxResponseOutputTokens>,
9181}
9182
9183/// Realtime session object configuration.
9184#[derive(Clone, Debug, Default)]
9185#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9186pub struct RealtimeSessionCreateRequest {
9187    /// The set of modalities the model can respond with.
9188    pub r#modalities: Option<Vec<String>>,
9189
9190    /// The Realtime model used for this session.
9191    pub r#model: Option<String>,
9192
9193    /// The default system instructions (i.e.
9194    pub r#instructions: Option<String>,
9195
9196    /// The voice the model uses to respond.
9197    pub r#voice: Option<VoiceIdsShared>,
9198
9199    /// The format of input audio.
9200    pub r#input_audio_format: Option<String>,
9201
9202    /// The format of output audio.
9203    pub r#output_audio_format: Option<String>,
9204
9205    pub r#input_audio_transcription: Option<RealtimeSessionCreateRequest_InputAudioTranscription>,
9206
9207    pub r#turn_detection: Option<RealtimeSessionCreateRequest_TurnDetection>,
9208
9209    pub r#input_audio_noise_reduction: Option<RealtimeSessionCreateRequest_InputAudioNoiseReduction>,
9210
9211    /// Tools (functions) available to the model.
9212    pub r#tools: Option<Vec<RealtimeSessionCreateRequest_Tools>>,
9213
9214    /// How the model chooses tools.
9215    pub r#tool_choice: Option<String>,
9216
9217    /// Sampling temperature for the model, limited to [0.6, 1.2].
9218    pub r#temperature: Option<f64>,
9219
9220    pub r#max_response_output_tokens: Option<RealtimeSessionCreateRequest_MaxResponseOutputTokens>,
9221}
9222
9223/// Configuration for input audio noise reduction.
9224#[derive(Clone, Debug, Default)]
9225#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9226pub struct RealtimeSessionCreateRequest_InputAudioNoiseReduction {
9227    /// Type of noise reduction.
9228    pub r#type: Option<String>,
9229}
9230
9231/// Configuration for input audio transcription, defaults to off and can be  set
9232/// to `null` to turn off once on.
9233#[derive(Clone, Debug, Default)]
9234#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9235pub struct RealtimeSessionCreateRequest_InputAudioTranscription {
9236    /// The model to use for transcription, current options are
9237    /// `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
9238    pub r#model: Option<String>,
9239
9240    /// The language of the input audio.
9241    pub r#language: Option<String>,
9242
9243    /// An optional text to guide the model's style or continue a previous audio
9244    /// segment.
9245    pub r#prompt: Option<String>,
9246}
9247
9248/// Maximum number of output tokens for a single assistant response, inclusive
9249/// of tool calls.
9250#[derive(Clone, Debug)]
9251#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9252#[cfg_attr(feature = "serde", serde(untagged))]
9253pub enum RealtimeSessionCreateRequest_MaxResponseOutputTokens {
9254    Integer(i64),
9255
9256    Text(String),
9257}
9258
9259#[derive(Clone, Debug, Default)]
9260#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9261pub struct RealtimeSessionCreateRequest_Tools {
9262    /// The type of the tool, i.e.
9263    pub r#type: Option<String>,
9264
9265    /// The name of the function.
9266    pub r#name: Option<String>,
9267
9268    /// The description of the function, including guidance on when and how to
9269    /// call it, and guidance about what to tell the user when calling (if
9270    /// anything).
9271    pub r#description: Option<String>,
9272
9273    /// Parameters of the function in JSON Schema.
9274    pub r#parameters: Option<RealtimeSessionCreateRequest_Tools_Parameters>,
9275}
9276
9277/// Parameters of the function in JSON Schema.
9278#[derive(Clone, Debug, Default)]
9279#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9280pub struct RealtimeSessionCreateRequest_Tools_Parameters;
9281
9282/// Configuration for turn detection, ether Server VAD or Semantic VAD.
9283#[derive(Clone, Debug, Default)]
9284#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9285pub struct RealtimeSessionCreateRequest_TurnDetection {
9286    /// Type of turn detection.
9287    pub r#type: Option<String>,
9288
9289    /// Used only for `semantic_vad` mode.
9290    pub r#eagerness: Option<String>,
9291
9292    /// Used only for `server_vad` mode.
9293    pub r#threshold: Option<f64>,
9294
9295    /// Used only for `server_vad` mode.
9296    pub r#prefix_padding_ms: Option<i64>,
9297
9298    /// Used only for `server_vad` mode.
9299    pub r#silence_duration_ms: Option<i64>,
9300
9301    /// Whether or not to automatically generate a response when a VAD stop
9302    /// event occurs.
9303    pub r#create_response: Option<bool>,
9304
9305    /// Whether or not to automatically interrupt any ongoing response with
9306    /// output to the default conversation (i.e.
9307    pub r#interrupt_response: Option<bool>,
9308}
9309
9310/// A new Realtime session configuration, with an ephermeral key.
9311#[derive(Clone, Debug)]
9312#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9313pub struct RealtimeSessionCreateResponse {
9314    pub r#client_secret: RealtimeSessionCreateResponse_ClientSecret,
9315
9316    /// The set of modalities the model can respond with.
9317    pub r#modalities: Option<Vec<String>>,
9318
9319    /// The default system instructions (i.e.
9320    pub r#instructions: Option<String>,
9321
9322    /// The voice the model uses to respond.
9323    pub r#voice: Option<VoiceIdsShared>,
9324
9325    /// The format of input audio.
9326    pub r#input_audio_format: Option<String>,
9327
9328    /// The format of output audio.
9329    pub r#output_audio_format: Option<String>,
9330
9331    pub r#input_audio_transcription: Option<RealtimeSessionCreateResponse_InputAudioTranscription>,
9332
9333    pub r#turn_detection: Option<RealtimeSessionCreateResponse_TurnDetection>,
9334
9335    /// Tools (functions) available to the model.
9336    pub r#tools: Option<Vec<RealtimeSessionCreateResponse_Tools>>,
9337
9338    /// How the model chooses tools.
9339    pub r#tool_choice: Option<String>,
9340
9341    /// Sampling temperature for the model, limited to [0.6, 1.2].
9342    pub r#temperature: Option<f64>,
9343
9344    pub r#max_response_output_tokens: Option<RealtimeSessionCreateResponse_MaxResponseOutputTokens>,
9345}
9346
9347/// Ephemeral key returned by the API.
9348#[derive(Clone, Debug, Default)]
9349#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9350pub struct RealtimeSessionCreateResponse_ClientSecret {
9351    /// Ephemeral key usable in client environments to authenticate connections
9352    /// to the Realtime API.
9353    pub r#value: String,
9354
9355    /// Timestamp for when the token expires.
9356    pub r#expires_at: i64,
9357}
9358
9359/// Configuration for input audio transcription, defaults to off and can be set
9360/// to `null` to turn off once on.
9361#[derive(Clone, Debug, Default)]
9362#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9363pub struct RealtimeSessionCreateResponse_InputAudioTranscription {
9364    /// The model to use for transcription, `whisper-1` is the only currently
9365    /// supported model.
9366    pub r#model: Option<String>,
9367}
9368
9369/// Maximum number of output tokens for a single assistant response, inclusive
9370/// of tool calls.
9371#[derive(Clone, Debug)]
9372#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9373#[cfg_attr(feature = "serde", serde(untagged))]
9374pub enum RealtimeSessionCreateResponse_MaxResponseOutputTokens {
9375    Integer(i64),
9376
9377    Text(String),
9378}
9379
9380#[derive(Clone, Debug, Default)]
9381#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9382pub struct RealtimeSessionCreateResponse_Tools {
9383    /// The type of the tool, i.e.
9384    pub r#type: Option<String>,
9385
9386    /// The name of the function.
9387    pub r#name: Option<String>,
9388
9389    /// The description of the function, including guidance on when and how to
9390    /// call it, and guidance about what to tell the user when calling (if
9391    /// anything).
9392    pub r#description: Option<String>,
9393
9394    /// Parameters of the function in JSON Schema.
9395    pub r#parameters: Option<RealtimeSessionCreateResponse_Tools_Parameters>,
9396}
9397
9398/// Parameters of the function in JSON Schema.
9399#[derive(Clone, Debug, Default)]
9400#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9401pub struct RealtimeSessionCreateResponse_Tools_Parameters;
9402
9403/// Configuration for turn detection.
9404#[derive(Clone, Debug, Default)]
9405#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9406pub struct RealtimeSessionCreateResponse_TurnDetection {
9407    /// Type of turn detection, only `server_vad` is currently supported.
9408    pub r#type: Option<String>,
9409
9410    /// Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5.
9411    pub r#threshold: Option<f64>,
9412
9413    /// Amount of audio to include before the VAD detected speech (in
9414    /// milliseconds).
9415    pub r#prefix_padding_ms: Option<i64>,
9416
9417    /// Duration of silence to detect speech stop (in milliseconds).
9418    pub r#silence_duration_ms: Option<i64>,
9419}
9420
9421/// Configuration for input audio noise reduction.
9422#[derive(Clone, Debug, Default)]
9423#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9424pub struct RealtimeSession_InputAudioNoiseReduction {
9425    /// Type of noise reduction.
9426    pub r#type: Option<String>,
9427}
9428
9429/// Configuration for input audio transcription, defaults to off and can be  set
9430/// to `null` to turn off once on.
9431#[derive(Clone, Debug, Default)]
9432#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9433pub struct RealtimeSession_InputAudioTranscription {
9434    /// The model to use for transcription, current options are
9435    /// `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
9436    pub r#model: Option<String>,
9437
9438    /// The language of the input audio.
9439    pub r#language: Option<String>,
9440
9441    /// An optional text to guide the model's style or continue a previous audio
9442    /// segment.
9443    pub r#prompt: Option<String>,
9444}
9445
9446/// Maximum number of output tokens for a single assistant response, inclusive
9447/// of tool calls.
9448#[derive(Clone, Debug)]
9449#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9450#[cfg_attr(feature = "serde", serde(untagged))]
9451pub enum RealtimeSession_MaxResponseOutputTokens {
9452    Integer(i64),
9453
9454    Text(String),
9455}
9456
9457#[derive(Clone, Debug, Default)]
9458#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9459pub struct RealtimeSession_Tools {
9460    /// The type of the tool, i.e.
9461    pub r#type: Option<String>,
9462
9463    /// The name of the function.
9464    pub r#name: Option<String>,
9465
9466    /// The description of the function, including guidance on when and how to
9467    /// call it, and guidance about what to tell the user when calling (if
9468    /// anything).
9469    pub r#description: Option<String>,
9470
9471    /// Parameters of the function in JSON Schema.
9472    pub r#parameters: Option<RealtimeSession_Tools_Parameters>,
9473}
9474
9475/// Parameters of the function in JSON Schema.
9476#[derive(Clone, Debug, Default)]
9477#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9478pub struct RealtimeSession_Tools_Parameters;
9479
9480/// Configuration for turn detection, ether Server VAD or Semantic VAD.
9481#[derive(Clone, Debug, Default)]
9482#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9483pub struct RealtimeSession_TurnDetection {
9484    /// Type of turn detection.
9485    pub r#type: Option<String>,
9486
9487    /// Used only for `semantic_vad` mode.
9488    pub r#eagerness: Option<String>,
9489
9490    /// Used only for `server_vad` mode.
9491    pub r#threshold: Option<f64>,
9492
9493    /// Used only for `server_vad` mode.
9494    pub r#prefix_padding_ms: Option<i64>,
9495
9496    /// Used only for `server_vad` mode.
9497    pub r#silence_duration_ms: Option<i64>,
9498
9499    /// Whether or not to automatically generate a response when a VAD stop
9500    /// event occurs.
9501    pub r#create_response: Option<bool>,
9502
9503    /// Whether or not to automatically interrupt any ongoing response with
9504    /// output to the default conversation (i.e.
9505    pub r#interrupt_response: Option<bool>,
9506}
9507
9508/// Realtime transcription session object configuration.
9509#[derive(Clone, Debug, Default)]
9510#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9511pub struct RealtimeTranscriptionSessionCreateRequest {
9512    /// The set of modalities the model can respond with.
9513    pub r#modalities: Option<Vec<String>>,
9514
9515    /// The format of input audio.
9516    pub r#input_audio_format: Option<String>,
9517
9518    pub r#input_audio_transcription: Option<RealtimeTranscriptionSessionCreateRequest_InputAudioTranscription>,
9519
9520    pub r#turn_detection: Option<RealtimeTranscriptionSessionCreateRequest_TurnDetection>,
9521
9522    pub r#input_audio_noise_reduction: Option<RealtimeTranscriptionSessionCreateRequest_InputAudioNoiseReduction>,
9523
9524    /// The set of items to include in the transcription.
9525    pub r#include: Option<Vec<String>>,
9526}
9527
9528/// Configuration for input audio noise reduction.
9529#[derive(Clone, Debug, Default)]
9530#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9531pub struct RealtimeTranscriptionSessionCreateRequest_InputAudioNoiseReduction {
9532    /// Type of noise reduction.
9533    pub r#type: Option<String>,
9534}
9535
9536/// Configuration for input audio transcription.
9537#[derive(Clone, Debug, Default)]
9538#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9539pub struct RealtimeTranscriptionSessionCreateRequest_InputAudioTranscription {
9540    /// The model to use for transcription, current options are
9541    /// `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
9542    pub r#model: Option<String>,
9543
9544    /// The language of the input audio.
9545    pub r#language: Option<String>,
9546
9547    /// An optional text to guide the model's style or continue a previous audio
9548    /// segment.
9549    pub r#prompt: Option<String>,
9550}
9551
9552/// Configuration for turn detection, ether Server VAD or Semantic VAD.
9553#[derive(Clone, Debug, Default)]
9554#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9555pub struct RealtimeTranscriptionSessionCreateRequest_TurnDetection {
9556    /// Type of turn detection.
9557    pub r#type: Option<String>,
9558
9559    /// Used only for `semantic_vad` mode.
9560    pub r#eagerness: Option<String>,
9561
9562    /// Used only for `server_vad` mode.
9563    pub r#threshold: Option<f64>,
9564
9565    /// Used only for `server_vad` mode.
9566    pub r#prefix_padding_ms: Option<i64>,
9567
9568    /// Used only for `server_vad` mode.
9569    pub r#silence_duration_ms: Option<i64>,
9570
9571    /// Whether or not to automatically generate a response when a VAD stop
9572    /// event occurs.
9573    pub r#create_response: Option<bool>,
9574
9575    /// Whether or not to automatically interrupt any ongoing response with
9576    /// output to the default conversation (i.e.
9577    pub r#interrupt_response: Option<bool>,
9578}
9579
9580/// A new Realtime transcription session configuration.
9581#[derive(Clone, Debug)]
9582#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9583pub struct RealtimeTranscriptionSessionCreateResponse {
9584    pub r#client_secret: RealtimeTranscriptionSessionCreateResponse_ClientSecret,
9585
9586    /// The set of modalities the model can respond with.
9587    pub r#modalities: Option<Vec<String>>,
9588
9589    /// The format of input audio.
9590    pub r#input_audio_format: Option<String>,
9591
9592    pub r#input_audio_transcription: Option<RealtimeTranscriptionSessionCreateResponse_InputAudioTranscription>,
9593
9594    pub r#turn_detection: Option<RealtimeTranscriptionSessionCreateResponse_TurnDetection>,
9595}
9596
9597/// Ephemeral key returned by the API.
9598#[derive(Clone, Debug, Default)]
9599#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9600pub struct RealtimeTranscriptionSessionCreateResponse_ClientSecret {
9601    /// Ephemeral key usable in client environments to authenticate connections
9602    /// to the Realtime API.
9603    pub r#value: String,
9604
9605    /// Timestamp for when the token expires.
9606    pub r#expires_at: i64,
9607}
9608
9609/// Configuration of the transcription model.
9610#[derive(Clone, Debug, Default)]
9611#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9612pub struct RealtimeTranscriptionSessionCreateResponse_InputAudioTranscription {
9613    /// The model to use for transcription.
9614    pub r#model: Option<String>,
9615
9616    /// The language of the input audio.
9617    pub r#language: Option<String>,
9618
9619    /// An optional text to guide the model's style or continue a previous audio
9620    /// segment.
9621    pub r#prompt: Option<String>,
9622}
9623
9624/// Configuration for turn detection.
9625#[derive(Clone, Debug, Default)]
9626#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9627pub struct RealtimeTranscriptionSessionCreateResponse_TurnDetection {
9628    /// Type of turn detection, only `server_vad` is currently supported.
9629    pub r#type: Option<String>,
9630
9631    /// Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5.
9632    pub r#threshold: Option<f64>,
9633
9634    /// Amount of audio to include before the VAD detected speech (in
9635    /// milliseconds).
9636    pub r#prefix_padding_ms: Option<i64>,
9637
9638    /// Duration of silence to detect speech stop (in milliseconds).
9639    pub r#silence_duration_ms: Option<i64>,
9640}
9641
9642/// **o-series models only** Configuration options for [reasoning
9643/// models](https://platform.openai.com/docs/guides/reasoning).
9644#[derive(Clone, Debug, Default)]
9645#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9646pub struct Reasoning {
9647    pub r#effort: Option<ReasoningEffort>,
9648
9649    /// A summary of the reasoning performed by the model.
9650    pub r#summary: Option<String>,
9651
9652    /// **Deprecated:** use `summary` instead.
9653    pub r#generate_summary: Option<String>,
9654}
9655
9656/// **o-series models only** Constrains effort on reasoning for [reasoning
9657/// models](https://platform.openai.com/docs/guides/reasoning).
9658#[derive(Clone, Debug)]
9659#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9660pub enum ReasoningEffort {
9661    #[cfg_attr(feature = "serde", serde(rename = "low"))]
9662    Low,
9663
9664    #[cfg_attr(feature = "serde", serde(rename = "medium"))]
9665    Medium,
9666
9667    #[cfg_attr(feature = "serde", serde(rename = "high"))]
9668    High,
9669
9670    #[cfg_attr(feature = "serde", serde(untagged))]
9671    Other(String),
9672}
9673
9674/// A description of the chain of thought used by a reasoning model while
9675/// generating a response.
9676#[derive(Clone, Debug, Default)]
9677#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9678pub struct ReasoningItem {
9679    /// The type of the object.
9680    pub r#type: String,
9681
9682    /// The unique identifier of the reasoning content.
9683    pub r#id: String,
9684
9685    /// Reasoning text contents.
9686    pub r#summary: Vec<ReasoningItem_Summary>,
9687
9688    /// The status of the item.
9689    pub r#status: Option<String>,
9690}
9691
9692#[derive(Clone, Debug, Default)]
9693#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9694pub struct ReasoningItem_Summary {
9695    /// The type of the object.
9696    pub r#type: String,
9697
9698    /// A short summary of the reasoning used by the model when generating the
9699    /// response.
9700    pub r#text: String,
9701}
9702
9703/// A refusal from the model.
9704#[derive(Clone, Debug, Default)]
9705#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9706pub struct RefusalContent {
9707    /// The type of the refusal.
9708    pub r#type: String,
9709
9710    /// The refusal explanationfrom the model.
9711    pub r#refusal: String,
9712}
9713
9714#[derive(Clone, Debug)]
9715#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9716pub struct Response {
9717    pub r#metadata: Option<Metadata>,
9718
9719    /// What sampling temperature to use, between 0 and 2.
9720    pub r#temperature: Option<f64>,
9721
9722    /// An alternative to sampling with temperature, called nucleus sampling,
9723    /// where the model considers the results of the tokens with top_p
9724    /// probability mass.
9725    pub r#top_p: Option<f64>,
9726
9727    /// A unique identifier representing your end-user, which can help OpenAI to
9728    /// monitor and detect abuse.
9729    pub r#user: Option<String>,
9730
9731    pub r#service_tier: Option<ServiceTier>,
9732
9733    /// The unique ID of the previous response to the model.
9734    pub r#previous_response_id: Option<String>,
9735
9736    /// Model ID used to generate the response, like `gpt-4o` or `o3`.
9737    pub r#model: ModelIdsResponses,
9738
9739    pub r#reasoning: Option<Reasoning>,
9740
9741    /// An upper bound for the number of tokens that can be generated for a
9742    /// response, including visible output tokens and [reasoning
9743    /// tokens](/docs/guides/reasoning).
9744    pub r#max_output_tokens: Option<i64>,
9745
9746    /// Inserts a system (or developer) message as the first item in the model's
9747    /// context.
9748    pub r#instructions: Option<String>,
9749
9750    pub r#text: Option<ResponseProperties_Text>,
9751
9752    /// An array of tools the model may call while generating a response.
9753    pub r#tools: Vec<Tool>,
9754
9755    pub r#tool_choice: ResponseProperties_ToolChoice,
9756
9757    /// The truncation strategy to use for the model response.
9758    pub r#truncation: Option<String>,
9759
9760    /// Unique identifier for this Response.
9761    pub r#id: String,
9762
9763    /// The object type of this resource - always set to `response`.
9764    pub r#object: String,
9765
9766    /// The status of the response generation.
9767    pub r#status: Option<String>,
9768
9769    /// Unix timestamp (in seconds) of when this Response was created.
9770    pub r#created_at: f64,
9771
9772    pub r#error: Option<ResponseError>,
9773
9774    pub r#incomplete_details: Option<Response_Variant3_IncompleteDetails>,
9775
9776    /// An array of content items generated by the model.
9777    pub r#output: Vec<OutputItem>,
9778
9779    /// SDK-only convenience property that contains the aggregated text output
9780    /// from all `output_text` items in the `output` array, if any are present.
9781    pub r#output_text: Option<String>,
9782
9783    pub r#usage: Option<ResponseUsage>,
9784
9785    /// Whether to allow the model to run tool calls in parallel.
9786    pub r#parallel_tool_calls: bool,
9787}
9788
9789/// Emitted when there is a partial audio response.
9790#[derive(Clone, Debug, Default)]
9791#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9792pub struct ResponseAudioDeltaEvent {
9793    /// The type of the event.
9794    pub r#type: String,
9795
9796    /// A chunk of Base64 encoded response audio bytes.
9797    pub r#delta: String,
9798}
9799
9800/// Emitted when the audio response is complete.
9801#[derive(Clone, Debug, Default)]
9802#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9803pub struct ResponseAudioDoneEvent {
9804    /// The type of the event.
9805    pub r#type: String,
9806}
9807
9808/// Emitted when there is a partial transcript of audio.
9809#[derive(Clone, Debug, Default)]
9810#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9811pub struct ResponseAudioTranscriptDeltaEvent {
9812    /// The type of the event.
9813    pub r#type: String,
9814
9815    /// The partial transcript of the audio response.
9816    pub r#delta: String,
9817}
9818
9819/// Emitted when the full audio transcript is completed.
9820#[derive(Clone, Debug, Default)]
9821#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9822pub struct ResponseAudioTranscriptDoneEvent {
9823    /// The type of the event.
9824    pub r#type: String,
9825}
9826
9827/// Emitted when a partial code snippet is added by the code interpreter.
9828#[derive(Clone, Debug, Default)]
9829#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9830pub struct ResponseCodeInterpreterCallCodeDeltaEvent {
9831    /// The type of the event.
9832    pub r#type: String,
9833
9834    /// The index of the output item that the code interpreter call is in
9835    /// progress.
9836    pub r#output_index: i64,
9837
9838    /// The partial code snippet added by the code interpreter.
9839    pub r#delta: String,
9840}
9841
9842/// Emitted when code snippet output is finalized by the code interpreter.
9843#[derive(Clone, Debug, Default)]
9844#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9845pub struct ResponseCodeInterpreterCallCodeDoneEvent {
9846    /// The type of the event.
9847    pub r#type: String,
9848
9849    /// The index of the output item that the code interpreter call is in
9850    /// progress.
9851    pub r#output_index: i64,
9852
9853    /// The final code snippet output by the code interpreter.
9854    pub r#code: String,
9855}
9856
9857/// Emitted when the code interpreter call is completed.
9858#[derive(Clone, Debug)]
9859#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9860pub struct ResponseCodeInterpreterCallCompletedEvent {
9861    /// The type of the event.
9862    pub r#type: String,
9863
9864    /// The index of the output item that the code interpreter call is in
9865    /// progress.
9866    pub r#output_index: i64,
9867
9868    pub r#code_interpreter_call: CodeInterpreterToolCall,
9869}
9870
9871/// Emitted when a code interpreter call is in progress.
9872#[derive(Clone, Debug)]
9873#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9874pub struct ResponseCodeInterpreterCallInProgressEvent {
9875    /// The type of the event.
9876    pub r#type: String,
9877
9878    /// The index of the output item that the code interpreter call is in
9879    /// progress.
9880    pub r#output_index: i64,
9881
9882    pub r#code_interpreter_call: CodeInterpreterToolCall,
9883}
9884
9885/// Emitted when the code interpreter is actively interpreting the code snippet.
9886#[derive(Clone, Debug)]
9887#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9888pub struct ResponseCodeInterpreterCallInterpretingEvent {
9889    /// The type of the event.
9890    pub r#type: String,
9891
9892    /// The index of the output item that the code interpreter call is in
9893    /// progress.
9894    pub r#output_index: i64,
9895
9896    pub r#code_interpreter_call: CodeInterpreterToolCall,
9897}
9898
9899/// Emitted when the model response is complete.
9900#[derive(Clone, Debug)]
9901#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9902pub struct ResponseCompletedEvent {
9903    /// The type of the event.
9904    pub r#type: String,
9905
9906    /// Properties of the completed response.
9907    pub r#response: Response,
9908}
9909
9910/// Emitted when a new content part is added.
9911#[derive(Clone, Debug)]
9912#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9913pub struct ResponseContentPartAddedEvent {
9914    /// The type of the event.
9915    pub r#type: String,
9916
9917    /// The ID of the output item that the content part was added to.
9918    pub r#item_id: String,
9919
9920    /// The index of the output item that the content part was added to.
9921    pub r#output_index: i64,
9922
9923    /// The index of the content part that was added.
9924    pub r#content_index: i64,
9925
9926    /// The content part that was added.
9927    pub r#part: OutputContent,
9928}
9929
9930/// Emitted when a content part is done.
9931#[derive(Clone, Debug)]
9932#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9933pub struct ResponseContentPartDoneEvent {
9934    /// The type of the event.
9935    pub r#type: String,
9936
9937    /// The ID of the output item that the content part was added to.
9938    pub r#item_id: String,
9939
9940    /// The index of the output item that the content part was added to.
9941    pub r#output_index: i64,
9942
9943    /// The index of the content part that is done.
9944    pub r#content_index: i64,
9945
9946    /// The content part that is done.
9947    pub r#part: OutputContent,
9948}
9949
9950/// An event that is emitted when a response is created.
9951#[derive(Clone, Debug)]
9952#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9953pub struct ResponseCreatedEvent {
9954    /// The type of the event.
9955    pub r#type: String,
9956
9957    /// The response that was created.
9958    pub r#response: Response,
9959}
9960
9961/// An error object returned when the model fails to generate a Response.
9962#[derive(Clone, Debug)]
9963#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9964pub struct ResponseError {
9965    pub r#code: ResponseErrorCode,
9966
9967    /// A human-readable description of the error.
9968    pub r#message: String,
9969}
9970
9971/// The error code for the response.
9972#[derive(Clone, Debug)]
9973#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9974pub enum ResponseErrorCode {
9975    #[cfg_attr(feature = "serde", serde(rename = "server_error"))]
9976    ServerError,
9977
9978    #[cfg_attr(feature = "serde", serde(rename = "rate_limit_exceeded"))]
9979    RateLimitExceeded,
9980
9981    #[cfg_attr(feature = "serde", serde(rename = "invalid_prompt"))]
9982    InvalidPrompt,
9983
9984    #[cfg_attr(feature = "serde", serde(rename = "vector_store_timeout"))]
9985    VectorStoreTimeout,
9986
9987    #[cfg_attr(feature = "serde", serde(rename = "invalid_image"))]
9988    InvalidImage,
9989
9990    #[cfg_attr(feature = "serde", serde(rename = "invalid_image_format"))]
9991    InvalidImageFormat,
9992
9993    #[cfg_attr(feature = "serde", serde(rename = "invalid_base64_image"))]
9994    InvalidBase64Image,
9995
9996    #[cfg_attr(feature = "serde", serde(rename = "invalid_image_url"))]
9997    InvalidImageUrl,
9998
9999    #[cfg_attr(feature = "serde", serde(rename = "image_too_large"))]
10000    ImageTooLarge,
10001
10002    #[cfg_attr(feature = "serde", serde(rename = "image_too_small"))]
10003    ImageTooSmall,
10004
10005    #[cfg_attr(feature = "serde", serde(rename = "image_parse_error"))]
10006    ImageParseError,
10007
10008    #[cfg_attr(feature = "serde", serde(rename = "image_content_policy_violation"))]
10009    ImageContentPolicyViolation,
10010
10011    #[cfg_attr(feature = "serde", serde(rename = "invalid_image_mode"))]
10012    InvalidImageMode,
10013
10014    #[cfg_attr(feature = "serde", serde(rename = "image_file_too_large"))]
10015    ImageFileTooLarge,
10016
10017    #[cfg_attr(feature = "serde", serde(rename = "unsupported_image_media_type"))]
10018    UnsupportedImageMediaType,
10019
10020    #[cfg_attr(feature = "serde", serde(rename = "empty_image_file"))]
10021    EmptyImageFile,
10022
10023    #[cfg_attr(feature = "serde", serde(rename = "failed_to_download_image"))]
10024    FailedToDownloadImage,
10025
10026    #[cfg_attr(feature = "serde", serde(rename = "image_file_not_found"))]
10027    ImageFileNotFound,
10028
10029    #[cfg_attr(feature = "serde", serde(untagged))]
10030    Other(String),
10031}
10032
10033/// Emitted when an error occurs.
10034#[derive(Clone, Debug, Default)]
10035#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10036pub struct ResponseErrorEvent {
10037    /// The type of the event.
10038    pub r#type: String,
10039
10040    /// The error code.
10041    pub r#code: Option<String>,
10042
10043    /// The error message.
10044    pub r#message: String,
10045
10046    /// The error parameter.
10047    pub r#param: Option<String>,
10048}
10049
10050/// An event that is emitted when a response fails.
10051#[derive(Clone, Debug)]
10052#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10053pub struct ResponseFailedEvent {
10054    /// The type of the event.
10055    pub r#type: String,
10056
10057    /// The response that failed.
10058    pub r#response: Response,
10059}
10060
10061/// Emitted when a file search call is completed (results found).
10062#[derive(Clone, Debug, Default)]
10063#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10064pub struct ResponseFileSearchCallCompletedEvent {
10065    /// The type of the event.
10066    pub r#type: String,
10067
10068    /// The index of the output item that the file search call is initiated.
10069    pub r#output_index: i64,
10070
10071    /// The ID of the output item that the file search call is initiated.
10072    pub r#item_id: String,
10073}
10074
10075/// Emitted when a file search call is initiated.
10076#[derive(Clone, Debug, Default)]
10077#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10078pub struct ResponseFileSearchCallInProgressEvent {
10079    /// The type of the event.
10080    pub r#type: String,
10081
10082    /// The index of the output item that the file search call is initiated.
10083    pub r#output_index: i64,
10084
10085    /// The ID of the output item that the file search call is initiated.
10086    pub r#item_id: String,
10087}
10088
10089/// Emitted when a file search is currently searching.
10090#[derive(Clone, Debug, Default)]
10091#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10092pub struct ResponseFileSearchCallSearchingEvent {
10093    /// The type of the event.
10094    pub r#type: String,
10095
10096    /// The index of the output item that the file search call is searching.
10097    pub r#output_index: i64,
10098
10099    /// The ID of the output item that the file search call is initiated.
10100    pub r#item_id: String,
10101}
10102
10103/// JSON object response format.
10104#[derive(Clone, Debug, Default)]
10105#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10106pub struct ResponseFormatJsonObject {
10107    /// The type of response format being defined.
10108    pub r#type: String,
10109}
10110
10111/// JSON Schema response format.
10112#[derive(Clone, Debug)]
10113#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10114pub struct ResponseFormatJsonSchema {
10115    /// The type of response format being defined.
10116    pub r#type: String,
10117
10118    pub r#json_schema: ResponseFormatJsonSchema_JsonSchema,
10119}
10120
10121/// The schema for the response format, described as a JSON Schema object.
10122#[derive(Clone, Debug, Default)]
10123#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10124pub struct ResponseFormatJsonSchemaSchema;
10125
10126/// Structured Outputs configuration options, including a JSON Schema.
10127#[derive(Clone, Debug, Default)]
10128#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10129pub struct ResponseFormatJsonSchema_JsonSchema {
10130    /// A description of what the response format is for, used by the model to
10131    /// determine how to respond in the format.
10132    pub r#description: Option<String>,
10133
10134    /// The name of the response format.
10135    pub r#name: String,
10136
10137    pub r#schema: Option<ResponseFormatJsonSchemaSchema>,
10138
10139    /// Whether to enable strict schema adherence when generating the output.
10140    pub r#strict: Option<bool>,
10141}
10142
10143/// Default response format.
10144#[derive(Clone, Debug, Default)]
10145#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10146pub struct ResponseFormatText {
10147    /// The type of response format being defined.
10148    pub r#type: String,
10149}
10150
10151/// Emitted when there is a partial function-call arguments delta.
10152#[derive(Clone, Debug, Default)]
10153#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10154pub struct ResponseFunctionCallArgumentsDeltaEvent {
10155    /// The type of the event.
10156    pub r#type: String,
10157
10158    /// The ID of the output item that the function-call arguments delta is
10159    /// added to.
10160    pub r#item_id: String,
10161
10162    /// The index of the output item that the function-call arguments delta is
10163    /// added to.
10164    pub r#output_index: i64,
10165
10166    /// The function-call arguments delta that is added.
10167    pub r#delta: String,
10168}
10169
10170/// Emitted when function-call arguments are finalized.
10171#[derive(Clone, Debug, Default)]
10172#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10173pub struct ResponseFunctionCallArgumentsDoneEvent {
10174    pub r#type: String,
10175
10176    /// The ID of the item.
10177    pub r#item_id: String,
10178
10179    /// The index of the output item.
10180    pub r#output_index: i64,
10181
10182    /// The function-call arguments.
10183    pub r#arguments: String,
10184}
10185
10186/// Emitted when the response is in progress.
10187#[derive(Clone, Debug)]
10188#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10189pub struct ResponseInProgressEvent {
10190    /// The type of the event.
10191    pub r#type: String,
10192
10193    /// The response that is in progress.
10194    pub r#response: Response,
10195}
10196
10197/// An event that is emitted when a response finishes as incomplete.
10198#[derive(Clone, Debug)]
10199#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10200pub struct ResponseIncompleteEvent {
10201    /// The type of the event.
10202    pub r#type: String,
10203
10204    /// The response that was incomplete.
10205    pub r#response: Response,
10206}
10207
10208/// A list of Response items.
10209#[derive(Clone, Debug, Default)]
10210#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10211pub struct ResponseItemList {
10212    /// The type of object returned, must be `list`.
10213    pub r#object: String,
10214
10215    /// A list of items used to generate this response.
10216    pub r#data: Vec<ItemResource>,
10217
10218    /// Whether there are more items available.
10219    pub r#has_more: bool,
10220
10221    /// The ID of the first item in the list.
10222    pub r#first_id: String,
10223
10224    /// The ID of the last item in the list.
10225    pub r#last_id: String,
10226}
10227
10228/// Output types that you would like the model to generate.
10229pub type ResponseModalities = Vec<String>;
10230
10231/// Emitted when a new output item is added.
10232#[derive(Clone, Debug)]
10233#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10234pub struct ResponseOutputItemAddedEvent {
10235    /// The type of the event.
10236    pub r#type: String,
10237
10238    /// The index of the output item that was added.
10239    pub r#output_index: i64,
10240
10241    /// The output item that was added.
10242    pub r#item: OutputItem,
10243}
10244
10245/// Emitted when an output item is marked done.
10246#[derive(Clone, Debug)]
10247#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10248pub struct ResponseOutputItemDoneEvent {
10249    /// The type of the event.
10250    pub r#type: String,
10251
10252    /// The index of the output item that was marked done.
10253    pub r#output_index: i64,
10254
10255    /// The output item that was marked done.
10256    pub r#item: OutputItem,
10257}
10258
10259#[derive(Clone, Debug, Default)]
10260#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10261pub struct ResponseProperties {
10262    /// The unique ID of the previous response to the model.
10263    pub r#previous_response_id: Option<String>,
10264
10265    /// Model ID used to generate the response, like `gpt-4o` or `o3`.
10266    pub r#model: Option<ModelIdsResponses>,
10267
10268    pub r#reasoning: Option<Reasoning>,
10269
10270    /// An upper bound for the number of tokens that can be generated for a
10271    /// response, including visible output tokens and [reasoning
10272    /// tokens](/docs/guides/reasoning).
10273    pub r#max_output_tokens: Option<i64>,
10274
10275    /// Inserts a system (or developer) message as the first item in the model's
10276    /// context.
10277    pub r#instructions: Option<String>,
10278
10279    pub r#text: Option<ResponseProperties_Text>,
10280
10281    /// An array of tools the model may call while generating a response.
10282    pub r#tools: Option<Vec<Tool>>,
10283
10284    pub r#tool_choice: Option<ResponseProperties_ToolChoice>,
10285
10286    /// The truncation strategy to use for the model response.
10287    pub r#truncation: Option<String>,
10288}
10289
10290/// Configuration options for a text response from the model.
10291#[derive(Clone, Debug, Default)]
10292#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10293pub struct ResponseProperties_Text {
10294    pub r#format: Option<TextResponseFormatConfiguration>,
10295}
10296
10297/// How the model should select which tool (or tools) to use when generating a
10298/// response.
10299#[derive(Clone, Debug)]
10300#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10301#[cfg_attr(feature = "serde", serde(untagged))]
10302pub enum ResponseProperties_ToolChoice {
10303    ToolChoiceOptions(ToolChoiceOptions),
10304
10305    ToolChoiceTypes(ToolChoiceTypes),
10306
10307    ToolChoiceFunction(ToolChoiceFunction),
10308}
10309
10310/// Emitted when a new reasoning summary part is added.
10311#[derive(Clone, Debug)]
10312#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10313pub struct ResponseReasoningSummaryPartAddedEvent {
10314    /// The type of the event.
10315    pub r#type: String,
10316
10317    /// The ID of the item this summary part is associated with.
10318    pub r#item_id: String,
10319
10320    /// The index of the output item this summary part is associated with.
10321    pub r#output_index: i64,
10322
10323    /// The index of the summary part within the reasoning summary.
10324    pub r#summary_index: i64,
10325
10326    pub r#part: ResponseReasoningSummaryPartAddedEvent_Part,
10327}
10328
10329/// The summary part that was added.
10330#[derive(Clone, Debug, Default)]
10331#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10332pub struct ResponseReasoningSummaryPartAddedEvent_Part {
10333    /// The type of the summary part.
10334    pub r#type: String,
10335
10336    /// The text of the summary part.
10337    pub r#text: String,
10338}
10339
10340/// Emitted when a reasoning summary part is completed.
10341#[derive(Clone, Debug)]
10342#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10343pub struct ResponseReasoningSummaryPartDoneEvent {
10344    /// The type of the event.
10345    pub r#type: String,
10346
10347    /// The ID of the item this summary part is associated with.
10348    pub r#item_id: String,
10349
10350    /// The index of the output item this summary part is associated with.
10351    pub r#output_index: i64,
10352
10353    /// The index of the summary part within the reasoning summary.
10354    pub r#summary_index: i64,
10355
10356    pub r#part: ResponseReasoningSummaryPartDoneEvent_Part,
10357}
10358
10359/// The completed summary part.
10360#[derive(Clone, Debug, Default)]
10361#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10362pub struct ResponseReasoningSummaryPartDoneEvent_Part {
10363    /// The type of the summary part.
10364    pub r#type: String,
10365
10366    /// The text of the summary part.
10367    pub r#text: String,
10368}
10369
10370/// Emitted when a delta is added to a reasoning summary text.
10371#[derive(Clone, Debug, Default)]
10372#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10373pub struct ResponseReasoningSummaryTextDeltaEvent {
10374    /// The type of the event.
10375    pub r#type: String,
10376
10377    /// The ID of the item this summary text delta is associated with.
10378    pub r#item_id: String,
10379
10380    /// The index of the output item this summary text delta is associated with.
10381    pub r#output_index: i64,
10382
10383    /// The index of the summary part within the reasoning summary.
10384    pub r#summary_index: i64,
10385
10386    /// The text delta that was added to the summary.
10387    pub r#delta: String,
10388}
10389
10390/// Emitted when a reasoning summary text is completed.
10391#[derive(Clone, Debug, Default)]
10392#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10393pub struct ResponseReasoningSummaryTextDoneEvent {
10394    /// The type of the event.
10395    pub r#type: String,
10396
10397    /// The ID of the item this summary text is associated with.
10398    pub r#item_id: String,
10399
10400    /// The index of the output item this summary text is associated with.
10401    pub r#output_index: i64,
10402
10403    /// The index of the summary part within the reasoning summary.
10404    pub r#summary_index: i64,
10405
10406    /// The full text of the completed reasoning summary.
10407    pub r#text: String,
10408}
10409
10410/// Emitted when there is a partial refusal text.
10411#[derive(Clone, Debug, Default)]
10412#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10413pub struct ResponseRefusalDeltaEvent {
10414    /// The type of the event.
10415    pub r#type: String,
10416
10417    /// The ID of the output item that the refusal text is added to.
10418    pub r#item_id: String,
10419
10420    /// The index of the output item that the refusal text is added to.
10421    pub r#output_index: i64,
10422
10423    /// The index of the content part that the refusal text is added to.
10424    pub r#content_index: i64,
10425
10426    /// The refusal text that is added.
10427    pub r#delta: String,
10428}
10429
10430/// Emitted when refusal text is finalized.
10431#[derive(Clone, Debug, Default)]
10432#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10433pub struct ResponseRefusalDoneEvent {
10434    /// The type of the event.
10435    pub r#type: String,
10436
10437    /// The ID of the output item that the refusal text is finalized.
10438    pub r#item_id: String,
10439
10440    /// The index of the output item that the refusal text is finalized.
10441    pub r#output_index: i64,
10442
10443    /// The index of the content part that the refusal text is finalized.
10444    pub r#content_index: i64,
10445
10446    /// The refusal text that is finalized.
10447    pub r#refusal: String,
10448}
10449
10450#[derive(Clone, Debug)]
10451#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10452#[cfg_attr(feature = "serde", serde(untagged))]
10453pub enum ResponseStreamEvent {
10454    ResponseAudioDeltaEvent(ResponseAudioDeltaEvent),
10455
10456    ResponseAudioDoneEvent(ResponseAudioDoneEvent),
10457
10458    ResponseAudioTranscriptDeltaEvent(ResponseAudioTranscriptDeltaEvent),
10459
10460    ResponseAudioTranscriptDoneEvent(ResponseAudioTranscriptDoneEvent),
10461
10462    ResponseCodeInterpreterCallCodeDeltaEvent(ResponseCodeInterpreterCallCodeDeltaEvent),
10463
10464    ResponseCodeInterpreterCallCodeDoneEvent(ResponseCodeInterpreterCallCodeDoneEvent),
10465
10466    ResponseCodeInterpreterCallCompletedEvent(ResponseCodeInterpreterCallCompletedEvent),
10467
10468    ResponseCodeInterpreterCallInProgressEvent(ResponseCodeInterpreterCallInProgressEvent),
10469
10470    ResponseCodeInterpreterCallInterpretingEvent(ResponseCodeInterpreterCallInterpretingEvent),
10471
10472    ResponseCompletedEvent(ResponseCompletedEvent),
10473
10474    ResponseContentPartAddedEvent(ResponseContentPartAddedEvent),
10475
10476    ResponseContentPartDoneEvent(ResponseContentPartDoneEvent),
10477
10478    ResponseCreatedEvent(ResponseCreatedEvent),
10479
10480    ResponseErrorEvent(ResponseErrorEvent),
10481
10482    ResponseFileSearchCallCompletedEvent(ResponseFileSearchCallCompletedEvent),
10483
10484    ResponseFileSearchCallInProgressEvent(ResponseFileSearchCallInProgressEvent),
10485
10486    ResponseFileSearchCallSearchingEvent(ResponseFileSearchCallSearchingEvent),
10487
10488    ResponseFunctionCallArgumentsDeltaEvent(ResponseFunctionCallArgumentsDeltaEvent),
10489
10490    ResponseFunctionCallArgumentsDoneEvent(ResponseFunctionCallArgumentsDoneEvent),
10491
10492    ResponseInProgressEvent(ResponseInProgressEvent),
10493
10494    ResponseFailedEvent(ResponseFailedEvent),
10495
10496    ResponseIncompleteEvent(ResponseIncompleteEvent),
10497
10498    ResponseOutputItemAddedEvent(ResponseOutputItemAddedEvent),
10499
10500    ResponseOutputItemDoneEvent(ResponseOutputItemDoneEvent),
10501
10502    ResponseReasoningSummaryPartAddedEvent(ResponseReasoningSummaryPartAddedEvent),
10503
10504    ResponseReasoningSummaryPartDoneEvent(ResponseReasoningSummaryPartDoneEvent),
10505
10506    ResponseReasoningSummaryTextDeltaEvent(ResponseReasoningSummaryTextDeltaEvent),
10507
10508    ResponseReasoningSummaryTextDoneEvent(ResponseReasoningSummaryTextDoneEvent),
10509
10510    ResponseRefusalDeltaEvent(ResponseRefusalDeltaEvent),
10511
10512    ResponseRefusalDoneEvent(ResponseRefusalDoneEvent),
10513
10514    ResponseTextAnnotationDeltaEvent(ResponseTextAnnotationDeltaEvent),
10515
10516    ResponseTextDeltaEvent(ResponseTextDeltaEvent),
10517
10518    ResponseTextDoneEvent(ResponseTextDoneEvent),
10519
10520    ResponseWebSearchCallCompletedEvent(ResponseWebSearchCallCompletedEvent),
10521
10522    ResponseWebSearchCallInProgressEvent(ResponseWebSearchCallInProgressEvent),
10523
10524    ResponseWebSearchCallSearchingEvent(ResponseWebSearchCallSearchingEvent),
10525}
10526
10527/// Emitted when a text annotation is added.
10528#[derive(Clone, Debug)]
10529#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10530pub struct ResponseTextAnnotationDeltaEvent {
10531    /// The type of the event.
10532    pub r#type: String,
10533
10534    /// The ID of the output item that the text annotation was added to.
10535    pub r#item_id: String,
10536
10537    /// The index of the output item that the text annotation was added to.
10538    pub r#output_index: i64,
10539
10540    /// The index of the content part that the text annotation was added to.
10541    pub r#content_index: i64,
10542
10543    /// The index of the annotation that was added.
10544    pub r#annotation_index: i64,
10545
10546    pub r#annotation: Annotation,
10547}
10548
10549/// Emitted when there is an additional text delta.
10550#[derive(Clone, Debug, Default)]
10551#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10552pub struct ResponseTextDeltaEvent {
10553    /// The type of the event.
10554    pub r#type: String,
10555
10556    /// The ID of the output item that the text delta was added to.
10557    pub r#item_id: String,
10558
10559    /// The index of the output item that the text delta was added to.
10560    pub r#output_index: i64,
10561
10562    /// The index of the content part that the text delta was added to.
10563    pub r#content_index: i64,
10564
10565    /// The text delta that was added.
10566    pub r#delta: String,
10567}
10568
10569/// Emitted when text content is finalized.
10570#[derive(Clone, Debug, Default)]
10571#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10572pub struct ResponseTextDoneEvent {
10573    /// The type of the event.
10574    pub r#type: String,
10575
10576    /// The ID of the output item that the text content is finalized.
10577    pub r#item_id: String,
10578
10579    /// The index of the output item that the text content is finalized.
10580    pub r#output_index: i64,
10581
10582    /// The index of the content part that the text content is finalized.
10583    pub r#content_index: i64,
10584
10585    /// The text content that is finalized.
10586    pub r#text: String,
10587}
10588
10589/// Represents token usage details including input tokens, output tokens, a
10590/// breakdown of output tokens, and the total tokens used.
10591#[derive(Clone, Debug)]
10592#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10593pub struct ResponseUsage {
10594    /// The number of input tokens.
10595    pub r#input_tokens: i64,
10596
10597    pub r#input_tokens_details: ResponseUsage_InputTokensDetails,
10598
10599    /// The number of output tokens.
10600    pub r#output_tokens: i64,
10601
10602    pub r#output_tokens_details: ResponseUsage_OutputTokensDetails,
10603
10604    /// The total number of tokens used.
10605    pub r#total_tokens: i64,
10606}
10607
10608/// A detailed breakdown of the input tokens.
10609#[derive(Clone, Debug, Default)]
10610#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10611pub struct ResponseUsage_InputTokensDetails {
10612    /// The number of tokens that were retrieved from the cache.
10613    pub r#cached_tokens: i64,
10614}
10615
10616/// A detailed breakdown of the output tokens.
10617#[derive(Clone, Debug, Default)]
10618#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10619pub struct ResponseUsage_OutputTokensDetails {
10620    /// The number of reasoning tokens.
10621    pub r#reasoning_tokens: i64,
10622}
10623
10624/// Emitted when a web search call is completed.
10625#[derive(Clone, Debug, Default)]
10626#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10627pub struct ResponseWebSearchCallCompletedEvent {
10628    /// The type of the event.
10629    pub r#type: String,
10630
10631    /// The index of the output item that the web search call is associated
10632    /// with.
10633    pub r#output_index: i64,
10634
10635    /// Unique ID for the output item associated with the web search call.
10636    pub r#item_id: String,
10637}
10638
10639/// Emitted when a web search call is initiated.
10640#[derive(Clone, Debug, Default)]
10641#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10642pub struct ResponseWebSearchCallInProgressEvent {
10643    /// The type of the event.
10644    pub r#type: String,
10645
10646    /// The index of the output item that the web search call is associated
10647    /// with.
10648    pub r#output_index: i64,
10649
10650    /// Unique ID for the output item associated with the web search call.
10651    pub r#item_id: String,
10652}
10653
10654/// Emitted when a web search call is executing.
10655#[derive(Clone, Debug, Default)]
10656#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10657pub struct ResponseWebSearchCallSearchingEvent {
10658    /// The type of the event.
10659    pub r#type: String,
10660
10661    /// The index of the output item that the web search call is associated
10662    /// with.
10663    pub r#output_index: i64,
10664
10665    /// Unique ID for the output item associated with the web search call.
10666    pub r#item_id: String,
10667}
10668
10669#[derive(Clone, Debug, Default)]
10670#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10671pub struct Response_Variant3 {
10672    /// Unique identifier for this Response.
10673    pub r#id: String,
10674
10675    /// The object type of this resource - always set to `response`.
10676    pub r#object: String,
10677
10678    /// The status of the response generation.
10679    pub r#status: Option<String>,
10680
10681    /// Unix timestamp (in seconds) of when this Response was created.
10682    pub r#created_at: f64,
10683
10684    pub r#error: Option<ResponseError>,
10685
10686    pub r#incomplete_details: Option<Response_Variant3_IncompleteDetails>,
10687
10688    /// An array of content items generated by the model.
10689    pub r#output: Vec<OutputItem>,
10690
10691    /// SDK-only convenience property that contains the aggregated text output
10692    /// from all `output_text` items in the `output` array, if any are present.
10693    pub r#output_text: Option<String>,
10694
10695    pub r#usage: Option<ResponseUsage>,
10696
10697    /// Whether to allow the model to run tool calls in parallel.
10698    pub r#parallel_tool_calls: bool,
10699}
10700
10701/// Details about why the response is incomplete.
10702#[derive(Clone, Debug, Default)]
10703#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10704pub struct Response_Variant3_IncompleteDetails {
10705    /// The reason why the response is incomplete.
10706    pub r#reason: Option<String>,
10707}
10708
10709/// Usage statistics related to the run.
10710#[derive(Clone, Debug, Default)]
10711#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10712pub struct RunCompletionUsage {
10713    /// Number of completion tokens used over the course of the run.
10714    pub r#completion_tokens: i64,
10715
10716    /// Number of prompt tokens used over the course of the run.
10717    pub r#prompt_tokens: i64,
10718
10719    /// Total number of tokens used (prompt + completion).
10720    pub r#total_tokens: i64,
10721}
10722
10723/// Represents an execution run on a [thread](/docs/api-reference/threads).
10724#[derive(Clone, Debug)]
10725#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10726pub struct RunObject {
10727    /// The identifier, which can be referenced in API endpoints.
10728    pub r#id: String,
10729
10730    /// The object type, which is always `thread.run`.
10731    pub r#object: String,
10732
10733    /// The Unix timestamp (in seconds) for when the run was created.
10734    pub r#created_at: i64,
10735
10736    /// The ID of the [thread](/docs/api-reference/threads) that was executed on
10737    /// as a part of this run.
10738    pub r#thread_id: String,
10739
10740    /// The ID of the [assistant](/docs/api-reference/assistants) used for
10741    /// execution of this run.
10742    pub r#assistant_id: String,
10743
10744    /// The status of the run, which can be either `queued`, `in_progress`,
10745    /// `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`,
10746    /// `incomplete`, or `expired`.
10747    pub r#status: String,
10748
10749    pub r#required_action: Option<RunObject_RequiredAction>,
10750
10751    pub r#last_error: Option<RunObject_LastError>,
10752
10753    /// The Unix timestamp (in seconds) for when the run will expire.
10754    pub r#expires_at: Option<i64>,
10755
10756    /// The Unix timestamp (in seconds) for when the run was started.
10757    pub r#started_at: Option<i64>,
10758
10759    /// The Unix timestamp (in seconds) for when the run was cancelled.
10760    pub r#cancelled_at: Option<i64>,
10761
10762    /// The Unix timestamp (in seconds) for when the run failed.
10763    pub r#failed_at: Option<i64>,
10764
10765    /// The Unix timestamp (in seconds) for when the run was completed.
10766    pub r#completed_at: Option<i64>,
10767
10768    pub r#incomplete_details: Option<RunObject_IncompleteDetails>,
10769
10770    /// The model that the [assistant](/docs/api-reference/assistants) used for
10771    /// this run.
10772    pub r#model: String,
10773
10774    /// The instructions that the [assistant](/docs/api-reference/assistants)
10775    /// used for this run.
10776    pub r#instructions: String,
10777
10778    /// The list of tools that the [assistant](/docs/api-reference/assistants)
10779    /// used for this run.
10780    pub r#tools: Vec<RunObject_Tools>,
10781
10782    pub r#metadata: Option<Metadata>,
10783
10784    pub r#usage: Option<RunCompletionUsage>,
10785
10786    /// The sampling temperature used for this run.
10787    pub r#temperature: Option<f64>,
10788
10789    /// The nucleus sampling value used for this run.
10790    pub r#top_p: Option<f64>,
10791
10792    /// The maximum number of prompt tokens specified to have been used over the
10793    /// course of the run.
10794    pub r#max_prompt_tokens: Option<i64>,
10795
10796    /// The maximum number of completion tokens specified to have been used over
10797    /// the course of the run.
10798    pub r#max_completion_tokens: Option<i64>,
10799
10800    pub r#truncation_strategy: Option<TruncationObject>,
10801
10802    pub r#tool_choice: Option<AssistantsApiToolChoiceOption>,
10803
10804    pub r#parallel_tool_calls: ParallelToolCalls,
10805
10806    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
10807}
10808
10809/// Details on why the run is incomplete.
10810#[derive(Clone, Debug, Default)]
10811#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10812pub struct RunObject_IncompleteDetails {
10813    /// The reason why the run is incomplete.
10814    pub r#reason: Option<String>,
10815}
10816
10817/// The last error associated with this run.
10818#[derive(Clone, Debug, Default)]
10819#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10820pub struct RunObject_LastError {
10821    /// One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.
10822    pub r#code: String,
10823
10824    /// A human-readable description of the error.
10825    pub r#message: String,
10826}
10827
10828/// Details on the action required to continue the run.
10829#[derive(Clone, Debug)]
10830#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10831pub struct RunObject_RequiredAction {
10832    /// For now, this is always `submit_tool_outputs`.
10833    pub r#type: String,
10834
10835    pub r#submit_tool_outputs: RunObject_RequiredAction_SubmitToolOutputs,
10836}
10837
10838/// Details on the tool outputs needed for this run to continue.
10839#[derive(Clone, Debug, Default)]
10840#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10841pub struct RunObject_RequiredAction_SubmitToolOutputs {
10842    /// A list of the relevant tool calls.
10843    pub r#tool_calls: Vec<RunToolCallObject>,
10844}
10845
10846#[derive(Clone, Debug)]
10847#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10848#[cfg_attr(feature = "serde", serde(untagged))]
10849pub enum RunObject_Tools {
10850    AssistantToolsCode(AssistantToolsCode),
10851
10852    AssistantToolsFileSearch(AssistantToolsFileSearch),
10853
10854    AssistantToolsFunction(AssistantToolsFunction),
10855}
10856
10857/// Usage statistics related to the run step.
10858#[derive(Clone, Debug, Default)]
10859#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10860pub struct RunStepCompletionUsage {
10861    /// Number of completion tokens used over the course of the run step.
10862    pub r#completion_tokens: i64,
10863
10864    /// Number of prompt tokens used over the course of the run step.
10865    pub r#prompt_tokens: i64,
10866
10867    /// Total number of tokens used (prompt + completion).
10868    pub r#total_tokens: i64,
10869}
10870
10871/// Represents a run step delta i.e.
10872#[derive(Clone, Debug)]
10873#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10874pub struct RunStepDeltaObject {
10875    /// The identifier of the run step, which can be referenced in API
10876    /// endpoints.
10877    pub r#id: String,
10878
10879    /// The object type, which is always `thread.run.step.delta`.
10880    pub r#object: String,
10881
10882    pub r#delta: RunStepDeltaObject_Delta,
10883}
10884
10885/// The delta containing the fields that have changed on the run step.
10886#[derive(Clone, Debug, Default)]
10887#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10888pub struct RunStepDeltaObject_Delta {
10889    pub r#step_details: Option<RunStepDeltaObject_Delta_StepDetails>,
10890}
10891
10892/// The details of the run step.
10893#[derive(Clone, Debug)]
10894#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10895#[cfg_attr(feature = "serde", serde(untagged))]
10896pub enum RunStepDeltaObject_Delta_StepDetails {
10897    RunStepDeltaStepDetailsMessageCreationObject(RunStepDeltaStepDetailsMessageCreationObject),
10898
10899    RunStepDeltaStepDetailsToolCallsObject(RunStepDeltaStepDetailsToolCallsObject),
10900}
10901
10902/// Details of the message creation by the run step.
10903#[derive(Clone, Debug, Default)]
10904#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10905pub struct RunStepDeltaStepDetailsMessageCreationObject {
10906    /// Always `message_creation`.
10907    pub r#type: String,
10908
10909    pub r#message_creation: Option<RunStepDeltaStepDetailsMessageCreationObject_MessageCreation>,
10910}
10911
10912#[derive(Clone, Debug, Default)]
10913#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10914pub struct RunStepDeltaStepDetailsMessageCreationObject_MessageCreation {
10915    /// The ID of the message that was created by this run step.
10916    pub r#message_id: Option<String>,
10917}
10918
10919/// Details of the Code Interpreter tool call the run step was involved in.
10920#[derive(Clone, Debug, Default)]
10921#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10922pub struct RunStepDeltaStepDetailsToolCallsCodeObject {
10923    /// The index of the tool call in the tool calls array.
10924    pub r#index: i64,
10925
10926    /// The ID of the tool call.
10927    pub r#id: Option<String>,
10928
10929    /// The type of tool call.
10930    pub r#type: String,
10931
10932    pub r#code_interpreter: Option<RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter>,
10933}
10934
10935/// The Code Interpreter tool call definition.
10936#[derive(Clone, Debug, Default)]
10937#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10938pub struct RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter {
10939    /// The input to the Code Interpreter tool call.
10940    pub r#input: Option<String>,
10941
10942    /// The outputs from the Code Interpreter tool call.
10943    pub r#outputs: Option<Vec<RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs>>,
10944}
10945
10946#[derive(Clone, Debug)]
10947#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10948#[cfg_attr(feature = "serde", serde(untagged))]
10949pub enum RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs {
10950    RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject(RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject),
10951
10952    RunStepDeltaStepDetailsToolCallsCodeOutputImageObject(RunStepDeltaStepDetailsToolCallsCodeOutputImageObject),
10953}
10954
10955#[derive(Clone, Debug, Default)]
10956#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10957pub struct RunStepDeltaStepDetailsToolCallsCodeOutputImageObject {
10958    /// The index of the output in the outputs array.
10959    pub r#index: i64,
10960
10961    /// Always `image`.
10962    pub r#type: String,
10963
10964    pub r#image: Option<RunStepDeltaStepDetailsToolCallsCodeOutputImageObject_Image>,
10965}
10966
10967#[derive(Clone, Debug, Default)]
10968#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10969pub struct RunStepDeltaStepDetailsToolCallsCodeOutputImageObject_Image {
10970    /// The [file](/docs/api-reference/files) ID of the image.
10971    pub r#file_id: Option<String>,
10972}
10973
10974/// Text output from the Code Interpreter tool call as part of a run step.
10975#[derive(Clone, Debug, Default)]
10976#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10977pub struct RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject {
10978    /// The index of the output in the outputs array.
10979    pub r#index: i64,
10980
10981    /// Always `logs`.
10982    pub r#type: String,
10983
10984    /// The text output from the Code Interpreter tool call.
10985    pub r#logs: Option<String>,
10986}
10987
10988#[derive(Clone, Debug, Default)]
10989#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10990pub struct RunStepDeltaStepDetailsToolCallsFileSearchObject {
10991    /// The index of the tool call in the tool calls array.
10992    pub r#index: i64,
10993
10994    /// The ID of the tool call object.
10995    pub r#id: Option<String>,
10996
10997    /// The type of tool call.
10998    pub r#type: String,
10999
11000    /// For now, this is always going to be an empty object.
11001    pub r#file_search: RunStepDeltaStepDetailsToolCallsFileSearchObject_FileSearch,
11002}
11003
11004/// For now, this is always going to be an empty object.
11005#[derive(Clone, Debug, Default)]
11006#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11007pub struct RunStepDeltaStepDetailsToolCallsFileSearchObject_FileSearch;
11008
11009#[derive(Clone, Debug, Default)]
11010#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11011pub struct RunStepDeltaStepDetailsToolCallsFunctionObject {
11012    /// The index of the tool call in the tool calls array.
11013    pub r#index: i64,
11014
11015    /// The ID of the tool call object.
11016    pub r#id: Option<String>,
11017
11018    /// The type of tool call.
11019    pub r#type: String,
11020
11021    pub r#function: Option<RunStepDeltaStepDetailsToolCallsFunctionObject_Function>,
11022}
11023
11024/// The definition of the function that was called.
11025#[derive(Clone, Debug, Default)]
11026#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11027pub struct RunStepDeltaStepDetailsToolCallsFunctionObject_Function {
11028    /// The name of the function.
11029    pub r#name: Option<String>,
11030
11031    /// The arguments passed to the function.
11032    pub r#arguments: Option<String>,
11033
11034    /// The output of the function.
11035    pub r#output: Option<String>,
11036}
11037
11038/// Details of the tool call.
11039#[derive(Clone, Debug, Default)]
11040#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11041pub struct RunStepDeltaStepDetailsToolCallsObject {
11042    /// Always `tool_calls`.
11043    pub r#type: String,
11044
11045    /// An array of tool calls the run step was involved in.
11046    pub r#tool_calls: Option<Vec<RunStepDeltaStepDetailsToolCallsObject_ToolCalls>>,
11047}
11048
11049#[derive(Clone, Debug)]
11050#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11051#[cfg_attr(feature = "serde", serde(untagged))]
11052pub enum RunStepDeltaStepDetailsToolCallsObject_ToolCalls {
11053    RunStepDeltaStepDetailsToolCallsCodeObject(RunStepDeltaStepDetailsToolCallsCodeObject),
11054
11055    RunStepDeltaStepDetailsToolCallsFileSearchObject(RunStepDeltaStepDetailsToolCallsFileSearchObject),
11056
11057    RunStepDeltaStepDetailsToolCallsFunctionObject(RunStepDeltaStepDetailsToolCallsFunctionObject),
11058}
11059
11060/// Details of the message creation by the run step.
11061#[derive(Clone, Debug)]
11062#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11063pub struct RunStepDetailsMessageCreationObject {
11064    /// Always `message_creation`.
11065    pub r#type: String,
11066
11067    pub r#message_creation: RunStepDetailsMessageCreationObject_MessageCreation,
11068}
11069
11070#[derive(Clone, Debug, Default)]
11071#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11072pub struct RunStepDetailsMessageCreationObject_MessageCreation {
11073    /// The ID of the message that was created by this run step.
11074    pub r#message_id: String,
11075}
11076
11077/// Details of the Code Interpreter tool call the run step was involved in.
11078#[derive(Clone, Debug)]
11079#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11080pub struct RunStepDetailsToolCallsCodeObject {
11081    /// The ID of the tool call.
11082    pub r#id: String,
11083
11084    /// The type of tool call.
11085    pub r#type: String,
11086
11087    pub r#code_interpreter: RunStepDetailsToolCallsCodeObject_CodeInterpreter,
11088}
11089
11090/// The Code Interpreter tool call definition.
11091#[derive(Clone, Debug, Default)]
11092#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11093pub struct RunStepDetailsToolCallsCodeObject_CodeInterpreter {
11094    /// The input to the Code Interpreter tool call.
11095    pub r#input: String,
11096
11097    /// The outputs from the Code Interpreter tool call.
11098    pub r#outputs: Vec<RunStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs>,
11099}
11100
11101#[derive(Clone, Debug)]
11102#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11103#[cfg_attr(feature = "serde", serde(untagged))]
11104pub enum RunStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs {
11105    RunStepDetailsToolCallsCodeOutputLogsObject(RunStepDetailsToolCallsCodeOutputLogsObject),
11106
11107    RunStepDetailsToolCallsCodeOutputImageObject(RunStepDetailsToolCallsCodeOutputImageObject),
11108}
11109
11110#[derive(Clone, Debug)]
11111#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11112pub struct RunStepDetailsToolCallsCodeOutputImageObject {
11113    /// Always `image`.
11114    pub r#type: String,
11115
11116    pub r#image: RunStepDetailsToolCallsCodeOutputImageObject_Image,
11117}
11118
11119#[derive(Clone, Debug, Default)]
11120#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11121pub struct RunStepDetailsToolCallsCodeOutputImageObject_Image {
11122    /// The [file](/docs/api-reference/files) ID of the image.
11123    pub r#file_id: String,
11124}
11125
11126/// Text output from the Code Interpreter tool call as part of a run step.
11127#[derive(Clone, Debug, Default)]
11128#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11129pub struct RunStepDetailsToolCallsCodeOutputLogsObject {
11130    /// Always `logs`.
11131    pub r#type: String,
11132
11133    /// The text output from the Code Interpreter tool call.
11134    pub r#logs: String,
11135}
11136
11137#[derive(Clone, Debug)]
11138#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11139pub struct RunStepDetailsToolCallsFileSearchObject {
11140    /// The ID of the tool call object.
11141    pub r#id: String,
11142
11143    /// The type of tool call.
11144    pub r#type: String,
11145
11146    pub r#file_search: RunStepDetailsToolCallsFileSearchObject_FileSearch,
11147}
11148
11149/// For now, this is always going to be an empty object.
11150#[derive(Clone, Debug, Default)]
11151#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11152pub struct RunStepDetailsToolCallsFileSearchObject_FileSearch {
11153    pub r#ranking_options: Option<RunStepDetailsToolCallsFileSearchRankingOptionsObject>,
11154
11155    /// The results of the file search.
11156    pub r#results: Option<Vec<RunStepDetailsToolCallsFileSearchResultObject>>,
11157}
11158
11159/// The ranking options for the file search.
11160#[derive(Clone, Debug)]
11161#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11162pub struct RunStepDetailsToolCallsFileSearchRankingOptionsObject {
11163    pub r#ranker: FileSearchRanker,
11164
11165    /// The score threshold for the file search.
11166    pub r#score_threshold: f64,
11167}
11168
11169/// A result instance of the file search.
11170#[derive(Clone, Debug, Default)]
11171#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11172pub struct RunStepDetailsToolCallsFileSearchResultObject {
11173    /// The ID of the file that result was found in.
11174    pub r#file_id: String,
11175
11176    /// The name of the file that result was found in.
11177    pub r#file_name: String,
11178
11179    /// The score of the result.
11180    pub r#score: f64,
11181
11182    /// The content of the result that was found.
11183    pub r#content: Option<Vec<RunStepDetailsToolCallsFileSearchResultObject_Content>>,
11184}
11185
11186#[derive(Clone, Debug, Default)]
11187#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11188pub struct RunStepDetailsToolCallsFileSearchResultObject_Content {
11189    /// The type of the content.
11190    pub r#type: Option<String>,
11191
11192    /// The text content of the file.
11193    pub r#text: Option<String>,
11194}
11195
11196#[derive(Clone, Debug)]
11197#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11198pub struct RunStepDetailsToolCallsFunctionObject {
11199    /// The ID of the tool call object.
11200    pub r#id: String,
11201
11202    /// The type of tool call.
11203    pub r#type: String,
11204
11205    pub r#function: RunStepDetailsToolCallsFunctionObject_Function,
11206}
11207
11208/// The definition of the function that was called.
11209#[derive(Clone, Debug, Default)]
11210#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11211pub struct RunStepDetailsToolCallsFunctionObject_Function {
11212    /// The name of the function.
11213    pub r#name: String,
11214
11215    /// The arguments passed to the function.
11216    pub r#arguments: String,
11217
11218    /// The output of the function.
11219    pub r#output: Option<String>,
11220}
11221
11222/// Details of the tool call.
11223#[derive(Clone, Debug, Default)]
11224#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11225pub struct RunStepDetailsToolCallsObject {
11226    /// Always `tool_calls`.
11227    pub r#type: String,
11228
11229    /// An array of tool calls the run step was involved in.
11230    pub r#tool_calls: Vec<RunStepDetailsToolCallsObject_ToolCalls>,
11231}
11232
11233#[derive(Clone, Debug)]
11234#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11235#[cfg_attr(feature = "serde", serde(untagged))]
11236pub enum RunStepDetailsToolCallsObject_ToolCalls {
11237    RunStepDetailsToolCallsCodeObject(RunStepDetailsToolCallsCodeObject),
11238
11239    RunStepDetailsToolCallsFileSearchObject(RunStepDetailsToolCallsFileSearchObject),
11240
11241    RunStepDetailsToolCallsFunctionObject(RunStepDetailsToolCallsFunctionObject),
11242}
11243
11244/// Represents a step in execution of a run.
11245#[derive(Clone, Debug)]
11246#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11247pub struct RunStepObject {
11248    /// The identifier of the run step, which can be referenced in API
11249    /// endpoints.
11250    pub r#id: String,
11251
11252    /// The object type, which is always `thread.run.step`.
11253    pub r#object: String,
11254
11255    /// The Unix timestamp (in seconds) for when the run step was created.
11256    pub r#created_at: i64,
11257
11258    /// The ID of the [assistant](/docs/api-reference/assistants) associated
11259    /// with the run step.
11260    pub r#assistant_id: String,
11261
11262    /// The ID of the [thread](/docs/api-reference/threads) that was run.
11263    pub r#thread_id: String,
11264
11265    /// The ID of the [run](/docs/api-reference/runs) that this run step is a
11266    /// part of.
11267    pub r#run_id: String,
11268
11269    /// The type of run step, which can be either `message_creation` or
11270    /// `tool_calls`.
11271    pub r#type: String,
11272
11273    /// The status of the run step, which can be either `in_progress`,
11274    /// `cancelled`, `failed`, `completed`, or `expired`.
11275    pub r#status: String,
11276
11277    pub r#step_details: RunStepObject_StepDetails,
11278
11279    pub r#last_error: Option<RunStepObject_LastError>,
11280
11281    /// The Unix timestamp (in seconds) for when the run step expired.
11282    pub r#expired_at: Option<i64>,
11283
11284    /// The Unix timestamp (in seconds) for when the run step was cancelled.
11285    pub r#cancelled_at: Option<i64>,
11286
11287    /// The Unix timestamp (in seconds) for when the run step failed.
11288    pub r#failed_at: Option<i64>,
11289
11290    /// The Unix timestamp (in seconds) for when the run step completed.
11291    pub r#completed_at: Option<i64>,
11292
11293    pub r#metadata: Option<Metadata>,
11294
11295    pub r#usage: Option<RunStepCompletionUsage>,
11296}
11297
11298/// The last error associated with this run step.
11299#[derive(Clone, Debug, Default)]
11300#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11301pub struct RunStepObject_LastError {
11302    /// One of `server_error` or `rate_limit_exceeded`.
11303    pub r#code: String,
11304
11305    /// A human-readable description of the error.
11306    pub r#message: String,
11307}
11308
11309/// The details of the run step.
11310#[derive(Clone, Debug)]
11311#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11312#[cfg_attr(feature = "serde", serde(untagged))]
11313pub enum RunStepObject_StepDetails {
11314    RunStepDetailsMessageCreationObject(RunStepDetailsMessageCreationObject),
11315
11316    RunStepDetailsToolCallsObject(RunStepDetailsToolCallsObject),
11317}
11318
11319include!("schemas/run_step_stream_event.rs");
11320
11321/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is
11322/// created.
11323#[derive(Clone, Debug)]
11324#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11325pub struct RunStepStreamEvent_Variant1 {
11326    pub r#event: String,
11327
11328    pub r#data: RunStepObject,
11329}
11330
11331/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to
11332/// an `in_progress` state.
11333#[derive(Clone, Debug)]
11334#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11335pub struct RunStepStreamEvent_Variant2 {
11336    pub r#event: String,
11337
11338    pub r#data: RunStepObject,
11339}
11340
11341/// Occurs when parts of a [run step](/docs/api-reference/run-steps/step-object)
11342/// are being streamed.
11343#[derive(Clone, Debug)]
11344#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11345pub struct RunStepStreamEvent_Variant3 {
11346    pub r#event: String,
11347
11348    pub r#data: RunStepDeltaObject,
11349}
11350
11351/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is
11352/// completed.
11353#[derive(Clone, Debug)]
11354#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11355pub struct RunStepStreamEvent_Variant4 {
11356    pub r#event: String,
11357
11358    pub r#data: RunStepObject,
11359}
11360
11361/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails.
11362#[derive(Clone, Debug)]
11363#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11364pub struct RunStepStreamEvent_Variant5 {
11365    pub r#event: String,
11366
11367    pub r#data: RunStepObject,
11368}
11369
11370/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is
11371/// cancelled.
11372#[derive(Clone, Debug)]
11373#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11374pub struct RunStepStreamEvent_Variant6 {
11375    pub r#event: String,
11376
11377    pub r#data: RunStepObject,
11378}
11379
11380/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires.
11381#[derive(Clone, Debug)]
11382#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11383pub struct RunStepStreamEvent_Variant7 {
11384    pub r#event: String,
11385
11386    pub r#data: RunStepObject,
11387}
11388
11389include!("schemas/run_stream_event.rs");
11390
11391/// Occurs when a new [run](/docs/api-reference/runs/object) is created.
11392#[derive(Clone, Debug)]
11393#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11394pub struct RunStreamEvent_Variant1 {
11395    pub r#event: String,
11396
11397    pub r#data: RunObject,
11398}
11399
11400/// Occurs when a [run](/docs/api-reference/runs/object) expires.
11401#[derive(Clone, Debug)]
11402#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11403pub struct RunStreamEvent_Variant10 {
11404    pub r#event: String,
11405
11406    pub r#data: RunObject,
11407}
11408
11409/// Occurs when a [run](/docs/api-reference/runs/object) moves to a `queued`
11410/// status.
11411#[derive(Clone, Debug)]
11412#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11413pub struct RunStreamEvent_Variant2 {
11414    pub r#event: String,
11415
11416    pub r#data: RunObject,
11417}
11418
11419/// Occurs when a [run](/docs/api-reference/runs/object) moves to an
11420/// `in_progress` status.
11421#[derive(Clone, Debug)]
11422#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11423pub struct RunStreamEvent_Variant3 {
11424    pub r#event: String,
11425
11426    pub r#data: RunObject,
11427}
11428
11429/// Occurs when a [run](/docs/api-reference/runs/object) moves to a
11430/// `requires_action` status.
11431#[derive(Clone, Debug)]
11432#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11433pub struct RunStreamEvent_Variant4 {
11434    pub r#event: String,
11435
11436    pub r#data: RunObject,
11437}
11438
11439/// Occurs when a [run](/docs/api-reference/runs/object) is completed.
11440#[derive(Clone, Debug)]
11441#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11442pub struct RunStreamEvent_Variant5 {
11443    pub r#event: String,
11444
11445    pub r#data: RunObject,
11446}
11447
11448/// Occurs when a [run](/docs/api-reference/runs/object) ends with status
11449/// `incomplete`.
11450#[derive(Clone, Debug)]
11451#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11452pub struct RunStreamEvent_Variant6 {
11453    pub r#event: String,
11454
11455    pub r#data: RunObject,
11456}
11457
11458/// Occurs when a [run](/docs/api-reference/runs/object) fails.
11459#[derive(Clone, Debug)]
11460#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11461pub struct RunStreamEvent_Variant7 {
11462    pub r#event: String,
11463
11464    pub r#data: RunObject,
11465}
11466
11467/// Occurs when a [run](/docs/api-reference/runs/object) moves to a `cancelling`
11468/// status.
11469#[derive(Clone, Debug)]
11470#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11471pub struct RunStreamEvent_Variant8 {
11472    pub r#event: String,
11473
11474    pub r#data: RunObject,
11475}
11476
11477/// Occurs when a [run](/docs/api-reference/runs/object) is cancelled.
11478#[derive(Clone, Debug)]
11479#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11480pub struct RunStreamEvent_Variant9 {
11481    pub r#event: String,
11482
11483    pub r#data: RunObject,
11484}
11485
11486/// Tool call objects
11487#[derive(Clone, Debug)]
11488#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11489pub struct RunToolCallObject {
11490    /// The ID of the tool call.
11491    pub r#id: String,
11492
11493    /// The type of tool call the output is required for.
11494    pub r#type: String,
11495
11496    pub r#function: RunToolCallObject_Function,
11497}
11498
11499/// The function definition.
11500#[derive(Clone, Debug, Default)]
11501#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11502pub struct RunToolCallObject_Function {
11503    /// The name of the function.
11504    pub r#name: String,
11505
11506    /// The arguments that the model expects you to pass to the function.
11507    pub r#arguments: String,
11508}
11509
11510/// A screenshot action.
11511#[derive(Clone, Debug, Default)]
11512#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11513pub struct Screenshot {
11514    /// Specifies the event type.
11515    pub r#type: String,
11516}
11517
11518/// A scroll action.
11519#[derive(Clone, Debug, Default)]
11520#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11521pub struct Scroll {
11522    /// Specifies the event type.
11523    pub r#type: String,
11524
11525    /// The x-coordinate where the scroll occurred.
11526    pub r#x: i64,
11527
11528    /// The y-coordinate where the scroll occurred.
11529    pub r#y: i64,
11530
11531    /// The horizontal scroll distance.
11532    pub r#scroll_x: i64,
11533
11534    /// The vertical scroll distance.
11535    pub r#scroll_y: i64,
11536}
11537
11538/// Specifies the latency tier to use for processing the request.
11539#[derive(Clone, Debug)]
11540#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11541pub enum ServiceTier {
11542    #[cfg_attr(feature = "serde", serde(rename = "auto"))]
11543    Auto,
11544
11545    #[cfg_attr(feature = "serde", serde(rename = "default"))]
11546    Default,
11547
11548    #[cfg_attr(feature = "serde", serde(rename = "flex"))]
11549    Flex,
11550
11551    #[cfg_attr(feature = "serde", serde(untagged))]
11552    Other(String),
11553}
11554
11555#[derive(Clone, Debug, Default)]
11556#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11557pub struct StaticChunkingStrategy {
11558    /// The maximum number of tokens in each chunk.
11559    pub r#max_chunk_size_tokens: i64,
11560
11561    /// The number of tokens that overlap between chunks.
11562    pub r#chunk_overlap_tokens: i64,
11563}
11564
11565/// Customize your own chunking strategy by setting chunk size and chunk
11566/// overlap.
11567#[derive(Clone, Debug)]
11568#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11569pub struct StaticChunkingStrategyRequestParam {
11570    /// Always `static`.
11571    pub r#type: String,
11572
11573    pub r#static: StaticChunkingStrategy,
11574}
11575
11576#[derive(Clone, Debug)]
11577#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11578pub struct StaticChunkingStrategyResponseParam {
11579    /// Always `static`.
11580    pub r#type: String,
11581
11582    pub r#static: StaticChunkingStrategy,
11583}
11584
11585/// Not supported with latest reasoning models `o3` and `o4-mini`.
11586#[derive(Clone, Debug, Default)]
11587#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11588#[cfg_attr(feature = "serde", serde(untagged))]
11589pub enum StopConfiguration {
11590    #[default]
11591    Null,
11592
11593    Text(String),
11594
11595    TextArray(Vec<String>),
11596}
11597
11598#[derive(Clone, Debug, Default)]
11599#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11600pub struct SubmitToolOutputsRunRequest {
11601    /// A list of tools for which the outputs are being submitted.
11602    pub r#tool_outputs: Vec<SubmitToolOutputsRunRequest_ToolOutputs>,
11603
11604    /// If `true`, returns a stream of events that happen during the Run as
11605    /// server-sent events, terminating when the Run enters a terminal state
11606    /// with a `data: [DONE]` message.
11607    pub r#stream: Option<bool>,
11608}
11609
11610#[derive(Clone, Debug, Default)]
11611#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11612pub struct SubmitToolOutputsRunRequest_ToolOutputs {
11613    /// The ID of the tool call in the `required_action` object within the run
11614    /// object the output is being submitted for.
11615    pub r#tool_call_id: Option<String>,
11616
11617    /// The output of the tool call to be submitted to continue the run.
11618    pub r#output: Option<String>,
11619}
11620
11621/// An object specifying the format that the model must output.
11622#[derive(Clone, Debug)]
11623#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11624#[cfg_attr(feature = "serde", serde(untagged))]
11625pub enum TextResponseFormatConfiguration {
11626    ResponseFormatText(ResponseFormatText),
11627
11628    TextResponseFormatJsonSchema(TextResponseFormatJsonSchema),
11629
11630    ResponseFormatJsonObject(ResponseFormatJsonObject),
11631}
11632
11633/// JSON Schema response format.
11634#[derive(Clone, Debug)]
11635#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11636pub struct TextResponseFormatJsonSchema {
11637    /// The type of response format being defined.
11638    pub r#type: String,
11639
11640    /// A description of what the response format is for, used by the model to
11641    /// determine how to respond in the format.
11642    pub r#description: Option<String>,
11643
11644    /// The name of the response format.
11645    pub r#name: String,
11646
11647    pub r#schema: ResponseFormatJsonSchemaSchema,
11648
11649    /// Whether to enable strict schema adherence when generating the output.
11650    pub r#strict: Option<bool>,
11651}
11652
11653/// Represents a thread that contains [messages](/docs/api-reference/messages).
11654#[derive(Clone, Debug, Default)]
11655#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11656pub struct ThreadObject {
11657    /// The identifier, which can be referenced in API endpoints.
11658    pub r#id: String,
11659
11660    /// The object type, which is always `thread`.
11661    pub r#object: String,
11662
11663    /// The Unix timestamp (in seconds) for when the thread was created.
11664    pub r#created_at: i64,
11665
11666    pub r#tool_resources: Option<ThreadObject_ToolResources>,
11667
11668    pub r#metadata: Option<Metadata>,
11669}
11670
11671/// A set of resources that are made available to the assistant's tools in this
11672/// thread.
11673#[derive(Clone, Debug, Default)]
11674#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11675pub struct ThreadObject_ToolResources {
11676    pub r#code_interpreter: Option<ThreadObject_ToolResources_CodeInterpreter>,
11677
11678    pub r#file_search: Option<ThreadObject_ToolResources_FileSearch>,
11679}
11680
11681#[derive(Clone, Debug, Default)]
11682#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11683pub struct ThreadObject_ToolResources_CodeInterpreter {
11684    /// A list of [file](/docs/api-reference/files) IDs made available to the
11685    /// `code_interpreter` tool.
11686    pub r#file_ids: Option<Vec<String>>,
11687}
11688
11689#[derive(Clone, Debug, Default)]
11690#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11691pub struct ThreadObject_ToolResources_FileSearch {
11692    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
11693    /// this thread.
11694    pub r#vector_store_ids: Option<Vec<String>>,
11695}
11696
11697include!("schemas/thread_stream_event.rs");
11698
11699#[derive(Clone, Debug, Default)]
11700#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11701pub struct ToggleCertificatesRequest {
11702    pub r#certificate_ids: Vec<String>,
11703}
11704
11705#[derive(Clone, Debug)]
11706#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11707#[cfg_attr(feature = "serde", serde(untagged))]
11708pub enum Tool {
11709    FileSearchTool(FileSearchTool),
11710
11711    FunctionTool(FunctionTool),
11712
11713    WebSearchPreviewTool(WebSearchPreviewTool),
11714
11715    ComputerUsePreviewTool(ComputerUsePreviewTool),
11716}
11717
11718/// Use this option to force the model to call a specific function.
11719#[derive(Clone, Debug, Default)]
11720#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11721pub struct ToolChoiceFunction {
11722    /// For function calling, the type is always `function`.
11723    pub r#type: String,
11724
11725    /// The name of the function to call.
11726    pub r#name: String,
11727}
11728
11729/// Controls which (if any) tool is called by the model.
11730#[derive(Clone, Debug)]
11731#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11732pub enum ToolChoiceOptions {
11733    #[cfg_attr(feature = "serde", serde(rename = "none"))]
11734    None,
11735
11736    #[cfg_attr(feature = "serde", serde(rename = "auto"))]
11737    Auto,
11738
11739    #[cfg_attr(feature = "serde", serde(rename = "required"))]
11740    Required,
11741
11742    #[cfg_attr(feature = "serde", serde(untagged))]
11743    Other(String),
11744}
11745
11746/// Indicates that the model should use a built-in tool to generate a response.
11747#[derive(Clone, Debug, Default)]
11748#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11749pub struct ToolChoiceTypes {
11750    /// The type of hosted tool the model should to use.
11751    pub r#type: String,
11752}
11753
11754/// Emitted when there is an additional text delta.
11755#[derive(Clone, Debug, Default)]
11756#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11757pub struct TranscriptTextDeltaEvent {
11758    /// The type of the event.
11759    pub r#type: String,
11760
11761    /// The text delta that was additionally transcribed.
11762    pub r#delta: String,
11763
11764    /// The log probabilities of the delta.
11765    pub r#logprobs: Option<Vec<TranscriptTextDeltaEvent_Logprobs>>,
11766}
11767
11768#[derive(Clone, Debug, Default)]
11769#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11770pub struct TranscriptTextDeltaEvent_Logprobs {
11771    /// The token that was used to generate the log probability.
11772    pub r#token: Option<String>,
11773
11774    /// The log probability of the token.
11775    pub r#logprob: Option<f64>,
11776
11777    /// The bytes that were used to generate the log probability.
11778    pub r#bytes: Option<Vec<i64>>,
11779}
11780
11781/// Emitted when the transcription is complete.
11782#[derive(Clone, Debug, Default)]
11783#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11784pub struct TranscriptTextDoneEvent {
11785    /// The type of the event.
11786    pub r#type: String,
11787
11788    /// The text that was transcribed.
11789    pub r#text: String,
11790
11791    /// The log probabilities of the individual tokens in the transcription.
11792    pub r#logprobs: Option<Vec<TranscriptTextDoneEvent_Logprobs>>,
11793}
11794
11795#[derive(Clone, Debug, Default)]
11796#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11797pub struct TranscriptTextDoneEvent_Logprobs {
11798    /// The token that was used to generate the log probability.
11799    pub r#token: Option<String>,
11800
11801    /// The log probability of the token.
11802    pub r#logprob: Option<f64>,
11803
11804    /// The bytes that were used to generate the log probability.
11805    pub r#bytes: Option<Vec<i64>>,
11806}
11807
11808#[derive(Clone, Debug)]
11809#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11810pub enum TranscriptionInclude {
11811    #[cfg_attr(feature = "serde", serde(rename = "logprobs"))]
11812    Logprobs,
11813
11814    #[cfg_attr(feature = "serde", serde(untagged))]
11815    Other(String),
11816}
11817
11818#[derive(Clone, Debug, Default)]
11819#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11820pub struct TranscriptionSegment {
11821    /// Unique identifier of the segment.
11822    pub r#id: i64,
11823
11824    /// Seek offset of the segment.
11825    pub r#seek: i64,
11826
11827    /// Start time of the segment in seconds.
11828    pub r#start: f64,
11829
11830    /// End time of the segment in seconds.
11831    pub r#end: f64,
11832
11833    /// Text content of the segment.
11834    pub r#text: String,
11835
11836    /// Array of token IDs for the text content.
11837    pub r#tokens: Vec<i64>,
11838
11839    /// Temperature parameter used for generating the segment.
11840    pub r#temperature: f64,
11841
11842    /// Average logprob of the segment.
11843    pub r#avg_logprob: f64,
11844
11845    /// Compression ratio of the segment.
11846    pub r#compression_ratio: f64,
11847
11848    /// Probability of no speech in the segment.
11849    pub r#no_speech_prob: f64,
11850}
11851
11852#[derive(Clone, Debug, Default)]
11853#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11854pub struct TranscriptionWord {
11855    /// The text content of the word.
11856    pub r#word: String,
11857
11858    /// Start time of the word in seconds.
11859    pub r#start: f64,
11860
11861    /// End time of the word in seconds.
11862    pub r#end: f64,
11863}
11864
11865/// Controls for how a thread will be truncated prior to the run.
11866#[derive(Clone, Debug, Default)]
11867#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11868pub struct TruncationObject {
11869    /// The truncation strategy to use for the thread.
11870    pub r#type: String,
11871
11872    /// The number of most recent messages from the thread when constructing the
11873    /// context for the run.
11874    pub r#last_messages: Option<i64>,
11875}
11876
11877/// An action to type in text.
11878#[derive(Clone, Debug, Default)]
11879#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11880pub struct Type {
11881    /// Specifies the event type.
11882    pub r#type: String,
11883
11884    /// The text to type.
11885    pub r#text: String,
11886}
11887
11888#[derive(Clone, Debug, Default)]
11889#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11890pub struct UpdateVectorStoreFileAttributesRequest {
11891    pub r#attributes: Option<VectorStoreFileAttributes>,
11892}
11893
11894#[derive(Clone, Debug, Default)]
11895#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11896pub struct UpdateVectorStoreRequest {
11897    /// The name of the vector store.
11898    pub r#name: Option<String>,
11899
11900    pub r#expires_after: Option<VectorStoreExpirationAfter>,
11901
11902    pub r#metadata: Option<Metadata>,
11903}
11904
11905/// The Upload object can accept byte chunks in the form of Parts.
11906#[derive(Clone, Debug, Default)]
11907#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11908pub struct Upload {
11909    /// The Upload unique identifier, which can be referenced in API endpoints.
11910    pub r#id: String,
11911
11912    /// The Unix timestamp (in seconds) for when the Upload was created.
11913    pub r#created_at: i64,
11914
11915    /// The name of the file to be uploaded.
11916    pub r#filename: String,
11917
11918    /// The intended number of bytes to be uploaded.
11919    pub r#bytes: i64,
11920
11921    /// The intended purpose of the file.
11922    pub r#purpose: String,
11923
11924    /// The status of the Upload.
11925    pub r#status: String,
11926
11927    /// The Unix timestamp (in seconds) for when the Upload will expire.
11928    pub r#expires_at: i64,
11929
11930    /// The object type, which is always "upload".
11931    pub r#object: Option<String>,
11932
11933    /// The ready File object after the Upload is completed.
11934    pub r#file: Option<OpenAIFile>,
11935}
11936
11937#[derive(Clone, Debug, Default)]
11938#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11939pub struct UploadCertificateRequest {
11940    /// An optional name for the certificate
11941    pub r#name: Option<String>,
11942
11943    /// The certificate content in PEM format
11944    pub r#content: String,
11945}
11946
11947/// The upload Part represents a chunk of bytes we can add to an Upload object.
11948#[derive(Clone, Debug, Default)]
11949#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11950pub struct UploadPart {
11951    /// The upload Part unique identifier, which can be referenced in API
11952    /// endpoints.
11953    pub r#id: String,
11954
11955    /// The Unix timestamp (in seconds) for when the Part was created.
11956    pub r#created_at: i64,
11957
11958    /// The ID of the Upload object that this Part was added to.
11959    pub r#upload_id: String,
11960
11961    /// The object type, which is always `upload.part`.
11962    pub r#object: String,
11963}
11964
11965/// A citation for a web resource used to generate a model response.
11966#[derive(Clone, Debug, Default)]
11967#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11968pub struct UrlCitationBody {
11969    /// The type of the URL citation.
11970    pub r#type: String,
11971
11972    /// The URL of the web resource.
11973    pub r#url: String,
11974
11975    /// The index of the first character of the URL citation in the message.
11976    pub r#start_index: i64,
11977
11978    /// The index of the last character of the URL citation in the message.
11979    pub r#end_index: i64,
11980
11981    /// The title of the web resource.
11982    pub r#title: String,
11983}
11984
11985/// The aggregated audio speeches usage details of the specific time bucket.
11986#[derive(Clone, Debug, Default)]
11987#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11988pub struct UsageAudioSpeechesResult {
11989    pub r#object: String,
11990
11991    /// The number of characters processed.
11992    pub r#characters: i64,
11993
11994    /// The count of requests made to the model.
11995    pub r#num_model_requests: i64,
11996
11997    /// When `group_by=project_id`, this field provides the project ID of the
11998    /// grouped usage result.
11999    pub r#project_id: Option<String>,
12000
12001    /// When `group_by=user_id`, this field provides the user ID of the grouped
12002    /// usage result.
12003    pub r#user_id: Option<String>,
12004
12005    /// When `group_by=api_key_id`, this field provides the API key ID of the
12006    /// grouped usage result.
12007    pub r#api_key_id: Option<String>,
12008
12009    /// When `group_by=model`, this field provides the model name of the grouped
12010    /// usage result.
12011    pub r#model: Option<String>,
12012}
12013
12014/// The aggregated audio transcriptions usage details of the specific time
12015/// bucket.
12016#[derive(Clone, Debug, Default)]
12017#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12018pub struct UsageAudioTranscriptionsResult {
12019    pub r#object: String,
12020
12021    /// The number of seconds processed.
12022    pub r#seconds: i64,
12023
12024    /// The count of requests made to the model.
12025    pub r#num_model_requests: i64,
12026
12027    /// When `group_by=project_id`, this field provides the project ID of the
12028    /// grouped usage result.
12029    pub r#project_id: Option<String>,
12030
12031    /// When `group_by=user_id`, this field provides the user ID of the grouped
12032    /// usage result.
12033    pub r#user_id: Option<String>,
12034
12035    /// When `group_by=api_key_id`, this field provides the API key ID of the
12036    /// grouped usage result.
12037    pub r#api_key_id: Option<String>,
12038
12039    /// When `group_by=model`, this field provides the model name of the grouped
12040    /// usage result.
12041    pub r#model: Option<String>,
12042}
12043
12044/// The aggregated code interpreter sessions usage details of the specific time
12045/// bucket.
12046#[derive(Clone, Debug, Default)]
12047#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12048pub struct UsageCodeInterpreterSessionsResult {
12049    pub r#object: String,
12050
12051    /// The number of code interpreter sessions.
12052    pub r#num_sessions: Option<i64>,
12053
12054    /// When `group_by=project_id`, this field provides the project ID of the
12055    /// grouped usage result.
12056    pub r#project_id: Option<String>,
12057}
12058
12059/// The aggregated completions usage details of the specific time bucket.
12060#[derive(Clone, Debug, Default)]
12061#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12062pub struct UsageCompletionsResult {
12063    pub r#object: String,
12064
12065    /// The aggregated number of text input tokens used, including cached
12066    /// tokens.
12067    pub r#input_tokens: i64,
12068
12069    /// The aggregated number of text input tokens that has been cached from
12070    /// previous requests.
12071    pub r#input_cached_tokens: Option<i64>,
12072
12073    /// The aggregated number of text output tokens used.
12074    pub r#output_tokens: i64,
12075
12076    /// The aggregated number of audio input tokens used, including cached
12077    /// tokens.
12078    pub r#input_audio_tokens: Option<i64>,
12079
12080    /// The aggregated number of audio output tokens used.
12081    pub r#output_audio_tokens: Option<i64>,
12082
12083    /// The count of requests made to the model.
12084    pub r#num_model_requests: i64,
12085
12086    /// When `group_by=project_id`, this field provides the project ID of the
12087    /// grouped usage result.
12088    pub r#project_id: Option<String>,
12089
12090    /// When `group_by=user_id`, this field provides the user ID of the grouped
12091    /// usage result.
12092    pub r#user_id: Option<String>,
12093
12094    /// When `group_by=api_key_id`, this field provides the API key ID of the
12095    /// grouped usage result.
12096    pub r#api_key_id: Option<String>,
12097
12098    /// When `group_by=model`, this field provides the model name of the grouped
12099    /// usage result.
12100    pub r#model: Option<String>,
12101
12102    /// When `group_by=batch`, this field tells whether the grouped usage result
12103    /// is batch or not.
12104    pub r#batch: Option<bool>,
12105}
12106
12107/// The aggregated embeddings usage details of the specific time bucket.
12108#[derive(Clone, Debug, Default)]
12109#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12110pub struct UsageEmbeddingsResult {
12111    pub r#object: String,
12112
12113    /// The aggregated number of input tokens used.
12114    pub r#input_tokens: i64,
12115
12116    /// The count of requests made to the model.
12117    pub r#num_model_requests: i64,
12118
12119    /// When `group_by=project_id`, this field provides the project ID of the
12120    /// grouped usage result.
12121    pub r#project_id: Option<String>,
12122
12123    /// When `group_by=user_id`, this field provides the user ID of the grouped
12124    /// usage result.
12125    pub r#user_id: Option<String>,
12126
12127    /// When `group_by=api_key_id`, this field provides the API key ID of the
12128    /// grouped usage result.
12129    pub r#api_key_id: Option<String>,
12130
12131    /// When `group_by=model`, this field provides the model name of the grouped
12132    /// usage result.
12133    pub r#model: Option<String>,
12134}
12135
12136/// The aggregated images usage details of the specific time bucket.
12137#[derive(Clone, Debug, Default)]
12138#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12139pub struct UsageImagesResult {
12140    pub r#object: String,
12141
12142    /// The number of images processed.
12143    pub r#images: i64,
12144
12145    /// The count of requests made to the model.
12146    pub r#num_model_requests: i64,
12147
12148    /// When `group_by=source`, this field provides the source of the grouped
12149    /// usage result, possible values are `image.generation`, `image.edit`,
12150    /// `image.variation`.
12151    pub r#source: Option<String>,
12152
12153    /// When `group_by=size`, this field provides the image size of the grouped
12154    /// usage result.
12155    pub r#size: Option<String>,
12156
12157    /// When `group_by=project_id`, this field provides the project ID of the
12158    /// grouped usage result.
12159    pub r#project_id: Option<String>,
12160
12161    /// When `group_by=user_id`, this field provides the user ID of the grouped
12162    /// usage result.
12163    pub r#user_id: Option<String>,
12164
12165    /// When `group_by=api_key_id`, this field provides the API key ID of the
12166    /// grouped usage result.
12167    pub r#api_key_id: Option<String>,
12168
12169    /// When `group_by=model`, this field provides the model name of the grouped
12170    /// usage result.
12171    pub r#model: Option<String>,
12172}
12173
12174/// The aggregated moderations usage details of the specific time bucket.
12175#[derive(Clone, Debug, Default)]
12176#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12177pub struct UsageModerationsResult {
12178    pub r#object: String,
12179
12180    /// The aggregated number of input tokens used.
12181    pub r#input_tokens: i64,
12182
12183    /// The count of requests made to the model.
12184    pub r#num_model_requests: i64,
12185
12186    /// When `group_by=project_id`, this field provides the project ID of the
12187    /// grouped usage result.
12188    pub r#project_id: Option<String>,
12189
12190    /// When `group_by=user_id`, this field provides the user ID of the grouped
12191    /// usage result.
12192    pub r#user_id: Option<String>,
12193
12194    /// When `group_by=api_key_id`, this field provides the API key ID of the
12195    /// grouped usage result.
12196    pub r#api_key_id: Option<String>,
12197
12198    /// When `group_by=model`, this field provides the model name of the grouped
12199    /// usage result.
12200    pub r#model: Option<String>,
12201}
12202
12203#[derive(Clone, Debug, Default)]
12204#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12205pub struct UsageResponse {
12206    pub r#object: String,
12207
12208    pub r#data: Vec<UsageTimeBucket>,
12209
12210    pub r#has_more: bool,
12211
12212    pub r#next_page: String,
12213}
12214
12215#[derive(Clone, Debug, Default)]
12216#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12217pub struct UsageTimeBucket {
12218    pub r#object: String,
12219
12220    pub r#start_time: i64,
12221
12222    pub r#end_time: i64,
12223
12224    pub r#result: Vec<UsageTimeBucket_Result>,
12225}
12226
12227#[derive(Clone, Debug)]
12228#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12229#[cfg_attr(feature = "serde", serde(untagged))]
12230pub enum UsageTimeBucket_Result {
12231    UsageCompletionsResult(UsageCompletionsResult),
12232
12233    UsageEmbeddingsResult(UsageEmbeddingsResult),
12234
12235    UsageModerationsResult(UsageModerationsResult),
12236
12237    UsageImagesResult(UsageImagesResult),
12238
12239    UsageAudioSpeechesResult(UsageAudioSpeechesResult),
12240
12241    UsageAudioTranscriptionsResult(UsageAudioTranscriptionsResult),
12242
12243    UsageVectorStoresResult(UsageVectorStoresResult),
12244
12245    UsageCodeInterpreterSessionsResult(UsageCodeInterpreterSessionsResult),
12246
12247    CostsResult(CostsResult),
12248}
12249
12250/// The aggregated vector stores usage details of the specific time bucket.
12251#[derive(Clone, Debug, Default)]
12252#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12253pub struct UsageVectorStoresResult {
12254    pub r#object: String,
12255
12256    /// The vector stores usage in bytes.
12257    pub r#usage_bytes: i64,
12258
12259    /// When `group_by=project_id`, this field provides the project ID of the
12260    /// grouped usage result.
12261    pub r#project_id: Option<String>,
12262}
12263
12264/// Represents an individual `user` within an organization.
12265#[derive(Clone, Debug, Default)]
12266#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12267pub struct User {
12268    /// The object type, which is always `organization.user`
12269    pub r#object: String,
12270
12271    /// The identifier, which can be referenced in API endpoints
12272    pub r#id: String,
12273
12274    /// The name of the user
12275    pub r#name: String,
12276
12277    /// The email address of the user
12278    pub r#email: String,
12279
12280    /// `owner` or `reader`
12281    pub r#role: String,
12282
12283    /// The Unix timestamp (in seconds) of when the user was added.
12284    pub r#added_at: i64,
12285}
12286
12287#[derive(Clone, Debug, Default)]
12288#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12289pub struct UserDeleteResponse {
12290    pub r#object: String,
12291
12292    pub r#id: String,
12293
12294    pub r#deleted: bool,
12295}
12296
12297#[derive(Clone, Debug, Default)]
12298#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12299pub struct UserListResponse {
12300    pub r#object: String,
12301
12302    pub r#data: Vec<User>,
12303
12304    pub r#first_id: String,
12305
12306    pub r#last_id: String,
12307
12308    pub r#has_more: bool,
12309}
12310
12311#[derive(Clone, Debug, Default)]
12312#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12313pub struct UserRoleUpdateRequest {
12314    /// `owner` or `reader`
12315    pub r#role: String,
12316}
12317
12318/// The expiration policy for a vector store.
12319#[derive(Clone, Debug, Default)]
12320#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12321pub struct VectorStoreExpirationAfter {
12322    /// Anchor timestamp after which the expiration policy applies.
12323    pub r#anchor: String,
12324
12325    /// The number of days after the anchor time that the vector store will
12326    /// expire.
12327    pub r#days: i64,
12328}
12329
12330/// Set of 16 key-value pairs that can be attached to an object.
12331#[derive(Clone, Debug, Default)]
12332#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12333pub struct VectorStoreFileAttributes;
12334
12335/// A batch of files attached to a vector store.
12336#[derive(Clone, Debug)]
12337#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12338pub struct VectorStoreFileBatchObject {
12339    /// The identifier, which can be referenced in API endpoints.
12340    pub r#id: String,
12341
12342    /// The object type, which is always `vector_store.file_batch`.
12343    pub r#object: String,
12344
12345    /// The Unix timestamp (in seconds) for when the vector store files batch
12346    /// was created.
12347    pub r#created_at: i64,
12348
12349    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
12350    /// that the [File](/docs/api-reference/files) is attached to.
12351    pub r#vector_store_id: String,
12352
12353    /// The status of the vector store files batch, which can be either
12354    /// `in_progress`, `completed`, `cancelled` or `failed`.
12355    pub r#status: String,
12356
12357    pub r#file_counts: VectorStoreFileBatchObject_FileCounts,
12358}
12359
12360#[derive(Clone, Debug, Default)]
12361#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12362pub struct VectorStoreFileBatchObject_FileCounts {
12363    /// The number of files that are currently being processed.
12364    pub r#in_progress: i64,
12365
12366    /// The number of files that have been processed.
12367    pub r#completed: i64,
12368
12369    /// The number of files that have failed to process.
12370    pub r#failed: i64,
12371
12372    /// The number of files that where cancelled.
12373    pub r#cancelled: i64,
12374
12375    /// The total number of files.
12376    pub r#total: i64,
12377}
12378
12379/// Represents the parsed content of a vector store file.
12380#[derive(Clone, Debug, Default)]
12381#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12382pub struct VectorStoreFileContentResponse {
12383    /// The object type, which is always `vector_store.file_content.page`
12384    pub r#object: String,
12385
12386    /// Parsed content of the file.
12387    pub r#data: Vec<VectorStoreFileContentResponse_Data>,
12388
12389    /// Indicates if there are more content pages to fetch.
12390    pub r#has_more: bool,
12391
12392    /// The token for the next page, if any.
12393    pub r#next_page: Option<String>,
12394}
12395
12396#[derive(Clone, Debug, Default)]
12397#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12398pub struct VectorStoreFileContentResponse_Data {
12399    /// The content type (currently only `"text"`)
12400    pub r#type: Option<String>,
12401
12402    /// The text content
12403    pub r#text: Option<String>,
12404}
12405
12406/// A list of files attached to a vector store.
12407#[derive(Clone, Debug, Default)]
12408#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12409pub struct VectorStoreFileObject {
12410    /// The identifier, which can be referenced in API endpoints.
12411    pub r#id: String,
12412
12413    /// The object type, which is always `vector_store.file`.
12414    pub r#object: String,
12415
12416    /// The total vector store usage in bytes.
12417    pub r#usage_bytes: i64,
12418
12419    /// The Unix timestamp (in seconds) for when the vector store file was
12420    /// created.
12421    pub r#created_at: i64,
12422
12423    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
12424    /// that the [File](/docs/api-reference/files) is attached to.
12425    pub r#vector_store_id: String,
12426
12427    /// The status of the vector store file, which can be either `in_progress`,
12428    /// `completed`, `cancelled`, or `failed`.
12429    pub r#status: String,
12430
12431    pub r#last_error: Option<VectorStoreFileObject_LastError>,
12432
12433    pub r#chunking_strategy: Option<VectorStoreFileObject_ChunkingStrategy>,
12434
12435    pub r#attributes: Option<VectorStoreFileAttributes>,
12436}
12437
12438/// The strategy used to chunk the file.
12439#[derive(Clone, Debug)]
12440#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12441#[cfg_attr(feature = "serde", serde(untagged))]
12442pub enum VectorStoreFileObject_ChunkingStrategy {
12443    StaticChunkingStrategyResponseParam(StaticChunkingStrategyResponseParam),
12444
12445    OtherChunkingStrategyResponseParam(OtherChunkingStrategyResponseParam),
12446}
12447
12448/// The last error associated with this vector store file.
12449#[derive(Clone, Debug, Default)]
12450#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12451pub struct VectorStoreFileObject_LastError {
12452    /// One of `server_error` or `rate_limit_exceeded`.
12453    pub r#code: String,
12454
12455    /// A human-readable description of the error.
12456    pub r#message: String,
12457}
12458
12459/// A vector store is a collection of processed files can be used by the
12460/// `file_search` tool.
12461#[derive(Clone, Debug)]
12462#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12463pub struct VectorStoreObject {
12464    /// The identifier, which can be referenced in API endpoints.
12465    pub r#id: String,
12466
12467    /// The object type, which is always `vector_store`.
12468    pub r#object: String,
12469
12470    /// The Unix timestamp (in seconds) for when the vector store was created.
12471    pub r#created_at: i64,
12472
12473    /// The name of the vector store.
12474    pub r#name: String,
12475
12476    /// The total number of bytes used by the files in the vector store.
12477    pub r#usage_bytes: i64,
12478
12479    pub r#file_counts: VectorStoreObject_FileCounts,
12480
12481    /// The status of the vector store, which can be either `expired`,
12482    /// `in_progress`, or `completed`.
12483    pub r#status: String,
12484
12485    pub r#expires_after: Option<VectorStoreExpirationAfter>,
12486
12487    /// The Unix timestamp (in seconds) for when the vector store will expire.
12488    pub r#expires_at: Option<i64>,
12489
12490    /// The Unix timestamp (in seconds) for when the vector store was last
12491    /// active.
12492    pub r#last_active_at: Option<i64>,
12493
12494    pub r#metadata: Option<Metadata>,
12495}
12496
12497#[derive(Clone, Debug, Default)]
12498#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12499pub struct VectorStoreObject_FileCounts {
12500    /// The number of files that are currently being processed.
12501    pub r#in_progress: i64,
12502
12503    /// The number of files that have been successfully processed.
12504    pub r#completed: i64,
12505
12506    /// The number of files that have failed to process.
12507    pub r#failed: i64,
12508
12509    /// The number of files that were cancelled.
12510    pub r#cancelled: i64,
12511
12512    /// The total number of files.
12513    pub r#total: i64,
12514}
12515
12516#[derive(Clone, Debug)]
12517#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12518pub struct VectorStoreSearchRequest {
12519    pub r#query: VectorStoreSearchRequest_Query,
12520
12521    /// Whether to rewrite the natural language query for vector search.
12522    pub r#rewrite_query: Option<bool>,
12523
12524    /// The maximum number of results to return.
12525    pub r#max_num_results: Option<i64>,
12526
12527    pub r#filters: Option<VectorStoreSearchRequest_Filters>,
12528
12529    pub r#ranking_options: Option<VectorStoreSearchRequest_RankingOptions>,
12530}
12531
12532/// A filter to apply based on file attributes.
12533#[derive(Clone, Debug)]
12534#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12535#[cfg_attr(feature = "serde", serde(untagged))]
12536pub enum VectorStoreSearchRequest_Filters {
12537    ComparisonFilter(ComparisonFilter),
12538
12539    CompoundFilter(CompoundFilter),
12540}
12541
12542/// A query string for a search
12543#[derive(Clone, Debug)]
12544#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12545#[cfg_attr(feature = "serde", serde(untagged))]
12546pub enum VectorStoreSearchRequest_Query {
12547    Text(String),
12548
12549    TextArray(Vec<String>),
12550}
12551
12552/// Ranking options for search.
12553#[derive(Clone, Debug, Default)]
12554#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12555pub struct VectorStoreSearchRequest_RankingOptions {
12556    pub r#ranker: Option<String>,
12557
12558    pub r#score_threshold: Option<f64>,
12559}
12560
12561#[derive(Clone, Debug, Default)]
12562#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12563pub struct VectorStoreSearchResultContentObject {
12564    /// The type of content.
12565    pub r#type: String,
12566
12567    /// The text content returned from search.
12568    pub r#text: String,
12569}
12570
12571#[derive(Clone, Debug, Default)]
12572#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12573pub struct VectorStoreSearchResultItem {
12574    /// The ID of the vector store file.
12575    pub r#file_id: String,
12576
12577    /// The name of the vector store file.
12578    pub r#filename: String,
12579
12580    /// The similarity score for the result.
12581    pub r#score: f64,
12582
12583    pub r#attributes: Option<VectorStoreFileAttributes>,
12584
12585    /// Content chunks from the file.
12586    pub r#content: Vec<VectorStoreSearchResultContentObject>,
12587}
12588
12589#[derive(Clone, Debug, Default)]
12590#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12591pub struct VectorStoreSearchResultsPage {
12592    /// The object type, which is always `vector_store.search_results.page`
12593    pub r#object: String,
12594
12595    pub r#search_query: Vec<String>,
12596
12597    /// The list of search result items.
12598    pub r#data: Vec<VectorStoreSearchResultItem>,
12599
12600    /// Indicates if there are more results to fetch.
12601    pub r#has_more: bool,
12602
12603    /// The token for the next page, if any.
12604    pub r#next_page: Option<String>,
12605}
12606
12607pub type VoiceIdsShared = String;
12608
12609/// A wait action.
12610#[derive(Clone, Debug, Default)]
12611#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12612pub struct Wait {
12613    /// Specifies the event type.
12614    pub r#type: String,
12615}
12616
12617/// High level guidance for the amount of context window space to use for the
12618/// search.
12619#[derive(Clone, Debug)]
12620#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12621pub enum WebSearchContextSize {
12622    #[cfg_attr(feature = "serde", serde(rename = "low"))]
12623    Low,
12624
12625    #[cfg_attr(feature = "serde", serde(rename = "medium"))]
12626    Medium,
12627
12628    #[cfg_attr(feature = "serde", serde(rename = "high"))]
12629    High,
12630
12631    #[cfg_attr(feature = "serde", serde(untagged))]
12632    Other(String),
12633}
12634
12635/// Approximate location parameters for the search.
12636#[derive(Clone, Debug, Default)]
12637#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12638pub struct WebSearchLocation {
12639    /// The two-letter [ISO country
12640    /// code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g.
12641    pub r#country: Option<String>,
12642
12643    /// Free text input for the region of the user, e.g.
12644    pub r#region: Option<String>,
12645
12646    /// Free text input for the city of the user, e.g.
12647    pub r#city: Option<String>,
12648
12649    /// The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of
12650    /// the user, e.g.
12651    pub r#timezone: Option<String>,
12652}
12653
12654/// This tool searches the web for relevant results to use in a response.
12655#[derive(Clone, Debug, Default)]
12656#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12657pub struct WebSearchPreviewTool {
12658    /// The type of the web search tool.
12659    pub r#type: String,
12660
12661    pub r#user_location: Option<WebSearchPreviewTool_UserLocation>,
12662
12663    /// High level guidance for the amount of context window space to use for
12664    /// the search.
12665    pub r#search_context_size: Option<String>,
12666}
12667
12668pub type WebSearchPreviewTool_UserLocation = Option<WebSearchPreviewTool_UserLocation_1>;
12669
12670/// The user's location.
12671pub type WebSearchPreviewTool_UserLocation_1 = ApproximateLocation;
12672
12673/// The results of a web search tool call.
12674#[derive(Clone, Debug, Default)]
12675#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12676pub struct WebSearchToolCall {
12677    /// The unique ID of the web search tool call.
12678    pub r#id: String,
12679
12680    /// The type of the web search tool call.
12681    pub r#type: String,
12682
12683    /// The status of the web search tool call.
12684    pub r#status: String,
12685}
12686
12687include!("schemas/footer.rs");