known_types_openai/
components.rs

1// This is free and unencumbered software released into the public domain.
2
3//! OpenAI API components
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: 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: String,
49
50    /// The object type, which is always organization.user
51    pub r#object: String,
52
53    /// The identifier, which can be referenced in API endpoints
54    pub r#id: String,
55
56    /// The name of the user
57    pub r#name: String,
58
59    /// The Unix timestamp (in seconds) of when the user was created
60    pub r#created_at: i64,
61
62    /// Always `owner`
63    pub r#role: String,
64}
65
66#[derive(Clone, Debug)]
67#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
68pub enum Annotation {
69    FileCitationBody(FileCitationBody),
70
71    UrlCitationBody(UrlCitationBody),
72
73    FilePath(FilePath),
74}
75
76#[derive(Clone, Debug)]
77#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
78pub struct ApiKeyList {
79    pub r#object: String,
80
81    pub r#data: Vec<AdminApiKey>,
82
83    pub r#has_more: bool,
84
85    pub r#first_id: String,
86
87    pub r#last_id: String,
88}
89
90#[derive(Clone, Debug)]
91#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
92pub struct ApproximateLocation {
93    /// The type of location approximation.
94    pub r#type: String,
95
96    pub r#country: ApproximateLocation_Country,
97
98    pub r#region: ApproximateLocation_Region,
99
100    pub r#city: ApproximateLocation_City,
101
102    pub r#timezone: ApproximateLocation_Timezone,
103}
104
105pub type ApproximateLocation_City = Option<String>;
106
107pub type ApproximateLocation_Country = Option<String>;
108
109pub type ApproximateLocation_Region = Option<String>;
110
111pub type ApproximateLocation_Timezone = Option<String>;
112
113/// Represents an `assistant` that can call the model and use tools.
114#[derive(Clone, Debug)]
115#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
116pub struct AssistantObject {
117    /// The identifier, which can be referenced in API endpoints.
118    pub r#id: String,
119
120    /// The object type, which is always `assistant`.
121    pub r#object: String,
122
123    /// The Unix timestamp (in seconds) for when the assistant was created.
124    pub r#created_at: i64,
125
126    /// The name of the assistant.
127    pub r#name: Option<String>,
128
129    /// The description of the assistant.
130    pub r#description: Option<String>,
131
132    /// ID of the model to use.
133    pub r#model: String,
134
135    /// The system instructions that the assistant uses.
136    pub r#instructions: Option<String>,
137
138    /// A list of tool enabled on the assistant.
139    pub r#tools: Vec<AssistantObject_Tools>,
140
141    pub r#tool_resources: Option<AssistantObject_ToolResources>,
142
143    pub r#metadata: Option<Metadata>,
144
145    /// What sampling temperature to use, between 0 and 2.
146    pub r#temperature: Option<f64>,
147
148    /// An alternative to sampling with temperature, called nucleus sampling,
149    /// where the model considers the results of the tokens with top_p
150    /// probability mass.
151    pub r#top_p: Option<f64>,
152
153    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
154}
155
156/// A set of resources that are used by the assistant's tools.
157#[derive(Clone, Debug)]
158#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
159pub struct AssistantObject_ToolResources {
160    pub r#code_interpreter: AssistantObject_ToolResources_CodeInterpreter,
161
162    pub r#file_search: AssistantObject_ToolResources_FileSearch,
163}
164
165#[derive(Clone, Debug)]
166#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
167pub struct AssistantObject_ToolResources_CodeInterpreter {
168    /// A list of [file](/docs/api-reference/files) IDs made available to the
169    /// `code_interpreter`` tool.
170    pub r#file_ids: Vec<String>,
171}
172
173#[derive(Clone, Debug)]
174#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
175pub struct AssistantObject_ToolResources_FileSearch {
176    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
177    /// attached to this assistant.
178    pub r#vector_store_ids: Vec<String>,
179}
180
181#[derive(Clone, Debug)]
182#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
183pub enum AssistantObject_Tools {
184    AssistantToolsCode(AssistantToolsCode),
185
186    AssistantToolsFileSearch(AssistantToolsFileSearch),
187
188    AssistantToolsFunction(AssistantToolsFunction),
189}
190
191/// Represents an event emitted when streaming a Run.
192#[derive(Clone, Debug)]
193#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
194pub enum AssistantStreamEvent {
195    ThreadStreamEvent(ThreadStreamEvent),
196
197    RunStreamEvent(RunStreamEvent),
198
199    RunStepStreamEvent(RunStepStreamEvent),
200
201    MessageStreamEvent(MessageStreamEvent),
202
203    ErrorEvent(ErrorEvent),
204
205    DoneEvent(DoneEvent),
206}
207
208#[derive(Clone, Debug)]
209#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
210pub struct AssistantSupportedModels(pub String);
211
212#[derive(Clone, Debug, Default)]
213#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
214pub struct AssistantToolsCode {
215    /// The type of tool being defined: `code_interpreter`
216    pub r#type: String,
217}
218
219#[derive(Clone, Debug)]
220#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
221pub struct AssistantToolsFileSearch {
222    /// The type of tool being defined: `file_search`
223    pub r#type: String,
224
225    pub r#file_search: AssistantToolsFileSearch_FileSearch,
226}
227
228#[derive(Clone, Debug, Default)]
229#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
230pub struct AssistantToolsFileSearchTypeOnly {
231    /// The type of tool being defined: `file_search`
232    pub r#type: String,
233}
234
235/// Overrides for the file search tool.
236#[derive(Clone, Debug)]
237#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
238pub struct AssistantToolsFileSearch_FileSearch {
239    /// The maximum number of results the file search tool should output.
240    pub r#max_num_results: i64,
241
242    pub r#ranking_options: FileSearchRankingOptions,
243}
244
245#[derive(Clone, Debug)]
246#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
247pub struct AssistantToolsFunction {
248    /// The type of tool being defined: `function`
249    pub r#type: String,
250
251    pub r#function: FunctionObject,
252}
253
254/// Specifies the format that the model must output.
255#[derive(Clone, Debug)]
256#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
257pub enum AssistantsApiResponseFormatOption {
258    /// `auto` is the default value
259    String(String),
260
261    ResponseFormatText(ResponseFormatText),
262
263    ResponseFormatJsonObject(ResponseFormatJsonObject),
264
265    ResponseFormatJsonSchema(ResponseFormatJsonSchema),
266}
267
268/// Controls which (if any) tool is called by the model.
269#[derive(Clone, Debug)]
270#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
271pub enum AssistantsApiToolChoiceOption {
272    /// `none` means the model will not call any tools and instead generates a
273    /// message.
274    String(String),
275
276    AssistantsNamedToolChoice(AssistantsNamedToolChoice),
277}
278
279/// Specifies a tool the model should use.
280#[derive(Clone, Debug)]
281#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
282pub struct AssistantsNamedToolChoice {
283    /// The type of the tool.
284    pub r#type: String,
285
286    pub r#function: AssistantsNamedToolChoice_Function,
287}
288
289#[derive(Clone, Debug, Default)]
290#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
291pub struct AssistantsNamedToolChoice_Function {
292    /// The name of the function to call.
293    pub r#name: String,
294}
295
296/// The format of the output, in one of these options: `json`, `text`, `srt`,
297/// `verbose_json`, or `vtt`.
298#[derive(Clone, Debug)]
299#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
300pub struct AudioResponseFormat(pub String);
301
302/// A log of a user action or configuration change within this organization.
303#[derive(Clone, Debug)]
304#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
305pub struct AuditLog {
306    /// The ID of this log.
307    pub r#id: String,
308
309    pub r#type: AuditLogEventType,
310
311    /// The Unix timestamp (in seconds) of the event.
312    pub r#effective_at: i64,
313
314    pub r#project: AuditLog_Project,
315
316    pub r#actor: AuditLogActor,
317
318    #[cfg_attr(feature = "serde", serde(rename = "api_key.created"))]
319    pub r#api_key_created: AuditLog_ApiKeyCreated,
320
321    #[cfg_attr(feature = "serde", serde(rename = "api_key.updated"))]
322    pub r#api_key_updated: AuditLog_ApiKeyUpdated,
323
324    #[cfg_attr(feature = "serde", serde(rename = "api_key.deleted"))]
325    pub r#api_key_deleted: AuditLog_ApiKeyDeleted,
326
327    #[cfg_attr(feature = "serde", serde(rename = "checkpoint_permission.created"))]
328    pub r#checkpoint_permission_created: AuditLog_CheckpointPermissionCreated,
329
330    #[cfg_attr(feature = "serde", serde(rename = "checkpoint_permission.deleted"))]
331    pub r#checkpoint_permission_deleted: AuditLog_CheckpointPermissionDeleted,
332
333    #[cfg_attr(feature = "serde", serde(rename = "invite.sent"))]
334    pub r#invite_sent: AuditLog_InviteSent,
335
336    #[cfg_attr(feature = "serde", serde(rename = "invite.accepted"))]
337    pub r#invite_accepted: AuditLog_InviteAccepted,
338
339    #[cfg_attr(feature = "serde", serde(rename = "invite.deleted"))]
340    pub r#invite_deleted: AuditLog_InviteDeleted,
341
342    #[cfg_attr(feature = "serde", serde(rename = "login.failed"))]
343    pub r#login_failed: AuditLog_LoginFailed,
344
345    #[cfg_attr(feature = "serde", serde(rename = "logout.failed"))]
346    pub r#logout_failed: AuditLog_LogoutFailed,
347
348    #[cfg_attr(feature = "serde", serde(rename = "organization.updated"))]
349    pub r#organization_updated: AuditLog_OrganizationUpdated,
350
351    #[cfg_attr(feature = "serde", serde(rename = "project.created"))]
352    pub r#project_created: AuditLog_ProjectCreated,
353
354    #[cfg_attr(feature = "serde", serde(rename = "project.updated"))]
355    pub r#project_updated: AuditLog_ProjectUpdated,
356
357    #[cfg_attr(feature = "serde", serde(rename = "project.archived"))]
358    pub r#project_archived: AuditLog_ProjectArchived,
359
360    #[cfg_attr(feature = "serde", serde(rename = "rate_limit.updated"))]
361    pub r#rate_limit_updated: AuditLog_RateLimitUpdated,
362
363    #[cfg_attr(feature = "serde", serde(rename = "rate_limit.deleted"))]
364    pub r#rate_limit_deleted: AuditLog_RateLimitDeleted,
365
366    #[cfg_attr(feature = "serde", serde(rename = "service_account.created"))]
367    pub r#service_account_created: AuditLog_ServiceAccountCreated,
368
369    #[cfg_attr(feature = "serde", serde(rename = "service_account.updated"))]
370    pub r#service_account_updated: AuditLog_ServiceAccountUpdated,
371
372    #[cfg_attr(feature = "serde", serde(rename = "service_account.deleted"))]
373    pub r#service_account_deleted: AuditLog_ServiceAccountDeleted,
374
375    #[cfg_attr(feature = "serde", serde(rename = "user.added"))]
376    pub r#user_added: AuditLog_UserAdded,
377
378    #[cfg_attr(feature = "serde", serde(rename = "user.updated"))]
379    pub r#user_updated: AuditLog_UserUpdated,
380
381    #[cfg_attr(feature = "serde", serde(rename = "user.deleted"))]
382    pub r#user_deleted: AuditLog_UserDeleted,
383
384    #[cfg_attr(feature = "serde", serde(rename = "certificate.created"))]
385    pub r#certificate_created: AuditLog_CertificateCreated,
386
387    #[cfg_attr(feature = "serde", serde(rename = "certificate.updated"))]
388    pub r#certificate_updated: AuditLog_CertificateUpdated,
389
390    #[cfg_attr(feature = "serde", serde(rename = "certificate.deleted"))]
391    pub r#certificate_deleted: AuditLog_CertificateDeleted,
392
393    #[cfg_attr(feature = "serde", serde(rename = "certificates.activated"))]
394    pub r#certificates_activated: AuditLog_CertificatesActivated,
395
396    #[cfg_attr(feature = "serde", serde(rename = "certificates.deactivated"))]
397    pub r#certificates_deactivated: AuditLog_CertificatesDeactivated,
398}
399
400/// The actor who performed the audit logged action.
401#[derive(Clone, Debug)]
402#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
403pub struct AuditLogActor {
404    /// The type of actor.
405    pub r#type: String,
406
407    pub r#session: AuditLogActorSession,
408
409    pub r#api_key: AuditLogActorApiKey,
410}
411
412/// The API Key used to perform the audit logged action.
413#[derive(Clone, Debug)]
414#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
415pub struct AuditLogActorApiKey {
416    /// The tracking id of the API key.
417    pub r#id: String,
418
419    /// The type of API key.
420    pub r#type: String,
421
422    pub r#user: AuditLogActorUser,
423
424    pub r#service_account: AuditLogActorServiceAccount,
425}
426
427/// The service account that performed the audit logged action.
428#[derive(Clone, Debug, Default)]
429#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
430pub struct AuditLogActorServiceAccount {
431    /// The service account id.
432    pub r#id: String,
433}
434
435/// The session in which the audit logged action was performed.
436#[derive(Clone, Debug)]
437#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
438pub struct AuditLogActorSession {
439    pub r#user: AuditLogActorUser,
440
441    /// The IP address from which the action was performed.
442    pub r#ip_address: String,
443}
444
445/// The user who performed the audit logged action.
446#[derive(Clone, Debug, Default)]
447#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
448pub struct AuditLogActorUser {
449    /// The user id.
450    pub r#id: String,
451
452    /// The user email.
453    pub r#email: String,
454}
455
456/// The event type.
457#[derive(Clone, Debug)]
458#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
459pub struct AuditLogEventType(pub String);
460
461/// The details for events with this `type`.
462#[derive(Clone, Debug)]
463#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
464pub struct AuditLog_ApiKeyCreated {
465    /// The tracking ID of the API key.
466    pub r#id: String,
467
468    pub r#data: AuditLog_ApiKeyCreated_Data,
469}
470
471/// The payload used to create the API key.
472#[derive(Clone, Debug)]
473#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
474pub struct AuditLog_ApiKeyCreated_Data {
475    /// A list of scopes allowed for the API key, e.g.
476    pub r#scopes: Vec<String>,
477}
478
479/// The details for events with this `type`.
480#[derive(Clone, Debug, Default)]
481#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
482pub struct AuditLog_ApiKeyDeleted {
483    /// The tracking ID of the API key.
484    pub r#id: String,
485}
486
487/// The details for events with this `type`.
488#[derive(Clone, Debug)]
489#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
490pub struct AuditLog_ApiKeyUpdated {
491    /// The tracking ID of the API key.
492    pub r#id: String,
493
494    pub r#changes_requested: AuditLog_ApiKeyUpdated_ChangesRequested,
495}
496
497/// The payload used to update the API key.
498#[derive(Clone, Debug)]
499#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
500pub struct AuditLog_ApiKeyUpdated_ChangesRequested {
501    /// A list of scopes allowed for the API key, e.g.
502    pub r#scopes: Vec<String>,
503}
504
505/// The details for events with this `type`.
506#[derive(Clone, Debug, Default)]
507#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
508pub struct AuditLog_CertificateCreated {
509    /// The certificate ID.
510    pub r#id: String,
511
512    /// The name of the certificate.
513    pub r#name: String,
514}
515
516/// The details for events with this `type`.
517#[derive(Clone, Debug, Default)]
518#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
519pub struct AuditLog_CertificateDeleted {
520    /// The certificate ID.
521    pub r#id: String,
522
523    /// The name of the certificate.
524    pub r#name: String,
525
526    /// The certificate content in PEM format.
527    pub r#certificate: String,
528}
529
530/// The details for events with this `type`.
531#[derive(Clone, Debug, Default)]
532#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
533pub struct AuditLog_CertificateUpdated {
534    /// The certificate ID.
535    pub r#id: String,
536
537    /// The name of the certificate.
538    pub r#name: String,
539}
540
541/// The details for events with this `type`.
542#[derive(Clone, Debug)]
543#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
544pub struct AuditLog_CertificatesActivated {
545    pub r#certificates: Vec<AuditLog_CertificatesActivated_Certificates>,
546}
547
548#[derive(Clone, Debug, Default)]
549#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
550pub struct AuditLog_CertificatesActivated_Certificates {
551    /// The certificate ID.
552    pub r#id: String,
553
554    /// The name of the certificate.
555    pub r#name: String,
556}
557
558/// The details for events with this `type`.
559#[derive(Clone, Debug)]
560#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
561pub struct AuditLog_CertificatesDeactivated {
562    pub r#certificates: Vec<AuditLog_CertificatesDeactivated_Certificates>,
563}
564
565#[derive(Clone, Debug, Default)]
566#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
567pub struct AuditLog_CertificatesDeactivated_Certificates {
568    /// The certificate ID.
569    pub r#id: String,
570
571    /// The name of the certificate.
572    pub r#name: String,
573}
574
575/// The project and fine-tuned model checkpoint that the checkpoint permission
576/// was created for.
577#[derive(Clone, Debug)]
578#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
579pub struct AuditLog_CheckpointPermissionCreated {
580    /// The ID of the checkpoint permission.
581    pub r#id: String,
582
583    pub r#data: AuditLog_CheckpointPermissionCreated_Data,
584}
585
586/// The payload used to create the checkpoint permission.
587#[derive(Clone, Debug, Default)]
588#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
589pub struct AuditLog_CheckpointPermissionCreated_Data {
590    /// The ID of the project that the checkpoint permission was created for.
591    pub r#project_id: String,
592
593    /// The ID of the fine-tuned model checkpoint.
594    pub r#fine_tuned_model_checkpoint: String,
595}
596
597/// The details for events with this `type`.
598#[derive(Clone, Debug, Default)]
599#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
600pub struct AuditLog_CheckpointPermissionDeleted {
601    /// The ID of the checkpoint permission.
602    pub r#id: String,
603}
604
605/// The details for events with this `type`.
606#[derive(Clone, Debug, Default)]
607#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
608pub struct AuditLog_InviteAccepted {
609    /// The ID of the invite.
610    pub r#id: String,
611}
612
613/// The details for events with this `type`.
614#[derive(Clone, Debug, Default)]
615#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
616pub struct AuditLog_InviteDeleted {
617    /// The ID of the invite.
618    pub r#id: String,
619}
620
621/// The details for events with this `type`.
622#[derive(Clone, Debug)]
623#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
624pub struct AuditLog_InviteSent {
625    /// The ID of the invite.
626    pub r#id: String,
627
628    pub r#data: AuditLog_InviteSent_Data,
629}
630
631/// The payload used to create the invite.
632#[derive(Clone, Debug, Default)]
633#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
634pub struct AuditLog_InviteSent_Data {
635    /// The email invited to the organization.
636    pub r#email: String,
637
638    /// The role the email was invited to be.
639    pub r#role: String,
640}
641
642/// The details for events with this `type`.
643#[derive(Clone, Debug, Default)]
644#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
645pub struct AuditLog_LoginFailed {
646    /// The error code of the failure.
647    pub r#error_code: String,
648
649    /// The error message of the failure.
650    pub r#error_message: String,
651}
652
653/// The details for events with this `type`.
654#[derive(Clone, Debug, Default)]
655#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
656pub struct AuditLog_LogoutFailed {
657    /// The error code of the failure.
658    pub r#error_code: String,
659
660    /// The error message of the failure.
661    pub r#error_message: String,
662}
663
664/// The details for events with this `type`.
665#[derive(Clone, Debug)]
666#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
667pub struct AuditLog_OrganizationUpdated {
668    /// The organization ID.
669    pub r#id: String,
670
671    pub r#changes_requested: AuditLog_OrganizationUpdated_ChangesRequested,
672}
673
674/// The payload used to update the organization settings.
675#[derive(Clone, Debug)]
676#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
677pub struct AuditLog_OrganizationUpdated_ChangesRequested {
678    /// The organization title.
679    pub r#title: String,
680
681    /// The organization description.
682    pub r#description: String,
683
684    /// The organization name.
685    pub r#name: String,
686
687    pub r#settings: AuditLog_OrganizationUpdated_ChangesRequested_Settings,
688}
689
690#[derive(Clone, Debug, Default)]
691#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
692pub struct AuditLog_OrganizationUpdated_ChangesRequested_Settings {
693    /// Visibility of the threads page which shows messages created with the
694    /// Assistants API and Playground.
695    pub r#threads_ui_visibility: String,
696
697    /// Visibility of the usage dashboard which shows activity and costs for
698    /// your organization.
699    pub r#usage_dashboard_visibility: String,
700}
701
702/// The project that the action was scoped to.
703#[derive(Clone, Debug, Default)]
704#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
705pub struct AuditLog_Project {
706    /// The project ID.
707    pub r#id: String,
708
709    /// The project title.
710    pub r#name: String,
711}
712
713/// The details for events with this `type`.
714#[derive(Clone, Debug, Default)]
715#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
716pub struct AuditLog_ProjectArchived {
717    /// The project ID.
718    pub r#id: String,
719}
720
721/// The details for events with this `type`.
722#[derive(Clone, Debug)]
723#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
724pub struct AuditLog_ProjectCreated {
725    /// The project ID.
726    pub r#id: String,
727
728    pub r#data: AuditLog_ProjectCreated_Data,
729}
730
731/// The payload used to create the project.
732#[derive(Clone, Debug, Default)]
733#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
734pub struct AuditLog_ProjectCreated_Data {
735    /// The project name.
736    pub r#name: String,
737
738    /// The title of the project as seen on the dashboard.
739    pub r#title: String,
740}
741
742/// The details for events with this `type`.
743#[derive(Clone, Debug)]
744#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
745pub struct AuditLog_ProjectUpdated {
746    /// The project ID.
747    pub r#id: String,
748
749    pub r#changes_requested: AuditLog_ProjectUpdated_ChangesRequested,
750}
751
752/// The payload used to update the project.
753#[derive(Clone, Debug, Default)]
754#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
755pub struct AuditLog_ProjectUpdated_ChangesRequested {
756    /// The title of the project as seen on the dashboard.
757    pub r#title: String,
758}
759
760/// The details for events with this `type`.
761#[derive(Clone, Debug, Default)]
762#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
763pub struct AuditLog_RateLimitDeleted {
764    /// The rate limit ID
765    pub r#id: String,
766}
767
768/// The details for events with this `type`.
769#[derive(Clone, Debug)]
770#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
771pub struct AuditLog_RateLimitUpdated {
772    /// The rate limit ID
773    pub r#id: String,
774
775    pub r#changes_requested: AuditLog_RateLimitUpdated_ChangesRequested,
776}
777
778/// The payload used to update the rate limits.
779#[derive(Clone, Debug, Default)]
780#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
781pub struct AuditLog_RateLimitUpdated_ChangesRequested {
782    /// The maximum requests per minute.
783    pub r#max_requests_per_1_minute: i64,
784
785    /// The maximum tokens per minute.
786    pub r#max_tokens_per_1_minute: i64,
787
788    /// The maximum images per minute.
789    pub r#max_images_per_1_minute: i64,
790
791    /// The maximum audio megabytes per minute.
792    pub r#max_audio_megabytes_per_1_minute: i64,
793
794    /// The maximum requests per day.
795    pub r#max_requests_per_1_day: i64,
796
797    /// The maximum batch input tokens per day.
798    pub r#batch_1_day_max_input_tokens: i64,
799}
800
801/// The details for events with this `type`.
802#[derive(Clone, Debug)]
803#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
804pub struct AuditLog_ServiceAccountCreated {
805    /// The service account ID.
806    pub r#id: String,
807
808    pub r#data: AuditLog_ServiceAccountCreated_Data,
809}
810
811/// The payload used to create the service account.
812#[derive(Clone, Debug, Default)]
813#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
814pub struct AuditLog_ServiceAccountCreated_Data {
815    /// The role of the service account.
816    pub r#role: String,
817}
818
819/// The details for events with this `type`.
820#[derive(Clone, Debug, Default)]
821#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
822pub struct AuditLog_ServiceAccountDeleted {
823    /// The service account ID.
824    pub r#id: String,
825}
826
827/// The details for events with this `type`.
828#[derive(Clone, Debug)]
829#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
830pub struct AuditLog_ServiceAccountUpdated {
831    /// The service account ID.
832    pub r#id: String,
833
834    pub r#changes_requested: AuditLog_ServiceAccountUpdated_ChangesRequested,
835}
836
837/// The payload used to updated the service account.
838#[derive(Clone, Debug, Default)]
839#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
840pub struct AuditLog_ServiceAccountUpdated_ChangesRequested {
841    /// The role of the service account.
842    pub r#role: String,
843}
844
845/// The details for events with this `type`.
846#[derive(Clone, Debug)]
847#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
848pub struct AuditLog_UserAdded {
849    /// The user ID.
850    pub r#id: String,
851
852    pub r#data: AuditLog_UserAdded_Data,
853}
854
855/// The payload used to add the user to the project.
856#[derive(Clone, Debug, Default)]
857#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
858pub struct AuditLog_UserAdded_Data {
859    /// The role of the user.
860    pub r#role: String,
861}
862
863/// The details for events with this `type`.
864#[derive(Clone, Debug, Default)]
865#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
866pub struct AuditLog_UserDeleted {
867    /// The user ID.
868    pub r#id: String,
869}
870
871/// The details for events with this `type`.
872#[derive(Clone, Debug)]
873#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
874pub struct AuditLog_UserUpdated {
875    /// The project ID.
876    pub r#id: String,
877
878    pub r#changes_requested: AuditLog_UserUpdated_ChangesRequested,
879}
880
881/// The payload used to update the user.
882#[derive(Clone, Debug, Default)]
883#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
884pub struct AuditLog_UserUpdated_ChangesRequested {
885    /// The role of the user.
886    pub r#role: String,
887}
888
889/// The default strategy.
890#[derive(Clone, Debug, Default)]
891#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
892pub struct AutoChunkingStrategyRequestParam {
893    /// Always `auto`.
894    pub r#type: String,
895}
896
897#[derive(Clone, Debug)]
898#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
899pub struct Batch {
900    pub r#id: String,
901
902    /// The object type, which is always `batch`.
903    pub r#object: String,
904
905    /// The OpenAI API endpoint used by the batch.
906    pub r#endpoint: String,
907
908    pub r#errors: Batch_Errors,
909
910    /// The ID of the input file for the batch.
911    pub r#input_file_id: String,
912
913    /// The time frame within which the batch should be processed.
914    pub r#completion_window: String,
915
916    /// The current status of the batch.
917    pub r#status: String,
918
919    /// The ID of the file containing the outputs of successfully executed
920    /// requests.
921    pub r#output_file_id: String,
922
923    /// The ID of the file containing the outputs of requests with errors.
924    pub r#error_file_id: String,
925
926    /// The Unix timestamp (in seconds) for when the batch was created.
927    pub r#created_at: i64,
928
929    /// The Unix timestamp (in seconds) for when the batch started processing.
930    pub r#in_progress_at: i64,
931
932    /// The Unix timestamp (in seconds) for when the batch will expire.
933    pub r#expires_at: i64,
934
935    /// The Unix timestamp (in seconds) for when the batch started finalizing.
936    pub r#finalizing_at: i64,
937
938    /// The Unix timestamp (in seconds) for when the batch was completed.
939    pub r#completed_at: i64,
940
941    /// The Unix timestamp (in seconds) for when the batch failed.
942    pub r#failed_at: i64,
943
944    /// The Unix timestamp (in seconds) for when the batch expired.
945    pub r#expired_at: i64,
946
947    /// The Unix timestamp (in seconds) for when the batch started cancelling.
948    pub r#cancelling_at: i64,
949
950    /// The Unix timestamp (in seconds) for when the batch was cancelled.
951    pub r#cancelled_at: i64,
952
953    pub r#request_counts: Batch_RequestCounts,
954
955    pub r#metadata: Option<Metadata>,
956}
957
958/// The per-line object of the batch input file
959#[derive(Clone, Debug, Default)]
960#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
961pub struct BatchRequestInput {
962    /// A developer-provided per-request id that will be used to match outputs
963    /// to inputs.
964    pub r#custom_id: String,
965
966    /// The HTTP method to be used for the request.
967    pub r#method: String,
968
969    /// The OpenAI API relative URL to be used for the request.
970    pub r#url: String,
971}
972
973/// The per-line object of the batch output and error files
974#[derive(Clone, Debug)]
975#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
976pub struct BatchRequestOutput {
977    pub r#id: String,
978
979    /// A developer-provided per-request id that will be used to match outputs
980    /// to inputs.
981    pub r#custom_id: String,
982
983    pub r#response: Option<BatchRequestOutput_Response>,
984
985    pub r#error: Option<BatchRequestOutput_Error>,
986}
987
988/// For requests that failed with a non-HTTP error, this will contain more
989/// information on the cause of the failure.
990#[derive(Clone, Debug, Default)]
991#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
992pub struct BatchRequestOutput_Error {
993    /// A machine-readable error code.
994    pub r#code: String,
995
996    /// A human-readable error message.
997    pub r#message: String,
998}
999
1000#[derive(Clone, Debug)]
1001#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1002pub struct BatchRequestOutput_Response {
1003    /// The HTTP status code of the response
1004    pub r#status_code: i64,
1005
1006    /// An unique identifier for the OpenAI API request.
1007    pub r#request_id: String,
1008
1009    /// The JSON body of the response
1010    pub r#body: BatchRequestOutput_Response_Body,
1011}
1012
1013/// The JSON body of the response
1014#[derive(Clone, Debug, Default)]
1015#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1016pub struct BatchRequestOutput_Response_Body;
1017
1018#[derive(Clone, Debug)]
1019#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1020pub struct Batch_Errors {
1021    /// The object type, which is always `list`.
1022    pub r#object: String,
1023
1024    pub r#data: Vec<Batch_Errors_Data>,
1025}
1026
1027#[derive(Clone, Debug, Default)]
1028#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1029pub struct Batch_Errors_Data {
1030    /// An error code identifying the error type.
1031    pub r#code: String,
1032
1033    /// A human-readable message providing more details about the error.
1034    pub r#message: String,
1035
1036    /// The name of the parameter that caused the error, if applicable.
1037    pub r#param: Option<String>,
1038
1039    /// The line number of the input file where the error occurred, if
1040    /// applicable.
1041    pub r#line: Option<i64>,
1042}
1043
1044/// The request counts for different statuses within the batch.
1045#[derive(Clone, Debug, Default)]
1046#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1047pub struct Batch_RequestCounts {
1048    /// Total number of requests in the batch.
1049    pub r#total: i64,
1050
1051    /// Number of requests that have been completed successfully.
1052    pub r#completed: i64,
1053
1054    /// Number of requests that have failed.
1055    pub r#failed: i64,
1056}
1057
1058/// Represents an individual `certificate` uploaded to the organization.
1059#[derive(Clone, Debug)]
1060#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1061pub struct Certificate {
1062    /// The object type.
1063    pub r#object: String,
1064
1065    /// The identifier, which can be referenced in API endpoints
1066    pub r#id: String,
1067
1068    /// The name of the certificate.
1069    pub r#name: String,
1070
1071    /// The Unix timestamp (in seconds) of when the certificate was uploaded.
1072    pub r#created_at: i64,
1073
1074    pub r#certificate_details: Certificate_CertificateDetails,
1075
1076    /// Whether the certificate is currently active at the specified scope.
1077    pub r#active: bool,
1078}
1079
1080#[derive(Clone, Debug, Default)]
1081#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1082pub struct Certificate_CertificateDetails {
1083    /// The Unix timestamp (in seconds) of when the certificate becomes valid.
1084    pub r#valid_at: i64,
1085
1086    /// The Unix timestamp (in seconds) of when the certificate expires.
1087    pub r#expires_at: i64,
1088
1089    /// The content of the certificate in PEM format.
1090    pub r#content: String,
1091}
1092
1093#[derive(Clone, Debug, Default)]
1094#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1095pub struct ChatCompletionDeleted {
1096    /// The type of object being deleted.
1097    pub r#object: String,
1098
1099    /// The ID of the chat completion that was deleted.
1100    pub r#id: String,
1101
1102    /// Whether the chat completion was deleted.
1103    pub r#deleted: bool,
1104}
1105
1106/// Specifying a particular function via `{"name": "my_function"}` forces the
1107/// model to call that function.
1108#[derive(Clone, Debug, Default)]
1109#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1110pub struct ChatCompletionFunctionCallOption {
1111    /// The name of the function to call.
1112    pub r#name: String,
1113}
1114
1115#[derive(Clone, Debug)]
1116#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1117pub struct ChatCompletionFunctions {
1118    /// A description of what the function does, used by the model to choose
1119    /// when and how to call the function.
1120    pub r#description: String,
1121
1122    /// The name of the function to be called.
1123    pub r#name: String,
1124
1125    pub r#parameters: FunctionParameters,
1126}
1127
1128/// An object representing a list of Chat Completions.
1129#[derive(Clone, Debug)]
1130#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1131pub struct ChatCompletionList {
1132    /// The type of this object.
1133    pub r#object: String,
1134
1135    /// An array of chat completion objects.
1136    pub r#data: Vec<CreateChatCompletionResponse>,
1137
1138    /// The identifier of the first chat completion in the data array.
1139    pub r#first_id: String,
1140
1141    /// The identifier of the last chat completion in the data array.
1142    pub r#last_id: String,
1143
1144    /// Indicates whether there are more Chat Completions available.
1145    pub r#has_more: bool,
1146}
1147
1148/// An object representing a list of chat completion messages.
1149#[derive(Clone, Debug)]
1150#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1151pub struct ChatCompletionMessageList {
1152    /// The type of this object.
1153    pub r#object: String,
1154
1155    /// An array of chat completion message objects.
1156    pub r#data: Vec<ChatCompletionMessageList_Data>,
1157
1158    /// The identifier of the first chat message in the data array.
1159    pub r#first_id: String,
1160
1161    /// The identifier of the last chat message in the data array.
1162    pub r#last_id: String,
1163
1164    /// Indicates whether there are more chat messages available.
1165    pub r#has_more: bool,
1166}
1167
1168#[derive(Clone, Debug, Default)]
1169#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1170pub struct ChatCompletionMessageList_Data(pub (/*AllOf*/));
1171
1172#[derive(Clone, Debug, Default)]
1173#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1174pub struct ChatCompletionMessageList_Data_Variant2 {
1175    /// The identifier of the chat message.
1176    pub r#id: String,
1177}
1178
1179#[derive(Clone, Debug)]
1180#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1181pub struct ChatCompletionMessageToolCall {
1182    /// The ID of the tool call.
1183    pub r#id: String,
1184
1185    /// The type of the tool.
1186    pub r#type: String,
1187
1188    pub r#function: ChatCompletionMessageToolCall_Function,
1189}
1190
1191#[derive(Clone, Debug)]
1192#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1193pub struct ChatCompletionMessageToolCallChunk {
1194    pub r#index: i64,
1195
1196    /// The ID of the tool call.
1197    pub r#id: String,
1198
1199    /// The type of the tool.
1200    pub r#type: String,
1201
1202    pub r#function: ChatCompletionMessageToolCallChunk_Function,
1203}
1204
1205#[derive(Clone, Debug, Default)]
1206#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1207pub struct ChatCompletionMessageToolCallChunk_Function {
1208    /// The name of the function to call.
1209    pub r#name: String,
1210
1211    /// The arguments to call the function with, as generated by the model in
1212    /// JSON format.
1213    pub r#arguments: String,
1214}
1215
1216/// The function that the model called.
1217#[derive(Clone, Debug, Default)]
1218#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1219pub struct ChatCompletionMessageToolCall_Function {
1220    /// The name of the function to call.
1221    pub r#name: String,
1222
1223    /// The arguments to call the function with, as generated by the model in
1224    /// JSON format.
1225    pub r#arguments: String,
1226}
1227
1228/// The tool calls generated by the model, such as function calls.
1229#[derive(Clone, Debug)]
1230#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1231pub struct ChatCompletionMessageToolCalls(pub Vec<ChatCompletionMessageToolCall>);
1232
1233/// Output types that you would like the model to generate for this request.
1234#[derive(Clone, Debug)]
1235#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1236pub struct ChatCompletionModalities(pub Vec<String>);
1237
1238/// Specifies a tool the model should use.
1239#[derive(Clone, Debug)]
1240#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1241pub struct ChatCompletionNamedToolChoice {
1242    /// The type of the tool.
1243    pub r#type: String,
1244
1245    pub r#function: ChatCompletionNamedToolChoice_Function,
1246}
1247
1248#[derive(Clone, Debug, Default)]
1249#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1250pub struct ChatCompletionNamedToolChoice_Function {
1251    /// The name of the function to call.
1252    pub r#name: String,
1253}
1254
1255/// Messages sent by the model in response to user messages.
1256#[derive(Clone, Debug)]
1257#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1258pub struct ChatCompletionRequestAssistantMessage {
1259    pub r#content: Option<ChatCompletionRequestAssistantMessage_Content>,
1260
1261    /// The refusal message by the assistant.
1262    pub r#refusal: Option<String>,
1263
1264    /// The role of the messages author, in this case `assistant`.
1265    pub r#role: String,
1266
1267    /// An optional name for the participant.
1268    pub r#name: String,
1269
1270    pub r#audio: Option<ChatCompletionRequestAssistantMessage_Audio>,
1271
1272    pub r#tool_calls: ChatCompletionMessageToolCalls,
1273
1274    pub r#function_call: Option<ChatCompletionRequestAssistantMessage_FunctionCall>,
1275}
1276
1277#[derive(Clone, Debug)]
1278#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1279pub enum ChatCompletionRequestAssistantMessageContentPart {
1280    ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
1281
1282    ChatCompletionRequestMessageContentPartRefusal(ChatCompletionRequestMessageContentPartRefusal),
1283}
1284
1285/// Data about a previous audio response from the model.
1286#[derive(Clone, Debug, Default)]
1287#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1288pub struct ChatCompletionRequestAssistantMessage_Audio {
1289    /// Unique identifier for a previous audio response from the model.
1290    pub r#id: String,
1291}
1292
1293/// The contents of the assistant message.
1294#[derive(Clone, Debug)]
1295#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1296pub enum ChatCompletionRequestAssistantMessage_Content {
1297    /// The contents of the assistant message.
1298    String(String),
1299
1300    /// An array of content parts with a defined type.
1301    Array(Vec<ChatCompletionRequestAssistantMessageContentPart>),
1302}
1303
1304/// Deprecated and replaced by `tool_calls`.
1305#[derive(Clone, Debug, Default)]
1306#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1307pub struct ChatCompletionRequestAssistantMessage_FunctionCall {
1308    /// The arguments to call the function with, as generated by the model in
1309    /// JSON format.
1310    pub r#arguments: String,
1311
1312    /// The name of the function to call.
1313    pub r#name: String,
1314}
1315
1316/// Developer-provided instructions that the model should follow, regardless of
1317/// messages sent by the user.
1318#[derive(Clone, Debug)]
1319#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1320pub struct ChatCompletionRequestDeveloperMessage {
1321    pub r#content: ChatCompletionRequestDeveloperMessage_Content,
1322
1323    /// The role of the messages author, in this case `developer`.
1324    pub r#role: String,
1325
1326    /// An optional name for the participant.
1327    pub r#name: String,
1328}
1329
1330/// The contents of the developer message.
1331#[derive(Clone, Debug)]
1332#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1333pub enum ChatCompletionRequestDeveloperMessage_Content {
1334    /// The contents of the developer message.
1335    String(String),
1336
1337    /// An array of content parts with a defined type.
1338    Array(Vec<ChatCompletionRequestMessageContentPartText>),
1339}
1340
1341#[derive(Clone, Debug, Default)]
1342#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1343pub struct ChatCompletionRequestFunctionMessage {
1344    /// The role of the messages author, in this case `function`.
1345    pub r#role: String,
1346
1347    /// The contents of the function message.
1348    pub r#content: Option<String>,
1349
1350    /// The name of the function to call.
1351    pub r#name: String,
1352}
1353
1354#[derive(Clone, Debug)]
1355#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1356pub enum ChatCompletionRequestMessage {
1357    ChatCompletionRequestDeveloperMessage(ChatCompletionRequestDeveloperMessage),
1358
1359    ChatCompletionRequestSystemMessage(ChatCompletionRequestSystemMessage),
1360
1361    ChatCompletionRequestUserMessage(ChatCompletionRequestUserMessage),
1362
1363    ChatCompletionRequestAssistantMessage(ChatCompletionRequestAssistantMessage),
1364
1365    ChatCompletionRequestToolMessage(ChatCompletionRequestToolMessage),
1366
1367    ChatCompletionRequestFunctionMessage(ChatCompletionRequestFunctionMessage),
1368}
1369
1370/// Learn about [audio inputs](/docs/guides/audio).
1371#[derive(Clone, Debug)]
1372#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1373pub struct ChatCompletionRequestMessageContentPartAudio {
1374    /// The type of the content part.
1375    pub r#type: String,
1376
1377    pub r#input_audio: ChatCompletionRequestMessageContentPartAudio_InputAudio,
1378}
1379
1380#[derive(Clone, Debug, Default)]
1381#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1382pub struct ChatCompletionRequestMessageContentPartAudio_InputAudio {
1383    /// Base64 encoded audio data.
1384    pub r#data: String,
1385
1386    /// The format of the encoded audio data.
1387    pub r#format: String,
1388}
1389
1390/// Learn about [file inputs](/docs/guides/text) for text generation.
1391#[derive(Clone, Debug)]
1392#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1393pub struct ChatCompletionRequestMessageContentPartFile {
1394    /// The type of the content part.
1395    pub r#type: String,
1396
1397    pub r#file: ChatCompletionRequestMessageContentPartFile_File,
1398}
1399
1400#[derive(Clone, Debug, Default)]
1401#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1402pub struct ChatCompletionRequestMessageContentPartFile_File {
1403    /// The name of the file, used when passing the file to the model as a
1404    /// string.
1405    pub r#filename: String,
1406
1407    /// The base64 encoded file data, used when passing the file to the model as
1408    /// a string.
1409    pub r#file_data: String,
1410
1411    /// The ID of an uploaded file to use as input.
1412    pub r#file_id: String,
1413}
1414
1415/// Learn about [image inputs](/docs/guides/vision).
1416#[derive(Clone, Debug)]
1417#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1418pub struct ChatCompletionRequestMessageContentPartImage {
1419    /// The type of the content part.
1420    pub r#type: String,
1421
1422    pub r#image_url: ChatCompletionRequestMessageContentPartImage_ImageUrl,
1423}
1424
1425#[derive(Clone, Debug, Default)]
1426#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1427pub struct ChatCompletionRequestMessageContentPartImage_ImageUrl {
1428    /// Either a URL of the image or the base64 encoded image data.
1429    pub r#url: String,
1430
1431    /// Specifies the detail level of the image.
1432    pub r#detail: String,
1433}
1434
1435#[derive(Clone, Debug, Default)]
1436#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1437pub struct ChatCompletionRequestMessageContentPartRefusal {
1438    /// The type of the content part.
1439    pub r#type: String,
1440
1441    /// The refusal message generated by the model.
1442    pub r#refusal: String,
1443}
1444
1445/// Learn about [text inputs](/docs/guides/text-generation).
1446#[derive(Clone, Debug, Default)]
1447#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1448pub struct ChatCompletionRequestMessageContentPartText {
1449    /// The type of the content part.
1450    pub r#type: String,
1451
1452    /// The text content.
1453    pub r#text: String,
1454}
1455
1456/// Developer-provided instructions that the model should follow, regardless of
1457/// messages sent by the user.
1458#[derive(Clone, Debug)]
1459#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1460pub struct ChatCompletionRequestSystemMessage {
1461    pub r#content: ChatCompletionRequestSystemMessage_Content,
1462
1463    /// The role of the messages author, in this case `system`.
1464    pub r#role: String,
1465
1466    /// An optional name for the participant.
1467    pub r#name: String,
1468}
1469
1470#[derive(Clone, Debug)]
1471#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1472pub struct ChatCompletionRequestSystemMessageContentPart(pub ChatCompletionRequestMessageContentPartText);
1473
1474/// The contents of the system message.
1475#[derive(Clone, Debug)]
1476#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1477pub enum ChatCompletionRequestSystemMessage_Content {
1478    /// The contents of the system message.
1479    String(String),
1480
1481    /// An array of content parts with a defined type.
1482    Array(Vec<ChatCompletionRequestSystemMessageContentPart>),
1483}
1484
1485#[derive(Clone, Debug)]
1486#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1487pub struct ChatCompletionRequestToolMessage {
1488    /// The role of the messages author, in this case `tool`.
1489    pub r#role: String,
1490
1491    pub r#content: ChatCompletionRequestToolMessage_Content,
1492
1493    /// Tool call that this message is responding to.
1494    pub r#tool_call_id: String,
1495}
1496
1497#[derive(Clone, Debug)]
1498#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1499pub struct ChatCompletionRequestToolMessageContentPart(pub ChatCompletionRequestMessageContentPartText);
1500
1501/// The contents of the tool message.
1502#[derive(Clone, Debug)]
1503#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1504pub enum ChatCompletionRequestToolMessage_Content {
1505    /// The contents of the tool message.
1506    String(String),
1507
1508    /// An array of content parts with a defined type.
1509    Array(Vec<ChatCompletionRequestToolMessageContentPart>),
1510}
1511
1512/// Messages sent by an end user, containing prompts or additional context
1513/// information.
1514#[derive(Clone, Debug)]
1515#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1516pub struct ChatCompletionRequestUserMessage {
1517    pub r#content: ChatCompletionRequestUserMessage_Content,
1518
1519    /// The role of the messages author, in this case `user`.
1520    pub r#role: String,
1521
1522    /// An optional name for the participant.
1523    pub r#name: String,
1524}
1525
1526#[derive(Clone, Debug)]
1527#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1528pub enum ChatCompletionRequestUserMessageContentPart {
1529    ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
1530
1531    ChatCompletionRequestMessageContentPartImage(ChatCompletionRequestMessageContentPartImage),
1532
1533    ChatCompletionRequestMessageContentPartAudio(ChatCompletionRequestMessageContentPartAudio),
1534
1535    ChatCompletionRequestMessageContentPartFile(ChatCompletionRequestMessageContentPartFile),
1536}
1537
1538/// The contents of the user message.
1539#[derive(Clone, Debug)]
1540#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1541pub enum ChatCompletionRequestUserMessage_Content {
1542    /// The text contents of the message.
1543    String(String),
1544
1545    /// An array of content parts with a defined type.
1546    Array(Vec<ChatCompletionRequestUserMessageContentPart>),
1547}
1548
1549/// A chat completion message generated by the model.
1550#[derive(Clone, Debug)]
1551#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1552pub struct ChatCompletionResponseMessage {
1553    /// The contents of the message.
1554    pub r#content: Option<String>,
1555
1556    /// The refusal message generated by the model.
1557    pub r#refusal: Option<String>,
1558
1559    pub r#tool_calls: ChatCompletionMessageToolCalls,
1560
1561    /// Annotations for the message, when applicable, as when using the [web
1562    /// search tool](/docs/guides/tools-web-search?api-mode=chat).
1563    pub r#annotations: Vec<ChatCompletionResponseMessage_Annotations>,
1564
1565    /// The role of the author of this message.
1566    pub r#role: String,
1567
1568    pub r#function_call: ChatCompletionResponseMessage_FunctionCall,
1569
1570    pub r#audio: Option<ChatCompletionResponseMessage_Audio>,
1571}
1572
1573/// A URL citation when using web search.
1574#[derive(Clone, Debug)]
1575#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1576pub struct ChatCompletionResponseMessage_Annotations {
1577    /// The type of the URL citation.
1578    pub r#type: String,
1579
1580    pub r#url_citation: ChatCompletionResponseMessage_Annotations_UrlCitation,
1581}
1582
1583/// A URL citation when using web search.
1584#[derive(Clone, Debug, Default)]
1585#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1586pub struct ChatCompletionResponseMessage_Annotations_UrlCitation {
1587    /// The index of the last character of the URL citation in the message.
1588    pub r#end_index: i64,
1589
1590    /// The index of the first character of the URL citation in the message.
1591    pub r#start_index: i64,
1592
1593    /// The URL of the web resource.
1594    pub r#url: String,
1595
1596    /// The title of the web resource.
1597    pub r#title: String,
1598}
1599
1600/// If the audio output modality is requested, this object contains data about
1601/// the audio response from the model.
1602#[derive(Clone, Debug, Default)]
1603#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1604pub struct ChatCompletionResponseMessage_Audio {
1605    /// Unique identifier for this audio response.
1606    pub r#id: String,
1607
1608    /// The Unix timestamp (in seconds) for when this audio response will no
1609    /// longer be accessible on the server for use in multi-turn conversations.
1610    pub r#expires_at: i64,
1611
1612    /// Base64 encoded audio bytes generated by the model, in the format
1613    /// specified in the request.
1614    pub r#data: String,
1615
1616    /// Transcript of the audio generated by the model.
1617    pub r#transcript: String,
1618}
1619
1620/// Deprecated and replaced by `tool_calls`.
1621#[derive(Clone, Debug, Default)]
1622#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1623pub struct ChatCompletionResponseMessage_FunctionCall {
1624    /// The arguments to call the function with, as generated by the model in
1625    /// JSON format.
1626    pub r#arguments: String,
1627
1628    /// The name of the function to call.
1629    pub r#name: String,
1630}
1631
1632/// The role of the author of a message
1633#[derive(Clone, Debug)]
1634#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1635pub struct ChatCompletionRole(pub String);
1636
1637/// Options for streaming response.
1638#[derive(Clone, Debug, Default)]
1639#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1640pub struct ChatCompletionStreamOptions {
1641    /// If set, an additional chunk will be streamed before the `data: [DONE]`
1642    /// message.
1643    pub r#include_usage: bool,
1644}
1645
1646/// A chat completion delta generated by streamed model responses.
1647#[derive(Clone, Debug)]
1648#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1649pub struct ChatCompletionStreamResponseDelta {
1650    /// The contents of the chunk message.
1651    pub r#content: Option<String>,
1652
1653    pub r#function_call: ChatCompletionStreamResponseDelta_FunctionCall,
1654
1655    pub r#tool_calls: Vec<ChatCompletionMessageToolCallChunk>,
1656
1657    /// The role of the author of this message.
1658    pub r#role: String,
1659
1660    /// The refusal message generated by the model.
1661    pub r#refusal: Option<String>,
1662}
1663
1664/// Deprecated and replaced by `tool_calls`.
1665#[derive(Clone, Debug, Default)]
1666#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1667pub struct ChatCompletionStreamResponseDelta_FunctionCall {
1668    /// The arguments to call the function with, as generated by the model in
1669    /// JSON format.
1670    pub r#arguments: String,
1671
1672    /// The name of the function to call.
1673    pub r#name: String,
1674}
1675
1676#[derive(Clone, Debug)]
1677#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1678pub struct ChatCompletionTokenLogprob {
1679    /// The token.
1680    pub r#token: String,
1681
1682    /// The log probability of this token, if it is within the top 20 most
1683    /// likely tokens.
1684    pub r#logprob: f64,
1685
1686    /// A list of integers representing the UTF-8 bytes representation of the
1687    /// token.
1688    pub r#bytes: Option<Vec<i64>>,
1689
1690    /// List of the most likely tokens and their log probability, at this token
1691    /// position.
1692    pub r#top_logprobs: Vec<ChatCompletionTokenLogprob_TopLogprobs>,
1693}
1694
1695#[derive(Clone, Debug)]
1696#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1697pub struct ChatCompletionTokenLogprob_TopLogprobs {
1698    /// The token.
1699    pub r#token: String,
1700
1701    /// The log probability of this token, if it is within the top 20 most
1702    /// likely tokens.
1703    pub r#logprob: f64,
1704
1705    /// A list of integers representing the UTF-8 bytes representation of the
1706    /// token.
1707    pub r#bytes: Option<Vec<i64>>,
1708}
1709
1710#[derive(Clone, Debug)]
1711#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1712pub struct ChatCompletionTool {
1713    /// The type of the tool.
1714    pub r#type: String,
1715
1716    pub r#function: FunctionObject,
1717}
1718
1719/// Controls which (if any) tool is called by the model.
1720#[derive(Clone, Debug)]
1721#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1722pub enum ChatCompletionToolChoiceOption {
1723    /// `none` means the model will not call any tool and instead generates a
1724    /// message.
1725    String(String),
1726
1727    ChatCompletionNamedToolChoice(ChatCompletionNamedToolChoice),
1728}
1729
1730/// The chunking strategy used to chunk the file(s).
1731#[derive(Clone, Debug, Default)]
1732#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1733pub struct ChunkingStrategyRequestParam;
1734
1735/// A click action.
1736#[derive(Clone, Debug, Default)]
1737#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1738pub struct Click {
1739    /// Specifies the event type.
1740    pub r#type: String,
1741
1742    /// Indicates which mouse button was pressed during the click.
1743    pub r#button: String,
1744
1745    /// The x-coordinate where the click occurred.
1746    pub r#x: i64,
1747
1748    /// The y-coordinate where the click occurred.
1749    pub r#y: i64,
1750}
1751
1752/// The output of a code interpreter tool call that is a file.
1753#[derive(Clone, Debug)]
1754#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1755pub struct CodeInterpreterFileOutput {
1756    /// The type of the code interpreter file output.
1757    pub r#type: String,
1758
1759    pub r#files: Vec<CodeInterpreterFileOutput_Files>,
1760}
1761
1762#[derive(Clone, Debug, Default)]
1763#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1764pub struct CodeInterpreterFileOutput_Files {
1765    /// The MIME type of the file.
1766    pub r#mime_type: String,
1767
1768    /// The ID of the file.
1769    pub r#file_id: String,
1770}
1771
1772/// The output of a code interpreter tool call that is text.
1773#[derive(Clone, Debug, Default)]
1774#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1775pub struct CodeInterpreterTextOutput {
1776    /// The type of the code interpreter text output.
1777    pub r#type: String,
1778
1779    /// The logs of the code interpreter tool call.
1780    pub r#logs: String,
1781}
1782
1783/// A tool call to run code.
1784#[derive(Clone, Debug)]
1785#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1786pub struct CodeInterpreterToolCall {
1787    /// The unique ID of the code interpreter tool call.
1788    pub r#id: String,
1789
1790    /// The type of the code interpreter tool call.
1791    pub r#type: String,
1792
1793    /// The code to run.
1794    pub r#code: String,
1795
1796    /// The status of the code interpreter tool call.
1797    pub r#status: String,
1798
1799    /// The results of the code interpreter tool call.
1800    pub r#results: Vec<CodeInterpreterToolOutput>,
1801}
1802
1803#[derive(Clone, Debug)]
1804#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1805pub enum CodeInterpreterToolOutput {
1806    CodeInterpreterTextOutput(CodeInterpreterTextOutput),
1807
1808    CodeInterpreterFileOutput(CodeInterpreterFileOutput),
1809}
1810
1811/// A filter used to compare a specified attribute key to a given value using a
1812/// defined comparison operation.
1813#[derive(Clone, Debug)]
1814#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1815pub struct ComparisonFilter {
1816    /// Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`.
1817    pub r#type: String,
1818
1819    /// The key to compare against the value.
1820    pub r#key: String,
1821
1822    pub r#value: ComparisonFilter_Value,
1823}
1824
1825/// The value to compare against the attribute key; supports string, number, or
1826/// boolean types.
1827#[derive(Clone, Debug)]
1828#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1829pub enum ComparisonFilter_Value {
1830    String(String),
1831
1832    Number(f64),
1833
1834    Boolean(bool),
1835}
1836
1837#[derive(Clone, Debug)]
1838#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1839pub struct CompleteUploadRequest {
1840    /// The ordered list of Part IDs.
1841    pub r#part_ids: Vec<String>,
1842
1843    /// The optional md5 checksum for the file contents to verify if the bytes
1844    /// uploaded matches what you expect.
1845    pub r#md5: String,
1846}
1847
1848/// Usage statistics for the completion request.
1849#[derive(Clone, Debug)]
1850#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1851pub struct CompletionUsage {
1852    /// Number of tokens in the generated completion.
1853    pub r#completion_tokens: i64,
1854
1855    /// Number of tokens in the prompt.
1856    pub r#prompt_tokens: i64,
1857
1858    /// Total number of tokens used in the request (prompt + completion).
1859    pub r#total_tokens: i64,
1860
1861    pub r#completion_tokens_details: CompletionUsage_CompletionTokensDetails,
1862
1863    pub r#prompt_tokens_details: CompletionUsage_PromptTokensDetails,
1864}
1865
1866/// Breakdown of tokens used in a completion.
1867#[derive(Clone, Debug, Default)]
1868#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1869pub struct CompletionUsage_CompletionTokensDetails {
1870    /// When using Predicted Outputs, the number of tokens in the prediction
1871    /// that appeared in the completion.
1872    pub r#accepted_prediction_tokens: i64,
1873
1874    /// Audio input tokens generated by the model.
1875    pub r#audio_tokens: i64,
1876
1877    /// Tokens generated by the model for reasoning.
1878    pub r#reasoning_tokens: i64,
1879
1880    /// When using Predicted Outputs, the number of tokens in the prediction
1881    /// that did not appear in the completion.
1882    pub r#rejected_prediction_tokens: i64,
1883}
1884
1885/// Breakdown of tokens used in the prompt.
1886#[derive(Clone, Debug, Default)]
1887#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1888pub struct CompletionUsage_PromptTokensDetails {
1889    /// Audio input tokens present in the prompt.
1890    pub r#audio_tokens: i64,
1891
1892    /// Cached tokens present in the prompt.
1893    pub r#cached_tokens: i64,
1894}
1895
1896/// Combine multiple filters using `and` or `or`.
1897#[derive(Clone, Debug)]
1898#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1899pub struct CompoundFilter {
1900    /// Type of operation: `and` or `or`.
1901    pub r#type: String,
1902
1903    /// Array of filters to combine.
1904    pub r#filters: Vec<CompoundFilter_Filters>,
1905}
1906
1907#[derive(Clone, Debug)]
1908#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1909pub enum CompoundFilter_Filters {
1910    ComparisonFilter(ComparisonFilter),
1911}
1912
1913#[derive(Clone, Debug)]
1914#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1915pub enum ComputerAction {
1916    Click(Click),
1917
1918    DoubleClick(DoubleClick),
1919
1920    Drag(Drag),
1921
1922    KeyPress(KeyPress),
1923
1924    Move(Move),
1925
1926    Screenshot(Screenshot),
1927
1928    Scroll(Scroll),
1929
1930    Type(Type),
1931
1932    Wait(Wait),
1933}
1934
1935/// The output of a computer tool call.
1936#[derive(Clone, Debug)]
1937#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1938pub struct ComputerCallOutputItemParam {
1939    pub r#id: ComputerCallOutputItemParam_Id,
1940
1941    /// The ID of the computer tool call that produced the output.
1942    pub r#call_id: String,
1943
1944    /// The type of the computer tool call output.
1945    pub r#type: String,
1946
1947    pub r#output: ComputerScreenshotImage,
1948
1949    pub r#acknowledged_safety_checks: ComputerCallOutputItemParam_AcknowledgedSafetyChecks,
1950
1951    pub r#status: ComputerCallOutputItemParam_Status,
1952}
1953
1954#[derive(Clone, Debug)]
1955#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1956pub enum ComputerCallOutputItemParam_AcknowledgedSafetyChecks {
1957    /// The safety checks reported by the API that have been acknowledged by the
1958    /// developer.
1959    Array(Vec<ComputerCallSafetyCheckParam>),
1960
1961    Null(()),
1962}
1963
1964pub type ComputerCallOutputItemParam_Id = Option<String>;
1965
1966pub type ComputerCallOutputItemParam_Status = Option<String>;
1967
1968/// A pending safety check for the computer call.
1969#[derive(Clone, Debug)]
1970#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1971pub struct ComputerCallSafetyCheckParam {
1972    /// The ID of the pending safety check.
1973    pub r#id: String,
1974
1975    pub r#code: ComputerCallSafetyCheckParam_Code,
1976
1977    pub r#message: ComputerCallSafetyCheckParam_Message,
1978}
1979
1980pub type ComputerCallSafetyCheckParam_Code = Option<String>;
1981
1982pub type ComputerCallSafetyCheckParam_Message = Option<String>;
1983
1984/// A computer screenshot image used with the computer use tool.
1985#[derive(Clone, Debug, Default)]
1986#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1987pub struct ComputerScreenshotImage {
1988    /// Specifies the event type.
1989    pub r#type: String,
1990
1991    /// The URL of the screenshot image.
1992    pub r#image_url: String,
1993
1994    /// The identifier of an uploaded file that contains the screenshot.
1995    pub r#file_id: String,
1996}
1997
1998/// A tool call to a computer use tool.
1999#[derive(Clone, Debug)]
2000#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2001pub struct ComputerToolCall {
2002    /// The type of the computer call.
2003    pub r#type: String,
2004
2005    /// The unique ID of the computer call.
2006    pub r#id: String,
2007
2008    /// An identifier used when responding to the tool call with output.
2009    pub r#call_id: String,
2010
2011    pub r#action: ComputerAction,
2012
2013    /// The pending safety checks for the computer call.
2014    pub r#pending_safety_checks: Vec<ComputerToolCallSafetyCheck>,
2015
2016    /// The status of the item.
2017    pub r#status: String,
2018}
2019
2020/// The output of a computer tool call.
2021#[derive(Clone, Debug)]
2022#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2023pub struct ComputerToolCallOutput {
2024    /// The type of the computer tool call output.
2025    pub r#type: String,
2026
2027    /// The ID of the computer tool call output.
2028    pub r#id: String,
2029
2030    /// The ID of the computer tool call that produced the output.
2031    pub r#call_id: String,
2032
2033    /// The safety checks reported by the API that have been acknowledged by the
2034    /// developer.
2035    pub r#acknowledged_safety_checks: Vec<ComputerToolCallSafetyCheck>,
2036
2037    pub r#output: ComputerScreenshotImage,
2038
2039    /// The status of the message input.
2040    pub r#status: String,
2041}
2042
2043#[derive(Clone, Debug, Default)]
2044#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2045pub struct ComputerToolCallOutputResource(pub (/*AllOf*/));
2046
2047#[derive(Clone, Debug, Default)]
2048#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2049pub struct ComputerToolCallOutputResource_Variant2 {
2050    /// The unique ID of the computer call tool output.
2051    pub r#id: String,
2052}
2053
2054/// A pending safety check for the computer call.
2055#[derive(Clone, Debug, Default)]
2056#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2057pub struct ComputerToolCallSafetyCheck {
2058    /// The ID of the pending safety check.
2059    pub r#id: String,
2060
2061    /// The type of the pending safety check.
2062    pub r#code: String,
2063
2064    /// Details about the pending safety check.
2065    pub r#message: String,
2066}
2067
2068/// A tool that controls a virtual computer.
2069#[derive(Clone, Debug, Default)]
2070#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2071pub struct ComputerUsePreviewTool {
2072    /// The type of the computer use tool.
2073    pub r#type: String,
2074
2075    /// The type of computer environment to control.
2076    pub r#environment: String,
2077
2078    /// The width of the computer display.
2079    pub r#display_width: i64,
2080
2081    /// The height of the computer display.
2082    pub r#display_height: i64,
2083}
2084
2085/// Multi-modal input and output contents.
2086#[derive(Clone, Debug)]
2087#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2088pub enum Content {
2089    InputContent(InputContent),
2090
2091    OutputContent(OutputContent),
2092}
2093
2094/// An x/y coordinate pair, e.g.
2095#[derive(Clone, Debug, Default)]
2096#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2097pub struct Coordinate {
2098    /// The x-coordinate.
2099    pub r#x: i64,
2100
2101    /// The y-coordinate.
2102    pub r#y: i64,
2103}
2104
2105/// The aggregated costs details of the specific time bucket.
2106#[derive(Clone, Debug)]
2107#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2108pub struct CostsResult {
2109    pub r#object: String,
2110
2111    pub r#amount: CostsResult_Amount,
2112
2113    /// When `group_by=line_item`, this field provides the line item of the
2114    /// grouped costs result.
2115    pub r#line_item: Option<String>,
2116
2117    /// When `group_by=project_id`, this field provides the project ID of the
2118    /// grouped costs result.
2119    pub r#project_id: Option<String>,
2120}
2121
2122/// The monetary value in its associated currency.
2123#[derive(Clone, Debug, Default)]
2124#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2125pub struct CostsResult_Amount {
2126    /// The numeric value of the cost.
2127    pub r#value: f64,
2128
2129    /// Lowercase ISO-4217 currency e.g.
2130    pub r#currency: String,
2131}
2132
2133#[derive(Clone, Debug)]
2134#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2135pub struct CreateAssistantRequest {
2136    pub r#model: CreateAssistantRequest_Model,
2137
2138    /// The name of the assistant.
2139    pub r#name: Option<String>,
2140
2141    /// The description of the assistant.
2142    pub r#description: Option<String>,
2143
2144    /// The system instructions that the assistant uses.
2145    pub r#instructions: Option<String>,
2146
2147    pub r#reasoning_effort: Option<ReasoningEffort>,
2148
2149    /// A list of tool enabled on the assistant.
2150    pub r#tools: Vec<CreateAssistantRequest_Tools>,
2151
2152    pub r#tool_resources: Option<CreateAssistantRequest_ToolResources>,
2153
2154    pub r#metadata: Option<Metadata>,
2155
2156    /// What sampling temperature to use, between 0 and 2.
2157    pub r#temperature: Option<f64>,
2158
2159    /// An alternative to sampling with temperature, called nucleus sampling,
2160    /// where the model considers the results of the tokens with top_p
2161    /// probability mass.
2162    pub r#top_p: Option<f64>,
2163
2164    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
2165}
2166
2167/// ID of the model to use.
2168#[derive(Clone, Debug)]
2169#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2170pub enum CreateAssistantRequest_Model {
2171    String(String),
2172
2173    AssistantSupportedModels(AssistantSupportedModels),
2174}
2175
2176/// A set of resources that are used by the assistant's tools.
2177#[derive(Clone, Debug)]
2178#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2179pub struct CreateAssistantRequest_ToolResources {
2180    pub r#code_interpreter: CreateAssistantRequest_ToolResources_CodeInterpreter,
2181
2182    pub r#file_search: CreateAssistantRequest_ToolResources_FileSearch,
2183}
2184
2185#[derive(Clone, Debug)]
2186#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2187pub struct CreateAssistantRequest_ToolResources_CodeInterpreter {
2188    /// A list of [file](/docs/api-reference/files) IDs made available to the
2189    /// `code_interpreter` tool.
2190    pub r#file_ids: Vec<String>,
2191}
2192
2193#[derive(Clone, Debug)]
2194#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2195pub struct CreateAssistantRequest_ToolResources_FileSearch {
2196    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
2197    /// this assistant.
2198    pub r#vector_store_ids: Vec<String>,
2199
2200    /// A helper to create a [vector
2201    /// store](/docs/api-reference/vector-stores/object) with file_ids and
2202    /// attach it to this assistant.
2203    pub r#vector_stores: Vec<CreateAssistantRequest_ToolResources_FileSearch_VectorStores_Item>,
2204}
2205
2206#[derive(Clone, Debug)]
2207#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2208pub struct CreateAssistantRequest_ToolResources_FileSearch_VectorStores_Item {
2209    /// A list of [file](/docs/api-reference/files) IDs to add to the vector
2210    /// store.
2211    pub r#file_ids: Vec<String>,
2212
2213    /// The chunking strategy used to chunk the file(s).
2214    pub r#chunking_strategy: CreateAssistantRequest_ToolResources_FileSearch_VectorStores_Item_ChunkingStrategy,
2215
2216    pub r#metadata: Metadata,
2217}
2218
2219/// The chunking strategy used to chunk the file(s).
2220#[derive(Clone, Debug, Default)]
2221#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2222pub struct CreateAssistantRequest_ToolResources_FileSearch_VectorStores_Item_ChunkingStrategy;
2223
2224#[derive(Clone, Debug)]
2225#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2226pub enum CreateAssistantRequest_Tools {
2227    AssistantToolsCode(AssistantToolsCode),
2228
2229    AssistantToolsFileSearch(AssistantToolsFileSearch),
2230
2231    AssistantToolsFunction(AssistantToolsFunction),
2232}
2233
2234#[derive(Clone, Debug, Default)]
2235#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2236pub struct CreateChatCompletionRequest(pub (/*AllOf*/));
2237
2238#[derive(Clone, Debug)]
2239#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2240pub struct CreateChatCompletionRequest_Variant2 {
2241    /// A list of messages comprising the conversation so far.
2242    pub r#messages: Vec<ChatCompletionRequestMessage>,
2243
2244    /// Model ID used to generate the response, like `gpt-4o` or `o3`.
2245    pub r#model: ModelIdsShared,
2246
2247    pub r#modalities: Option<ResponseModalities>,
2248
2249    pub r#reasoning_effort: Option<ReasoningEffort>,
2250
2251    /// An upper bound for the number of tokens that can be generated for a
2252    /// completion, including visible output tokens and [reasoning
2253    /// tokens](/docs/guides/reasoning).
2254    pub r#max_completion_tokens: Option<i64>,
2255
2256    /// Number between -2.0 and 2.0.
2257    pub r#frequency_penalty: Option<f64>,
2258
2259    /// Number between -2.0 and 2.0.
2260    pub r#presence_penalty: Option<f64>,
2261
2262    pub r#web_search_options: CreateChatCompletionRequest_Variant2_WebSearchOptions,
2263
2264    /// An integer between 0 and 20 specifying the number of most likely tokens
2265    /// to return at each token position, each with an associated log
2266    /// probability.
2267    pub r#top_logprobs: Option<i64>,
2268
2269    pub r#response_format: CreateChatCompletionRequest_Variant2_ResponseFormat,
2270
2271    pub r#audio: Option<CreateChatCompletionRequest_Variant2_Audio>,
2272
2273    /// Whether or not to store the output of this chat completion request for
2274    /// use in our [model distillation](/docs/guides/distillation) or
2275    /// [evals](/docs/guides/evals) products.
2276    pub r#store: Option<bool>,
2277
2278    /// If set to true, the model response data will be streamed to the client
2279    /// as it is generated using [server-sent
2280    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
2281    pub r#stream: Option<bool>,
2282
2283    pub r#stop: Option<StopConfiguration>,
2284
2285    /// Modify the likelihood of specified tokens appearing in the completion.
2286    pub r#logit_bias: Option<CreateChatCompletionRequest_Variant2_LogitBias>,
2287
2288    /// Whether to return log probabilities of the output tokens or not.
2289    pub r#logprobs: Option<bool>,
2290
2291    /// The maximum number of [tokens](/tokenizer) that can be generated in the
2292    /// chat completion.
2293    pub r#max_tokens: Option<i64>,
2294
2295    /// How many chat completion choices to generate for each input message.
2296    pub r#n: Option<i64>,
2297
2298    pub r#prediction: PredictionContent,
2299
2300    /// This feature is in Beta.
2301    pub r#seed: Option<i64>,
2302
2303    pub r#stream_options: Option<ChatCompletionStreamOptions>,
2304
2305    /// A list of tools the model may call.
2306    pub r#tools: Vec<ChatCompletionTool>,
2307
2308    pub r#tool_choice: ChatCompletionToolChoiceOption,
2309
2310    pub r#parallel_tool_calls: ParallelToolCalls,
2311
2312    pub r#function_call: CreateChatCompletionRequest_Variant2_FunctionCall,
2313
2314    /// Deprecated in favor of `tools`.
2315    pub r#functions: Vec<ChatCompletionFunctions>,
2316}
2317
2318/// Modify the likelihood of specified tokens appearing in the completion.
2319#[derive(Clone, Debug, Default)]
2320#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2321pub struct CreateChatCompletionRequest_Variant2_LogitBias;
2322
2323/// Parameters for audio output.
2324#[derive(Clone, Debug)]
2325#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2326pub struct CreateChatCompletionRequest_Variant2_Audio {
2327    /// The voice the model uses to respond.
2328    pub r#voice: VoiceIdsShared,
2329
2330    /// Specifies the output audio format.
2331    pub r#format: String,
2332}
2333
2334/// Deprecated in favor of `tool_choice`.
2335#[derive(Clone, Debug)]
2336#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2337pub enum CreateChatCompletionRequest_Variant2_FunctionCall {
2338    /// `none` means the model will not call a function and instead generates a
2339    /// message.
2340    String(String),
2341
2342    ChatCompletionFunctionCallOption(ChatCompletionFunctionCallOption),
2343}
2344
2345#[derive(Clone, Debug)]
2346#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2347pub struct CreateChatCompletionRequest_Variant2_Prediction(pub PredictionContent);
2348
2349/// An object specifying the format that the model must output.
2350#[derive(Clone, Debug)]
2351#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2352pub enum CreateChatCompletionRequest_Variant2_ResponseFormat {
2353    ResponseFormatText(ResponseFormatText),
2354
2355    ResponseFormatJsonSchema(ResponseFormatJsonSchema),
2356
2357    ResponseFormatJsonObject(ResponseFormatJsonObject),
2358}
2359
2360/// This tool searches the web for relevant results to use in a response.
2361#[derive(Clone, Debug)]
2362#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2363pub struct CreateChatCompletionRequest_Variant2_WebSearchOptions {
2364    pub r#user_location: Option<CreateChatCompletionRequest_Variant2_WebSearchOptions_UserLocation>,
2365
2366    pub r#search_context_size: WebSearchContextSize,
2367}
2368
2369/// Approximate location parameters for the search.
2370#[derive(Clone, Debug)]
2371#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2372pub struct CreateChatCompletionRequest_Variant2_WebSearchOptions_UserLocation {
2373    /// The type of location approximation.
2374    pub r#type: String,
2375
2376    pub r#approximate: WebSearchLocation,
2377}
2378
2379/// Represents a chat completion response returned by model, based on the
2380/// provided input.
2381#[derive(Clone, Debug)]
2382#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2383pub struct CreateChatCompletionResponse {
2384    /// A unique identifier for the chat completion.
2385    pub r#id: String,
2386
2387    /// A list of chat completion choices.
2388    pub r#choices: Vec<CreateChatCompletionResponse_Choices>,
2389
2390    /// The Unix timestamp (in seconds) of when the chat completion was created.
2391    pub r#created: i64,
2392
2393    /// The model used for the chat completion.
2394    pub r#model: String,
2395
2396    pub r#service_tier: Option<ServiceTier>,
2397
2398    /// This fingerprint represents the backend configuration that the model
2399    /// runs with.
2400    pub r#system_fingerprint: String,
2401
2402    /// The object type, which is always `chat.completion`.
2403    pub r#object: String,
2404
2405    pub r#usage: CompletionUsage,
2406}
2407
2408#[derive(Clone, Debug)]
2409#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2410pub struct CreateChatCompletionResponse_Choices {
2411    /// The reason the model stopped generating tokens.
2412    pub r#finish_reason: String,
2413
2414    /// The index of the choice in the list of choices.
2415    pub r#index: i64,
2416
2417    pub r#message: ChatCompletionResponseMessage,
2418
2419    pub r#logprobs: Option<CreateChatCompletionResponse_Choices_Logprobs>,
2420}
2421
2422/// Log probability information for the choice.
2423#[derive(Clone, Debug)]
2424#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2425pub struct CreateChatCompletionResponse_Choices_Logprobs {
2426    /// A list of message content tokens with log probability information.
2427    pub r#content: Option<Vec<ChatCompletionTokenLogprob>>,
2428
2429    /// A list of message refusal tokens with log probability information.
2430    pub r#refusal: Option<Vec<ChatCompletionTokenLogprob>>,
2431}
2432
2433/// Represents a streamed chunk of a chat completion response returned by the
2434/// model, based on the provided input.
2435#[derive(Clone, Debug)]
2436#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2437pub struct CreateChatCompletionStreamResponse {
2438    /// A unique identifier for the chat completion.
2439    pub r#id: String,
2440
2441    /// A list of chat completion choices.
2442    pub r#choices: Vec<CreateChatCompletionStreamResponse_Choices>,
2443
2444    /// The Unix timestamp (in seconds) of when the chat completion was created.
2445    pub r#created: i64,
2446
2447    /// The model to generate the completion.
2448    pub r#model: String,
2449
2450    pub r#service_tier: Option<ServiceTier>,
2451
2452    /// This fingerprint represents the backend configuration that the model
2453    /// runs with.
2454    pub r#system_fingerprint: String,
2455
2456    /// The object type, which is always `chat.completion.chunk`.
2457    pub r#object: String,
2458
2459    /// An optional field that will only be present when you set
2460    /// `stream_options: {"include_usage": true}` in your request.
2461    pub r#usage: Option<CompletionUsage>,
2462}
2463
2464#[derive(Clone, Debug)]
2465#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2466pub struct CreateChatCompletionStreamResponse_Choices {
2467    pub r#delta: ChatCompletionStreamResponseDelta,
2468
2469    pub r#logprobs: Option<CreateChatCompletionStreamResponse_Choices_Logprobs>,
2470
2471    /// The reason the model stopped generating tokens.
2472    pub r#finish_reason: Option<String>,
2473
2474    /// The index of the choice in the list of choices.
2475    pub r#index: i64,
2476}
2477
2478/// Log probability information for the choice.
2479#[derive(Clone, Debug)]
2480#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2481pub struct CreateChatCompletionStreamResponse_Choices_Logprobs {
2482    /// A list of message content tokens with log probability information.
2483    pub r#content: Option<Vec<ChatCompletionTokenLogprob>>,
2484
2485    /// A list of message refusal tokens with log probability information.
2486    pub r#refusal: Option<Vec<ChatCompletionTokenLogprob>>,
2487}
2488
2489#[derive(Clone, Debug)]
2490#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2491pub struct CreateCompletionRequest {
2492    pub r#model: CreateCompletionRequest_Model,
2493
2494    pub r#prompt: Option<CreateCompletionRequest_Prompt>,
2495
2496    /// Generates `best_of` completions server-side and returns the "best" (the
2497    /// one with the highest log probability per token).
2498    pub r#best_of: Option<i64>,
2499
2500    /// Echo back the prompt in addition to the completion
2501    pub r#echo: Option<bool>,
2502
2503    /// Number between -2.0 and 2.0.
2504    pub r#frequency_penalty: Option<f64>,
2505
2506    /// Modify the likelihood of specified tokens appearing in the completion.
2507    pub r#logit_bias: Option<CreateCompletionRequest_LogitBias>,
2508
2509    /// Include the log probabilities on the `logprobs` most likely output
2510    /// tokens, as well the chosen tokens.
2511    pub r#logprobs: Option<i64>,
2512
2513    /// The maximum number of [tokens](/tokenizer) that can be generated in the
2514    /// completion.
2515    pub r#max_tokens: Option<i64>,
2516
2517    /// How many completions to generate for each prompt.
2518    pub r#n: Option<i64>,
2519
2520    /// Number between -2.0 and 2.0.
2521    pub r#presence_penalty: Option<f64>,
2522
2523    /// If specified, our system will make a best effort to sample
2524    /// deterministically, such that repeated requests with the same `seed` and
2525    /// parameters should return the same result.
2526    pub r#seed: Option<i64>,
2527
2528    pub r#stop: Option<StopConfiguration>,
2529
2530    /// Whether to stream back partial progress.
2531    pub r#stream: Option<bool>,
2532
2533    pub r#stream_options: Option<ChatCompletionStreamOptions>,
2534
2535    /// The suffix that comes after a completion of inserted text.
2536    pub r#suffix: Option<String>,
2537
2538    /// What sampling temperature to use, between 0 and 2.
2539    pub r#temperature: Option<f64>,
2540
2541    /// An alternative to sampling with temperature, called nucleus sampling,
2542    /// where the model considers the results of the tokens with top_p
2543    /// probability mass.
2544    pub r#top_p: Option<f64>,
2545
2546    /// A unique identifier representing your end-user, which can help OpenAI to
2547    /// monitor and detect abuse.
2548    pub r#user: String,
2549}
2550
2551/// Modify the likelihood of specified tokens appearing in the completion.
2552#[derive(Clone, Debug, Default)]
2553#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2554pub struct CreateCompletionRequest_LogitBias;
2555
2556/// ID of the model to use.
2557pub type CreateCompletionRequest_Model = String;
2558
2559/// The prompt(s) to generate completions for, encoded as a string, array of
2560/// strings, array of tokens, or array of token arrays.
2561#[derive(Clone, Debug)]
2562#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2563pub enum CreateCompletionRequest_Prompt {
2564    String(String),
2565
2566    ArrayOfStrings(Vec<String>),
2567
2568    ArrayOfIntegers(Vec<i64>),
2569
2570    Array(Vec<Vec<i64>>),
2571}
2572
2573/// Represents a completion response from the API.
2574#[derive(Clone, Debug)]
2575#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2576pub struct CreateCompletionResponse {
2577    /// A unique identifier for the completion.
2578    pub r#id: String,
2579
2580    /// The list of completion choices the model generated for the input prompt.
2581    pub r#choices: Vec<CreateCompletionResponse_Choices>,
2582
2583    /// The Unix timestamp (in seconds) of when the completion was created.
2584    pub r#created: i64,
2585
2586    /// The model used for completion.
2587    pub r#model: String,
2588
2589    /// This fingerprint represents the backend configuration that the model
2590    /// runs with.
2591    pub r#system_fingerprint: String,
2592
2593    /// The object type, which is always "text_completion"
2594    pub r#object: String,
2595
2596    pub r#usage: CompletionUsage,
2597}
2598
2599#[derive(Clone, Debug)]
2600#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2601pub struct CreateCompletionResponse_Choices {
2602    /// The reason the model stopped generating tokens.
2603    pub r#finish_reason: String,
2604
2605    pub r#index: i64,
2606
2607    pub r#logprobs: Option<CreateCompletionResponse_Choices_Logprobs>,
2608
2609    pub r#text: String,
2610}
2611
2612#[derive(Clone, Debug)]
2613#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2614pub struct CreateCompletionResponse_Choices_Logprobs {
2615    pub r#text_offset: Vec<i64>,
2616
2617    pub r#token_logprobs: Vec<f64>,
2618
2619    pub r#tokens: Vec<String>,
2620
2621    pub r#top_logprobs: Vec<CreateCompletionResponse_Choices_Logprobs_TopLogprobs_Item>,
2622}
2623
2624#[derive(Clone, Debug, Default)]
2625#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2626pub struct CreateCompletionResponse_Choices_Logprobs_TopLogprobs_Item;
2627
2628#[derive(Clone, Debug)]
2629#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2630pub struct CreateEmbeddingRequest {
2631    pub r#input: CreateEmbeddingRequest_Input,
2632
2633    pub r#model: CreateEmbeddingRequest_Model,
2634
2635    /// The format to return the embeddings in.
2636    pub r#encoding_format: String,
2637
2638    /// The number of dimensions the resulting output embeddings should have.
2639    pub r#dimensions: i64,
2640
2641    /// A unique identifier representing your end-user, which can help OpenAI to
2642    /// monitor and detect abuse.
2643    pub r#user: String,
2644}
2645
2646/// Input text to embed, encoded as a string or array of tokens.
2647#[derive(Clone, Debug)]
2648#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2649pub enum CreateEmbeddingRequest_Input {
2650    /// The string that will be turned into an embedding.
2651    String(String),
2652
2653    /// The array of strings that will be turned into an embedding.
2654    ArrayOfStrings(Vec<String>),
2655
2656    /// The array of integers that will be turned into an embedding.
2657    ArrayOfIntegers(Vec<i64>),
2658
2659    /// The array of arrays containing integers that will be turned into an
2660    /// embedding.
2661    Array(Vec<Vec<i64>>),
2662}
2663
2664/// ID of the model to use.
2665pub type CreateEmbeddingRequest_Model = String;
2666
2667#[derive(Clone, Debug)]
2668#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2669pub struct CreateEmbeddingResponse {
2670    /// The list of embeddings generated by the model.
2671    pub r#data: Vec<Embedding>,
2672
2673    /// The name of the model used to generate the embedding.
2674    pub r#model: String,
2675
2676    /// The object type, which is always "list".
2677    pub r#object: String,
2678
2679    pub r#usage: CreateEmbeddingResponse_Usage,
2680}
2681
2682/// The usage information for the request.
2683#[derive(Clone, Debug, Default)]
2684#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2685pub struct CreateEmbeddingResponse_Usage {
2686    /// The number of tokens used by the prompt.
2687    pub r#prompt_tokens: i64,
2688
2689    /// The total number of tokens used by the request.
2690    pub r#total_tokens: i64,
2691}
2692
2693/// A CompletionsRunDataSource object describing a model sampling configuration.
2694#[derive(Clone, Debug)]
2695#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2696pub struct CreateEvalCompletionsRunDataSource {
2697    /// The type of run data source.
2698    pub r#type: String,
2699
2700    pub r#input_messages: CreateEvalCompletionsRunDataSource_InputMessages,
2701
2702    pub r#sampling_params: CreateEvalCompletionsRunDataSource_SamplingParams,
2703
2704    /// The name of the model to use for generating completions (e.g.
2705    pub r#model: String,
2706
2707    pub r#source: CreateEvalCompletionsRunDataSource_Source,
2708}
2709
2710#[derive(Clone, Debug)]
2711#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2712pub enum CreateEvalCompletionsRunDataSource_InputMessages {
2713    CreateEvalCompletionsRunDataSource_InputMessages_Variant1(CreateEvalCompletionsRunDataSource_InputMessages_Variant1),
2714
2715    CreateEvalCompletionsRunDataSource_InputMessages_Variant2(CreateEvalCompletionsRunDataSource_InputMessages_Variant2),
2716}
2717
2718#[derive(Clone, Debug)]
2719#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2720pub struct CreateEvalCompletionsRunDataSource_InputMessages_Variant1 {
2721    /// The type of input messages.
2722    pub r#type: String,
2723
2724    /// A list of chat messages forming the prompt or context.
2725    pub r#template: Vec<CreateEvalCompletionsRunDataSource_InputMessages_Variant1_Template>,
2726}
2727
2728#[derive(Clone, Debug)]
2729#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2730pub enum CreateEvalCompletionsRunDataSource_InputMessages_Variant1_Template {
2731    EasyInputMessage(EasyInputMessage),
2732
2733    EvalItem(EvalItem),
2734}
2735
2736#[derive(Clone, Debug, Default)]
2737#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2738pub struct CreateEvalCompletionsRunDataSource_InputMessages_Variant2 {
2739    /// The type of input messages.
2740    pub r#type: String,
2741
2742    /// A reference to a variable in the "item" namespace.
2743    pub r#item_reference: String,
2744}
2745
2746#[derive(Clone, Debug, Default)]
2747#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2748pub struct CreateEvalCompletionsRunDataSource_SamplingParams {
2749    /// A higher temperature increases randomness in the outputs.
2750    pub r#temperature: f64,
2751
2752    /// The maximum number of tokens in the generated output.
2753    pub r#max_completion_tokens: i64,
2754
2755    /// An alternative to temperature for nucleus sampling; 1.0 includes all
2756    /// tokens.
2757    pub r#top_p: f64,
2758
2759    /// A seed value to initialize the randomness, during sampling.
2760    pub r#seed: i64,
2761}
2762
2763#[derive(Clone, Debug)]
2764#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2765pub enum CreateEvalCompletionsRunDataSource_Source {
2766    EvalJsonlFileContentSource(EvalJsonlFileContentSource),
2767
2768    EvalJsonlFileIdSource(EvalJsonlFileIdSource),
2769
2770    EvalStoredCompletionsSource(EvalStoredCompletionsSource),
2771}
2772
2773/// A CustomDataSourceConfig object that defines the schema for the data source
2774/// used for the evaluation runs.
2775#[derive(Clone, Debug)]
2776#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2777pub struct CreateEvalCustomDataSourceConfig {
2778    /// The type of data source.
2779    pub r#type: String,
2780
2781    /// The json schema for each row in the data source.
2782    pub r#item_schema: CreateEvalCustomDataSourceConfig_ItemSchema,
2783
2784    /// Whether the eval should expect you to populate the sample namespace (ie,
2785    /// by generating responses off of your data source)
2786    pub r#include_sample_schema: bool,
2787}
2788
2789/// The json schema for each row in the data source.
2790#[derive(Clone, Debug, Default)]
2791#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2792pub struct CreateEvalCustomDataSourceConfig_ItemSchema;
2793
2794/// A chat message that makes up the prompt or context.
2795#[derive(Clone, Debug, Default)]
2796#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2797pub struct CreateEvalItem;
2798
2799#[derive(Clone, Debug, Default)]
2800#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2801pub struct CreateEvalItem_Variant1 {
2802    /// The role of the message (e.g.
2803    pub r#role: String,
2804
2805    /// The content of the message.
2806    pub r#content: String,
2807}
2808
2809/// A JsonlRunDataSource object with that specifies a JSONL file that matches
2810/// the eval
2811#[derive(Clone, Debug)]
2812#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2813pub struct CreateEvalJsonlRunDataSource {
2814    /// The type of data source.
2815    pub r#type: String,
2816
2817    pub r#source: CreateEvalJsonlRunDataSource_Source,
2818}
2819
2820#[derive(Clone, Debug)]
2821#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2822pub enum CreateEvalJsonlRunDataSource_Source {
2823    EvalJsonlFileContentSource(EvalJsonlFileContentSource),
2824
2825    EvalJsonlFileIdSource(EvalJsonlFileIdSource),
2826}
2827
2828/// A LabelModelGrader object which uses a model to assign labels to each item
2829/// in the evaluation.
2830#[derive(Clone, Debug)]
2831#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2832pub struct CreateEvalLabelModelGrader {
2833    /// The object type, which is always `label_model`.
2834    pub r#type: String,
2835
2836    /// The name of the grader.
2837    pub r#name: String,
2838
2839    /// The model to use for the evaluation.
2840    pub r#model: String,
2841
2842    /// A list of chat messages forming the prompt or context.
2843    pub r#input: Vec<CreateEvalItem>,
2844
2845    /// The labels to classify to each item in the evaluation.
2846    pub r#labels: Vec<String>,
2847
2848    /// The labels that indicate a passing result.
2849    pub r#passing_labels: Vec<String>,
2850}
2851
2852/// A data source config which specifies the metadata property of your stored
2853/// completions query.
2854#[derive(Clone, Debug)]
2855#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2856pub struct CreateEvalLogsDataSourceConfig {
2857    /// The type of data source.
2858    pub r#type: String,
2859
2860    /// Metadata filters for the logs data source.
2861    pub r#metadata: CreateEvalLogsDataSourceConfig_Metadata,
2862}
2863
2864/// Metadata filters for the logs data source.
2865#[derive(Clone, Debug, Default)]
2866#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2867pub struct CreateEvalLogsDataSourceConfig_Metadata;
2868
2869#[derive(Clone, Debug)]
2870#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2871pub struct CreateEvalRequest {
2872    /// The name of the evaluation.
2873    pub r#name: String,
2874
2875    pub r#metadata: Option<Metadata>,
2876
2877    pub r#data_source_config: CreateEvalRequest_DataSourceConfig,
2878
2879    /// A list of graders for all eval runs in this group.
2880    pub r#testing_criteria: Vec<CreateEvalRequest_TestingCriteria>,
2881}
2882
2883/// The configuration for the data source used for the evaluation runs.
2884#[derive(Clone, Debug, Default)]
2885#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2886pub struct CreateEvalRequest_DataSourceConfig;
2887
2888#[derive(Clone, Debug)]
2889#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2890pub enum CreateEvalRequest_TestingCriteria {
2891    CreateEvalLabelModelGrader(CreateEvalLabelModelGrader),
2892
2893    EvalStringCheckGrader(EvalStringCheckGrader),
2894
2895    EvalTextSimilarityGrader(EvalTextSimilarityGrader),
2896
2897    EvalPythonGrader(EvalPythonGrader),
2898
2899    EvalScoreModelGrader(EvalScoreModelGrader),
2900}
2901
2902/// A ResponsesRunDataSource object describing a model sampling configuration.
2903#[derive(Clone, Debug)]
2904#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2905pub struct CreateEvalResponsesRunDataSource {
2906    /// The type of run data source.
2907    pub r#type: String,
2908
2909    pub r#input_messages: CreateEvalResponsesRunDataSource_InputMessages,
2910
2911    pub r#sampling_params: CreateEvalResponsesRunDataSource_SamplingParams,
2912
2913    /// The name of the model to use for generating completions (e.g.
2914    pub r#model: String,
2915
2916    pub r#source: CreateEvalResponsesRunDataSource_Source,
2917}
2918
2919#[derive(Clone, Debug)]
2920#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2921pub enum CreateEvalResponsesRunDataSource_InputMessages {
2922    CreateEvalResponsesRunDataSource_InputMessages_Variant1(CreateEvalResponsesRunDataSource_InputMessages_Variant1),
2923
2924    CreateEvalResponsesRunDataSource_InputMessages_Variant2(CreateEvalResponsesRunDataSource_InputMessages_Variant2),
2925}
2926
2927#[derive(Clone, Debug)]
2928#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2929pub struct CreateEvalResponsesRunDataSource_InputMessages_Variant1 {
2930    /// The type of input messages.
2931    pub r#type: String,
2932
2933    /// A list of chat messages forming the prompt or context.
2934    pub r#template: Vec<CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template>,
2935}
2936
2937#[derive(Clone, Debug)]
2938#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2939pub enum CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template {
2940    CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template_Variant1(CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template_Variant1),
2941
2942    EvalItem(EvalItem),
2943}
2944
2945#[derive(Clone, Debug, Default)]
2946#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2947pub struct CreateEvalResponsesRunDataSource_InputMessages_Variant1_Template_Variant1 {
2948    /// The role of the message (e.g.
2949    pub r#role: String,
2950
2951    /// The content of the message.
2952    pub r#content: String,
2953}
2954
2955#[derive(Clone, Debug, Default)]
2956#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2957pub struct CreateEvalResponsesRunDataSource_InputMessages_Variant2 {
2958    /// The type of input messages.
2959    pub r#type: String,
2960
2961    /// A reference to a variable in the "item" namespace.
2962    pub r#item_reference: String,
2963}
2964
2965#[derive(Clone, Debug, Default)]
2966#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2967pub struct CreateEvalResponsesRunDataSource_SamplingParams {
2968    /// A higher temperature increases randomness in the outputs.
2969    pub r#temperature: f64,
2970
2971    /// The maximum number of tokens in the generated output.
2972    pub r#max_completion_tokens: i64,
2973
2974    /// An alternative to temperature for nucleus sampling; 1.0 includes all
2975    /// tokens.
2976    pub r#top_p: f64,
2977
2978    /// A seed value to initialize the randomness, during sampling.
2979    pub r#seed: i64,
2980}
2981
2982#[derive(Clone, Debug)]
2983#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2984pub enum CreateEvalResponsesRunDataSource_Source {
2985    EvalJsonlFileContentSource(EvalJsonlFileContentSource),
2986
2987    EvalJsonlFileIdSource(EvalJsonlFileIdSource),
2988
2989    EvalResponsesSource(EvalResponsesSource),
2990}
2991
2992#[derive(Clone, Debug)]
2993#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2994pub struct CreateEvalRunRequest {
2995    /// The name of the run.
2996    pub r#name: String,
2997
2998    pub r#metadata: Option<Metadata>,
2999
3000    pub r#data_source: CreateEvalRunRequest_DataSource,
3001}
3002
3003/// Details about the run's data source.
3004#[derive(Clone, Debug, Default)]
3005#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3006pub struct CreateEvalRunRequest_DataSource;
3007
3008#[derive(Clone, Debug, Default)]
3009#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3010pub struct CreateFileRequest {
3011    /// The File object (not file name) to be uploaded.
3012    pub r#file: String,
3013
3014    /// The intended purpose of the uploaded file.
3015    pub r#purpose: String,
3016}
3017
3018#[derive(Clone, Debug)]
3019#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3020pub struct CreateFineTuningCheckpointPermissionRequest {
3021    /// The project identifiers to grant access to.
3022    pub r#project_ids: Vec<String>,
3023}
3024
3025#[derive(Clone, Debug)]
3026#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3027pub struct CreateFineTuningJobRequest {
3028    pub r#model: CreateFineTuningJobRequest_Model,
3029
3030    /// The ID of an uploaded file that contains training data.
3031    pub r#training_file: String,
3032
3033    pub r#hyperparameters: CreateFineTuningJobRequest_Hyperparameters,
3034
3035    /// A string of up to 64 characters that will be added to your fine-tuned
3036    /// model name.
3037    pub r#suffix: Option<String>,
3038
3039    /// The ID of an uploaded file that contains validation data.
3040    pub r#validation_file: Option<String>,
3041
3042    /// A list of integrations to enable for your fine-tuning job.
3043    pub r#integrations: Option<Vec<CreateFineTuningJobRequest_Integrations>>,
3044
3045    /// The seed controls the reproducibility of the job.
3046    pub r#seed: Option<i64>,
3047
3048    pub r#method: FineTuneMethod,
3049
3050    pub r#metadata: Option<Metadata>,
3051}
3052
3053/// The hyperparameters used for the fine-tuning job.
3054#[derive(Clone, Debug)]
3055#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3056pub struct CreateFineTuningJobRequest_Hyperparameters {
3057    pub r#batch_size: CreateFineTuningJobRequest_Hyperparameters_BatchSize,
3058
3059    pub r#learning_rate_multiplier: CreateFineTuningJobRequest_Hyperparameters_LearningRateMultiplier,
3060
3061    pub r#n_epochs: CreateFineTuningJobRequest_Hyperparameters_NEpochs,
3062}
3063
3064/// Number of examples in each batch.
3065#[derive(Clone, Debug)]
3066#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3067pub enum CreateFineTuningJobRequest_Hyperparameters_BatchSize {
3068    String(String),
3069
3070    Integer(i64),
3071}
3072
3073/// Scaling factor for the learning rate.
3074#[derive(Clone, Debug)]
3075#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3076pub enum CreateFineTuningJobRequest_Hyperparameters_LearningRateMultiplier {
3077    String(String),
3078
3079    Number(f64),
3080}
3081
3082/// The number of epochs to train the model for.
3083#[derive(Clone, Debug)]
3084#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3085pub enum CreateFineTuningJobRequest_Hyperparameters_NEpochs {
3086    String(String),
3087
3088    Integer(i64),
3089}
3090
3091#[derive(Clone, Debug)]
3092#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3093pub struct CreateFineTuningJobRequest_Integrations {
3094    pub r#type: String,
3095
3096    pub r#wandb: CreateFineTuningJobRequest_Integrations_Wandb,
3097}
3098
3099#[derive(Clone, Debug)]
3100#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3101pub struct CreateFineTuningJobRequest_Integrations_Type(pub String);
3102
3103/// The settings for your integration with Weights and Biases.
3104#[derive(Clone, Debug)]
3105#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3106pub struct CreateFineTuningJobRequest_Integrations_Wandb {
3107    /// The name of the project that the new run will be created under.
3108    pub r#project: String,
3109
3110    /// A display name to set for the run.
3111    pub r#name: Option<String>,
3112
3113    /// The entity to use for the run.
3114    pub r#entity: Option<String>,
3115
3116    /// A list of tags to be attached to the newly created run.
3117    pub r#tags: Vec<String>,
3118}
3119
3120/// The name of the model to fine-tune.
3121pub type CreateFineTuningJobRequest_Model = String;
3122
3123#[derive(Clone, Debug)]
3124#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3125pub struct CreateImageEditRequest {
3126    pub r#image: CreateImageEditRequest_Image,
3127
3128    /// A text description of the desired image(s).
3129    pub r#prompt: String,
3130
3131    /// An additional image whose fully transparent areas (e.g.
3132    pub r#mask: String,
3133
3134    pub r#model: Option<CreateImageEditRequest_Model>,
3135
3136    /// The number of images to generate.
3137    pub r#n: Option<i64>,
3138
3139    /// The size of the generated images.
3140    pub r#size: Option<String>,
3141
3142    /// The format in which the generated images are returned.
3143    pub r#response_format: Option<String>,
3144
3145    /// A unique identifier representing your end-user, which can help OpenAI to
3146    /// monitor and detect abuse.
3147    pub r#user: String,
3148
3149    /// The quality of the image that will be generated.
3150    pub r#quality: Option<String>,
3151}
3152
3153/// The image(s) to edit.
3154#[derive(Clone, Debug)]
3155#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3156pub enum CreateImageEditRequest_Image {
3157    String(String),
3158
3159    ArrayOfStrings(Vec<String>),
3160}
3161
3162/// The model to use for image generation.
3163pub type CreateImageEditRequest_Model = String;
3164
3165#[derive(Clone, Debug)]
3166#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3167pub struct CreateImageRequest {
3168    /// A text description of the desired image(s).
3169    pub r#prompt: String,
3170
3171    pub r#model: Option<CreateImageRequest_Model>,
3172
3173    /// The number of images to generate.
3174    pub r#n: Option<i64>,
3175
3176    /// The quality of the image that will be generated.
3177    pub r#quality: Option<String>,
3178
3179    /// The format in which generated images with `dall-e-2` and `dall-e-3` are
3180    /// returned.
3181    pub r#response_format: Option<String>,
3182
3183    /// The format in which the generated images are returned.
3184    pub r#output_format: Option<String>,
3185
3186    /// The compression level (0-100%) for the generated images.
3187    pub r#output_compression: Option<i64>,
3188
3189    /// The size of the generated images.
3190    pub r#size: Option<String>,
3191
3192    /// Control the content-moderation level for images generated by
3193    /// `gpt-image-1`.
3194    pub r#moderation: Option<String>,
3195
3196    /// Allows to set transparency for the background of the generated image(s).
3197    pub r#background: Option<String>,
3198
3199    /// The style of the generated images.
3200    pub r#style: Option<String>,
3201
3202    /// A unique identifier representing your end-user, which can help OpenAI to
3203    /// monitor and detect abuse.
3204    pub r#user: String,
3205}
3206
3207/// The model to use for image generation.
3208pub type CreateImageRequest_Model = String;
3209
3210#[derive(Clone, Debug)]
3211#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3212pub struct CreateImageVariationRequest {
3213    /// The image to use as the basis for the variation(s).
3214    pub r#image: String,
3215
3216    pub r#model: Option<CreateImageVariationRequest_Model>,
3217
3218    /// The number of images to generate.
3219    pub r#n: Option<i64>,
3220
3221    /// The format in which the generated images are returned.
3222    pub r#response_format: Option<String>,
3223
3224    /// The size of the generated images.
3225    pub r#size: Option<String>,
3226
3227    /// A unique identifier representing your end-user, which can help OpenAI to
3228    /// monitor and detect abuse.
3229    pub r#user: String,
3230}
3231
3232/// The model to use for image generation.
3233pub type CreateImageVariationRequest_Model = String;
3234
3235#[derive(Clone, Debug)]
3236#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3237pub struct CreateMessageRequest {
3238    /// The role of the entity that is creating the message.
3239    pub r#role: String,
3240
3241    pub r#content: CreateMessageRequest_Content,
3242
3243    /// A list of files attached to the message, and the tools they should be
3244    /// added to.
3245    pub r#attachments: Option<Vec<CreateMessageRequest_Attachments>>,
3246
3247    pub r#metadata: Option<Metadata>,
3248}
3249
3250#[derive(Clone, Debug)]
3251#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3252pub struct CreateMessageRequest_Attachments {
3253    /// The ID of the file to attach to the message.
3254    pub r#file_id: String,
3255
3256    /// The tools to add this file to.
3257    pub r#tools: Vec<CreateMessageRequest_Attachments_Tools>,
3258}
3259
3260#[derive(Clone, Debug)]
3261#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3262pub enum CreateMessageRequest_Attachments_Tools {
3263    AssistantToolsCode(AssistantToolsCode),
3264
3265    AssistantToolsFileSearchTypeOnly(AssistantToolsFileSearchTypeOnly),
3266}
3267
3268#[derive(Clone, Debug)]
3269#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3270pub enum CreateMessageRequest_Content {
3271    /// The text contents of the message.
3272    String(String),
3273
3274    /// An array of content parts with a defined type, each can be of type
3275    /// `text` or images can be passed with `image_url` or `image_file`.
3276    Array(Vec<CreateMessageRequest_Content_Variant2>),
3277}
3278
3279#[derive(Clone, Debug)]
3280#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3281pub enum CreateMessageRequest_Content_Variant2 {
3282    MessageContentImageFileObject(MessageContentImageFileObject),
3283
3284    MessageContentImageUrlObject(MessageContentImageUrlObject),
3285
3286    MessageRequestContentTextObject(MessageRequestContentTextObject),
3287}
3288
3289#[derive(Clone, Debug)]
3290#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3291pub struct CreateModelResponseProperties(pub ModelResponseProperties);
3292
3293#[derive(Clone, Debug)]
3294#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3295pub struct CreateModerationRequest {
3296    pub r#input: CreateModerationRequest_Input,
3297
3298    pub r#model: CreateModerationRequest_Model,
3299}
3300
3301/// Input (or inputs) to classify.
3302#[derive(Clone, Debug)]
3303#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3304pub enum CreateModerationRequest_Input {
3305    /// A string of text to classify for moderation.
3306    String(String),
3307
3308    /// An array of strings to classify for moderation.
3309    ArrayOfStrings(Vec<String>),
3310
3311    /// An array of multi-modal inputs to the moderation model.
3312    Array(Vec<CreateModerationRequest_Input_Variant3>),
3313}
3314
3315#[derive(Clone, Debug)]
3316#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3317pub enum CreateModerationRequest_Input_Variant3 {
3318    CreateModerationRequest_Input_Variant3_Variant1(CreateModerationRequest_Input_Variant3_Variant1),
3319
3320    CreateModerationRequest_Input_Variant3_Variant2(CreateModerationRequest_Input_Variant3_Variant2),
3321}
3322
3323/// An object describing an image to classify.
3324#[derive(Clone, Debug)]
3325#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3326pub struct CreateModerationRequest_Input_Variant3_Variant1 {
3327    /// Always `image_url`.
3328    pub r#type: String,
3329
3330    pub r#image_url: CreateModerationRequest_Input_Variant3_Variant1_ImageUrl,
3331}
3332
3333/// Contains either an image URL or a data URL for a base64 encoded image.
3334#[derive(Clone, Debug, Default)]
3335#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3336pub struct CreateModerationRequest_Input_Variant3_Variant1_ImageUrl {
3337    /// Either a URL of the image or the base64 encoded image data.
3338    pub r#url: String,
3339}
3340
3341/// An object describing text to classify.
3342#[derive(Clone, Debug, Default)]
3343#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3344pub struct CreateModerationRequest_Input_Variant3_Variant2 {
3345    /// Always `text`.
3346    pub r#type: String,
3347
3348    /// A string of text to classify.
3349    pub r#text: String,
3350}
3351
3352/// The content moderation model you would like to use.
3353pub type CreateModerationRequest_Model = String;
3354
3355/// Represents if a given text input is potentially harmful.
3356#[derive(Clone, Debug)]
3357#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3358pub struct CreateModerationResponse {
3359    /// The unique identifier for the moderation request.
3360    pub r#id: String,
3361
3362    /// The model used to generate the moderation results.
3363    pub r#model: String,
3364
3365    /// A list of moderation objects.
3366    pub r#results: Vec<CreateModerationResponse_Results>,
3367}
3368
3369#[derive(Clone, Debug)]
3370#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3371pub struct CreateModerationResponse_Results {
3372    /// Whether any of the below categories are flagged.
3373    pub r#flagged: bool,
3374
3375    pub r#categories: CreateModerationResponse_Results_Categories,
3376
3377    pub r#category_scores: CreateModerationResponse_Results_CategoryScores,
3378
3379    pub r#category_applied_input_types: CreateModerationResponse_Results_CategoryAppliedInputTypes,
3380}
3381
3382/// A list of the categories, and whether they are flagged or not.
3383#[derive(Clone, Debug, Default)]
3384#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3385pub struct CreateModerationResponse_Results_Categories {
3386    /// Content that expresses, incites, or promotes hate based on race, gender,
3387    /// ethnicity, religion, nationality, sexual orientation, disability status,
3388    /// or caste.
3389    pub r#hate: bool,
3390
3391    /// Hateful content that also includes violence or serious harm towards the
3392    /// targeted group based on race, gender, ethnicity, religion, nationality,
3393    /// sexual orientation, disability status, or caste.
3394    pub r#hate_threatening: bool,
3395
3396    /// Content that expresses, incites, or promotes harassing language towards
3397    /// any target.
3398    pub r#harassment: bool,
3399
3400    /// Harassment content that also includes violence or serious harm towards
3401    /// any target.
3402    pub r#harassment_threatening: bool,
3403
3404    /// Content that includes instructions or advice that facilitate the
3405    /// planning or execution of wrongdoing, or that gives advice or instruction
3406    /// on how to commit illicit acts.
3407    pub r#illicit: Option<bool>,
3408
3409    /// Content that includes instructions or advice that facilitate the
3410    /// planning or execution of wrongdoing that also includes violence, or that
3411    /// gives advice or instruction on the procurement of any weapon.
3412    pub r#illicit_violent: Option<bool>,
3413
3414    /// Content that promotes, encourages, or depicts acts of self-harm, such as
3415    /// suicide, cutting, and eating disorders.
3416    pub r#self_harm: bool,
3417
3418    /// Content where the speaker expresses that they are engaging or intend to
3419    /// engage in acts of self-harm, such as suicide, cutting, and eating
3420    /// disorders.
3421    pub r#self_harm_intent: bool,
3422
3423    /// Content that encourages performing acts of self-harm, such as suicide,
3424    /// cutting, and eating disorders, or that gives instructions or advice on
3425    /// how to commit such acts.
3426    pub r#self_harm_instructions: bool,
3427
3428    /// Content meant to arouse sexual excitement, such as the description of
3429    /// sexual activity, or that promotes sexual services (excluding sex
3430    /// education and wellness).
3431    pub r#sexual: bool,
3432
3433    /// Sexual content that includes an individual who is under 18 years old.
3434    pub r#sexual_minors: bool,
3435
3436    /// Content that depicts death, violence, or physical injury.
3437    pub r#violence: bool,
3438
3439    /// Content that depicts death, violence, or physical injury in graphic
3440    /// detail.
3441    pub r#violence_graphic: bool,
3442}
3443
3444/// A list of the categories along with the input type(s) that the score applies
3445/// to.
3446#[derive(Clone, Debug)]
3447#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3448pub struct CreateModerationResponse_Results_CategoryAppliedInputTypes {
3449    /// The applied input type(s) for the category 'hate'.
3450    pub r#hate: Vec<String>,
3451
3452    /// The applied input type(s) for the category 'hate/threatening'.
3453    pub r#hate_threatening: Vec<String>,
3454
3455    /// The applied input type(s) for the category 'harassment'.
3456    pub r#harassment: Vec<String>,
3457
3458    /// The applied input type(s) for the category 'harassment/threatening'.
3459    pub r#harassment_threatening: Vec<String>,
3460
3461    /// The applied input type(s) for the category 'illicit'.
3462    pub r#illicit: Vec<String>,
3463
3464    /// The applied input type(s) for the category 'illicit/violent'.
3465    pub r#illicit_violent: Vec<String>,
3466
3467    /// The applied input type(s) for the category 'self-harm'.
3468    pub r#self_harm: Vec<String>,
3469
3470    /// The applied input type(s) for the category 'self-harm/intent'.
3471    pub r#self_harm_intent: Vec<String>,
3472
3473    /// The applied input type(s) for the category 'self-harm/instructions'.
3474    pub r#self_harm_instructions: Vec<String>,
3475
3476    /// The applied input type(s) for the category 'sexual'.
3477    pub r#sexual: Vec<String>,
3478
3479    /// The applied input type(s) for the category 'sexual/minors'.
3480    pub r#sexual_minors: Vec<String>,
3481
3482    /// The applied input type(s) for the category 'violence'.
3483    pub r#violence: Vec<String>,
3484
3485    /// The applied input type(s) for the category 'violence/graphic'.
3486    pub r#violence_graphic: Vec<String>,
3487}
3488
3489/// A list of the categories along with their scores as predicted by model.
3490#[derive(Clone, Debug, Default)]
3491#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3492pub struct CreateModerationResponse_Results_CategoryScores {
3493    /// The score for the category 'hate'.
3494    pub r#hate: f64,
3495
3496    /// The score for the category 'hate/threatening'.
3497    pub r#hate_threatening: f64,
3498
3499    /// The score for the category 'harassment'.
3500    pub r#harassment: f64,
3501
3502    /// The score for the category 'harassment/threatening'.
3503    pub r#harassment_threatening: f64,
3504
3505    /// The score for the category 'illicit'.
3506    pub r#illicit: f64,
3507
3508    /// The score for the category 'illicit/violent'.
3509    pub r#illicit_violent: f64,
3510
3511    /// The score for the category 'self-harm'.
3512    pub r#self_harm: f64,
3513
3514    /// The score for the category 'self-harm/intent'.
3515    pub r#self_harm_intent: f64,
3516
3517    /// The score for the category 'self-harm/instructions'.
3518    pub r#self_harm_instructions: f64,
3519
3520    /// The score for the category 'sexual'.
3521    pub r#sexual: f64,
3522
3523    /// The score for the category 'sexual/minors'.
3524    pub r#sexual_minors: f64,
3525
3526    /// The score for the category 'violence'.
3527    pub r#violence: f64,
3528
3529    /// The score for the category 'violence/graphic'.
3530    pub r#violence_graphic: f64,
3531}
3532
3533#[derive(Clone, Debug, Default)]
3534#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3535pub struct CreateResponse(pub (/*AllOf*/));
3536
3537#[derive(Clone, Debug)]
3538#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3539pub struct CreateResponse_Variant3 {
3540    pub r#input: CreateResponse_Variant3_Input,
3541
3542    /// Specify additional output data to include in the model response.
3543    pub r#include: Option<Vec<Includable>>,
3544
3545    /// Whether to allow the model to run tool calls in parallel.
3546    pub r#parallel_tool_calls: Option<bool>,
3547
3548    /// Whether to store the generated model response for later retrieval via
3549    /// API.
3550    pub r#store: Option<bool>,
3551
3552    /// If set to true, the model response data will be streamed to the client
3553    /// as it is generated using [server-sent
3554    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
3555    pub r#stream: Option<bool>,
3556}
3557
3558/// Text, image, or file inputs to the model, used to generate a response.
3559#[derive(Clone, Debug)]
3560#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3561pub enum CreateResponse_Variant3_Input {
3562    /// A text input to the model, equivalent to a text input with the `user`
3563    /// role.
3564    String(String),
3565
3566    /// A list of one or many input items to the model, containing different
3567    /// content types.
3568    Array(Vec<InputItem>),
3569}
3570
3571#[derive(Clone, Debug)]
3572#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3573pub struct CreateRunRequest {
3574    /// The ID of the [assistant](/docs/api-reference/assistants) to use to
3575    /// execute this run.
3576    pub r#assistant_id: String,
3577
3578    pub r#model: Option<CreateRunRequest_Model>,
3579
3580    pub r#reasoning_effort: Option<ReasoningEffort>,
3581
3582    /// Overrides the
3583    /// [instructions](/docs/api-reference/assistants/createAssistant) of the
3584    /// assistant.
3585    pub r#instructions: Option<String>,
3586
3587    /// Appends additional instructions at the end of the instructions for the
3588    /// run.
3589    pub r#additional_instructions: Option<String>,
3590
3591    /// Adds additional messages to the thread before creating the run.
3592    pub r#additional_messages: Option<Vec<CreateMessageRequest>>,
3593
3594    /// Override the tools the assistant can use for this run.
3595    pub r#tools: Option<Vec<CreateRunRequest_Tools>>,
3596
3597    pub r#metadata: Option<Metadata>,
3598
3599    /// What sampling temperature to use, between 0 and 2.
3600    pub r#temperature: Option<f64>,
3601
3602    /// An alternative to sampling with temperature, called nucleus sampling,
3603    /// where the model considers the results of the tokens with top_p
3604    /// probability mass.
3605    pub r#top_p: Option<f64>,
3606
3607    /// If `true`, returns a stream of events that happen during the Run as
3608    /// server-sent events, terminating when the Run enters a terminal state
3609    /// with a `data: [DONE]` message.
3610    pub r#stream: Option<bool>,
3611
3612    /// The maximum number of prompt tokens that may be used over the course of
3613    /// the run.
3614    pub r#max_prompt_tokens: Option<i64>,
3615
3616    /// The maximum number of completion tokens that may be used over the course
3617    /// of the run.
3618    pub r#max_completion_tokens: Option<i64>,
3619
3620    pub r#truncation_strategy: CreateRunRequest_TruncationStrategy,
3621
3622    pub r#tool_choice: CreateRunRequest_ToolChoice,
3623
3624    pub r#parallel_tool_calls: ParallelToolCalls,
3625
3626    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
3627}
3628
3629/// The ID of the [Model](/docs/api-reference/models) to be used to execute this
3630/// run.
3631#[derive(Clone, Debug)]
3632#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3633pub enum CreateRunRequest_Model {
3634    String(String),
3635
3636    AssistantSupportedModels(AssistantSupportedModels),
3637}
3638
3639#[derive(Clone, Debug, Default)]
3640#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3641pub struct CreateRunRequest_ToolChoice(pub (/*AllOf*/));
3642
3643#[derive(Clone, Debug)]
3644#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3645pub enum CreateRunRequest_Tools {
3646    AssistantToolsCode(AssistantToolsCode),
3647
3648    AssistantToolsFileSearch(AssistantToolsFileSearch),
3649
3650    AssistantToolsFunction(AssistantToolsFunction),
3651}
3652
3653#[derive(Clone, Debug, Default)]
3654#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3655pub struct CreateRunRequest_TruncationStrategy(pub (/*AllOf*/));
3656
3657#[derive(Clone, Debug)]
3658#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3659pub struct CreateSpeechRequest {
3660    pub r#model: CreateSpeechRequest_Model,
3661
3662    /// The text to generate audio for.
3663    pub r#input: String,
3664
3665    /// Control the voice of your generated audio with additional instructions.
3666    pub r#instructions: String,
3667
3668    /// The voice to use when generating the audio.
3669    pub r#voice: VoiceIdsShared,
3670
3671    /// The format to audio in.
3672    pub r#response_format: String,
3673
3674    /// The speed of the generated audio.
3675    pub r#speed: f64,
3676}
3677
3678/// One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd` or
3679/// `gpt-4o-mini-tts`.
3680pub type CreateSpeechRequest_Model = String;
3681
3682#[derive(Clone, Debug)]
3683#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3684pub struct CreateThreadAndRunRequest {
3685    /// The ID of the [assistant](/docs/api-reference/assistants) to use to
3686    /// execute this run.
3687    pub r#assistant_id: String,
3688
3689    pub r#thread: CreateThreadRequest,
3690
3691    pub r#model: Option<CreateThreadAndRunRequest_Model>,
3692
3693    /// Override the default system message of the assistant.
3694    pub r#instructions: Option<String>,
3695
3696    /// Override the tools the assistant can use for this run.
3697    pub r#tools: Option<Vec<CreateThreadAndRunRequest_Tools>>,
3698
3699    pub r#tool_resources: Option<CreateThreadAndRunRequest_ToolResources>,
3700
3701    pub r#metadata: Option<Metadata>,
3702
3703    /// What sampling temperature to use, between 0 and 2.
3704    pub r#temperature: Option<f64>,
3705
3706    /// An alternative to sampling with temperature, called nucleus sampling,
3707    /// where the model considers the results of the tokens with top_p
3708    /// probability mass.
3709    pub r#top_p: Option<f64>,
3710
3711    /// If `true`, returns a stream of events that happen during the Run as
3712    /// server-sent events, terminating when the Run enters a terminal state
3713    /// with a `data: [DONE]` message.
3714    pub r#stream: Option<bool>,
3715
3716    /// The maximum number of prompt tokens that may be used over the course of
3717    /// the run.
3718    pub r#max_prompt_tokens: Option<i64>,
3719
3720    /// The maximum number of completion tokens that may be used over the course
3721    /// of the run.
3722    pub r#max_completion_tokens: Option<i64>,
3723
3724    pub r#truncation_strategy: CreateThreadAndRunRequest_TruncationStrategy,
3725
3726    pub r#tool_choice: CreateThreadAndRunRequest_ToolChoice,
3727
3728    pub r#parallel_tool_calls: ParallelToolCalls,
3729
3730    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
3731}
3732
3733/// The ID of the [Model](/docs/api-reference/models) to be used to execute this
3734/// run.
3735pub type CreateThreadAndRunRequest_Model = String;
3736
3737#[derive(Clone, Debug, Default)]
3738#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3739pub struct CreateThreadAndRunRequest_ToolChoice(pub (/*AllOf*/));
3740
3741/// A set of resources that are used by the assistant's tools.
3742#[derive(Clone, Debug)]
3743#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3744pub struct CreateThreadAndRunRequest_ToolResources {
3745    pub r#code_interpreter: CreateThreadAndRunRequest_ToolResources_CodeInterpreter,
3746
3747    pub r#file_search: CreateThreadAndRunRequest_ToolResources_FileSearch,
3748}
3749
3750#[derive(Clone, Debug)]
3751#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3752pub struct CreateThreadAndRunRequest_ToolResources_CodeInterpreter {
3753    /// A list of [file](/docs/api-reference/files) IDs made available to the
3754    /// `code_interpreter` tool.
3755    pub r#file_ids: Vec<String>,
3756}
3757
3758#[derive(Clone, Debug)]
3759#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3760pub struct CreateThreadAndRunRequest_ToolResources_FileSearch {
3761    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
3762    /// attached to this assistant.
3763    pub r#vector_store_ids: Vec<String>,
3764}
3765
3766#[derive(Clone, Debug)]
3767#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3768pub enum CreateThreadAndRunRequest_Tools {
3769    AssistantToolsCode(AssistantToolsCode),
3770
3771    AssistantToolsFileSearch(AssistantToolsFileSearch),
3772
3773    AssistantToolsFunction(AssistantToolsFunction),
3774}
3775
3776#[derive(Clone, Debug, Default)]
3777#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3778pub struct CreateThreadAndRunRequest_TruncationStrategy(pub (/*AllOf*/));
3779
3780/// Options to create a new thread.
3781#[derive(Clone, Debug)]
3782#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3783pub struct CreateThreadRequest {
3784    /// A list of [messages](/docs/api-reference/messages) to start the thread
3785    /// with.
3786    pub r#messages: Vec<CreateMessageRequest>,
3787
3788    pub r#tool_resources: Option<CreateThreadRequest_ToolResources>,
3789
3790    pub r#metadata: Option<Metadata>,
3791}
3792
3793/// A set of resources that are made available to the assistant's tools in this
3794/// thread.
3795#[derive(Clone, Debug)]
3796#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3797pub struct CreateThreadRequest_ToolResources {
3798    pub r#code_interpreter: CreateThreadRequest_ToolResources_CodeInterpreter,
3799
3800    pub r#file_search: CreateThreadRequest_ToolResources_FileSearch,
3801}
3802
3803#[derive(Clone, Debug)]
3804#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3805pub struct CreateThreadRequest_ToolResources_CodeInterpreter {
3806    /// A list of [file](/docs/api-reference/files) IDs made available to the
3807    /// `code_interpreter` tool.
3808    pub r#file_ids: Vec<String>,
3809}
3810
3811#[derive(Clone, Debug)]
3812#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3813pub struct CreateThreadRequest_ToolResources_FileSearch {
3814    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
3815    /// this thread.
3816    pub r#vector_store_ids: Vec<String>,
3817
3818    /// A helper to create a [vector
3819    /// store](/docs/api-reference/vector-stores/object) with file_ids and
3820    /// attach it to this thread.
3821    pub r#vector_stores: Vec<CreateThreadRequest_ToolResources_FileSearch_VectorStores_Item>,
3822}
3823
3824#[derive(Clone, Debug)]
3825#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3826pub struct CreateThreadRequest_ToolResources_FileSearch_VectorStores_Item {
3827    /// A list of [file](/docs/api-reference/files) IDs to add to the vector
3828    /// store.
3829    pub r#file_ids: Vec<String>,
3830
3831    /// The chunking strategy used to chunk the file(s).
3832    pub r#chunking_strategy: CreateThreadRequest_ToolResources_FileSearch_VectorStores_Item_ChunkingStrategy,
3833
3834    pub r#metadata: Metadata,
3835}
3836
3837/// The chunking strategy used to chunk the file(s).
3838#[derive(Clone, Debug, Default)]
3839#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3840pub struct CreateThreadRequest_ToolResources_FileSearch_VectorStores_Item_ChunkingStrategy;
3841
3842#[derive(Clone, Debug)]
3843#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3844pub struct CreateTranscriptionRequest {
3845    /// The audio file object (not file name) to transcribe, in one of these
3846    /// formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
3847    pub r#file: String,
3848
3849    pub r#model: CreateTranscriptionRequest_Model,
3850
3851    /// The language of the input audio.
3852    pub r#language: String,
3853
3854    /// An optional text to guide the model's style or continue a previous audio
3855    /// segment.
3856    pub r#prompt: String,
3857
3858    pub r#response_format: AudioResponseFormat,
3859
3860    /// The sampling temperature, between 0 and 1.
3861    pub r#temperature: f64,
3862
3863    /// Additional information to include in the transcription response.
3864    #[cfg_attr(feature = "serde", serde(rename = "include[]"))]
3865    pub r#include: Vec<TranscriptionInclude>,
3866
3867    /// The timestamp granularities to populate for this transcription.
3868    #[cfg_attr(feature = "serde", serde(rename = "timestamp_granularities[]"))]
3869    pub r#timestamp_granularities: Vec<String>,
3870
3871    /// If set to true, the model response data will be streamed to the client
3872    /// as it is generated using [server-sent
3873    /// events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
3874    pub r#stream: Option<bool>,
3875}
3876
3877/// ID of the model to use.
3878pub type CreateTranscriptionRequest_Model = String;
3879
3880/// Represents a transcription response returned by model, based on the provided
3881/// input.
3882#[derive(Clone, Debug)]
3883#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3884pub struct CreateTranscriptionResponseJson {
3885    /// The transcribed text.
3886    pub r#text: String,
3887
3888    /// The log probabilities of the tokens in the transcription.
3889    pub r#logprobs: Vec<CreateTranscriptionResponseJson_Logprobs>,
3890}
3891
3892#[derive(Clone, Debug)]
3893#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3894pub struct CreateTranscriptionResponseJson_Logprobs {
3895    /// The token in the transcription.
3896    pub r#token: String,
3897
3898    /// The log probability of the token.
3899    pub r#logprob: f64,
3900
3901    /// The bytes of the token.
3902    pub r#bytes: Vec<f64>,
3903}
3904
3905#[derive(Clone, Debug)]
3906#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3907pub enum CreateTranscriptionResponseStreamEvent {
3908    TranscriptTextDeltaEvent(TranscriptTextDeltaEvent),
3909
3910    TranscriptTextDoneEvent(TranscriptTextDoneEvent),
3911}
3912
3913/// Represents a verbose json transcription response returned by model, based on
3914/// the provided input.
3915#[derive(Clone, Debug)]
3916#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3917pub struct CreateTranscriptionResponseVerboseJson {
3918    /// The language of the input audio.
3919    pub r#language: String,
3920
3921    /// The duration of the input audio.
3922    pub r#duration: f64,
3923
3924    /// The transcribed text.
3925    pub r#text: String,
3926
3927    /// Extracted words and their corresponding timestamps.
3928    pub r#words: Vec<TranscriptionWord>,
3929
3930    /// Segments of the transcribed text and their corresponding details.
3931    pub r#segments: Vec<TranscriptionSegment>,
3932}
3933
3934#[derive(Clone, Debug)]
3935#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3936pub struct CreateTranslationRequest {
3937    /// The audio file object (not file name) translate, in one of these
3938    /// formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
3939    pub r#file: String,
3940
3941    pub r#model: CreateTranslationRequest_Model,
3942
3943    /// An optional text to guide the model's style or continue a previous audio
3944    /// segment.
3945    pub r#prompt: String,
3946
3947    /// The format of the output, in one of these options: `json`, `text`,
3948    /// `srt`, `verbose_json`, or `vtt`.
3949    pub r#response_format: String,
3950
3951    /// The sampling temperature, between 0 and 1.
3952    pub r#temperature: f64,
3953}
3954
3955/// ID of the model to use.
3956pub type CreateTranslationRequest_Model = String;
3957
3958#[derive(Clone, Debug, Default)]
3959#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3960pub struct CreateTranslationResponseJson {
3961    pub r#text: String,
3962}
3963
3964#[derive(Clone, Debug)]
3965#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3966pub struct CreateTranslationResponseVerboseJson {
3967    /// The language of the output translation (always `english`).
3968    pub r#language: String,
3969
3970    /// The duration of the input audio.
3971    pub r#duration: f64,
3972
3973    /// The translated text.
3974    pub r#text: String,
3975
3976    /// Segments of the translated text and their corresponding details.
3977    pub r#segments: Vec<TranscriptionSegment>,
3978}
3979
3980#[derive(Clone, Debug, Default)]
3981#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3982pub struct CreateUploadRequest {
3983    /// The name of the file to upload.
3984    pub r#filename: String,
3985
3986    /// The intended purpose of the uploaded file.
3987    pub r#purpose: String,
3988
3989    /// The number of bytes in the file you are uploading.
3990    pub r#bytes: i64,
3991
3992    /// The MIME type of the file.
3993    pub r#mime_type: String,
3994}
3995
3996#[derive(Clone, Debug)]
3997#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3998pub struct CreateVectorStoreFileBatchRequest {
3999    /// A list of [File](/docs/api-reference/files) IDs that the vector store
4000    /// should use.
4001    pub r#file_ids: Vec<String>,
4002
4003    pub r#chunking_strategy: ChunkingStrategyRequestParam,
4004
4005    pub r#attributes: Option<VectorStoreFileAttributes>,
4006}
4007
4008#[derive(Clone, Debug)]
4009#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4010pub struct CreateVectorStoreFileRequest {
4011    /// A [File](/docs/api-reference/files) ID that the vector store should use.
4012    pub r#file_id: String,
4013
4014    pub r#chunking_strategy: ChunkingStrategyRequestParam,
4015
4016    pub r#attributes: Option<VectorStoreFileAttributes>,
4017}
4018
4019#[derive(Clone, Debug)]
4020#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4021pub struct CreateVectorStoreRequest {
4022    /// A list of [File](/docs/api-reference/files) IDs that the vector store
4023    /// should use.
4024    pub r#file_ids: Vec<String>,
4025
4026    /// The name of the vector store.
4027    pub r#name: String,
4028
4029    pub r#expires_after: VectorStoreExpirationAfter,
4030
4031    pub r#chunking_strategy: CreateVectorStoreRequest_ChunkingStrategy,
4032
4033    pub r#metadata: Option<Metadata>,
4034}
4035
4036/// The chunking strategy used to chunk the file(s).
4037#[derive(Clone, Debug, Default)]
4038#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4039pub struct CreateVectorStoreRequest_ChunkingStrategy;
4040
4041#[derive(Clone, Debug, Default)]
4042#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4043pub struct DeleteAssistantResponse {
4044    pub r#id: String,
4045
4046    pub r#deleted: bool,
4047
4048    pub r#object: String,
4049}
4050
4051#[derive(Clone, Debug, Default)]
4052#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4053pub struct DeleteCertificateResponse {
4054    /// The object type, must be `certificate.deleted`.
4055    pub r#object: String,
4056
4057    /// The ID of the certificate that was deleted.
4058    pub r#id: String,
4059}
4060
4061#[derive(Clone, Debug, Default)]
4062#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4063pub struct DeleteFileResponse {
4064    pub r#id: String,
4065
4066    pub r#object: String,
4067
4068    pub r#deleted: bool,
4069}
4070
4071#[derive(Clone, Debug, Default)]
4072#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4073pub struct DeleteFineTuningCheckpointPermissionResponse {
4074    /// The ID of the fine-tuned model checkpoint permission that was deleted.
4075    pub r#id: String,
4076
4077    /// The object type, which is always "checkpoint.permission".
4078    pub r#object: String,
4079
4080    /// Whether the fine-tuned model checkpoint permission was successfully
4081    /// deleted.
4082    pub r#deleted: bool,
4083}
4084
4085#[derive(Clone, Debug, Default)]
4086#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4087pub struct DeleteMessageResponse {
4088    pub r#id: String,
4089
4090    pub r#deleted: bool,
4091
4092    pub r#object: String,
4093}
4094
4095#[derive(Clone, Debug, Default)]
4096#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4097pub struct DeleteModelResponse {
4098    pub r#id: String,
4099
4100    pub r#deleted: bool,
4101
4102    pub r#object: String,
4103}
4104
4105#[derive(Clone, Debug, Default)]
4106#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4107pub struct DeleteThreadResponse {
4108    pub r#id: String,
4109
4110    pub r#deleted: bool,
4111
4112    pub r#object: String,
4113}
4114
4115#[derive(Clone, Debug, Default)]
4116#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4117pub struct DeleteVectorStoreFileResponse {
4118    pub r#id: String,
4119
4120    pub r#deleted: bool,
4121
4122    pub r#object: String,
4123}
4124
4125#[derive(Clone, Debug, Default)]
4126#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4127pub struct DeleteVectorStoreResponse {
4128    pub r#id: String,
4129
4130    pub r#deleted: bool,
4131
4132    pub r#object: String,
4133}
4134
4135/// Occurs when a stream ends.
4136#[derive(Clone, Debug, Default)]
4137#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4138pub struct DoneEvent {
4139    pub r#event: String,
4140
4141    pub r#data: String,
4142}
4143
4144/// A double click action.
4145#[derive(Clone, Debug, Default)]
4146#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4147pub struct DoubleClick {
4148    /// Specifies the event type.
4149    pub r#type: String,
4150
4151    /// The x-coordinate where the double click occurred.
4152    pub r#x: i64,
4153
4154    /// The y-coordinate where the double click occurred.
4155    pub r#y: i64,
4156}
4157
4158/// A drag action.
4159#[derive(Clone, Debug)]
4160#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4161pub struct Drag {
4162    /// Specifies the event type.
4163    pub r#type: String,
4164
4165    /// An array of coordinates representing the path of the drag action.
4166    pub r#path: Vec<Coordinate>,
4167}
4168
4169/// A message input to the model with a role indicating instruction following
4170/// hierarchy.
4171#[derive(Clone, Debug)]
4172#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4173pub struct EasyInputMessage {
4174    /// The role of the message input.
4175    pub r#role: String,
4176
4177    pub r#content: EasyInputMessage_Content,
4178
4179    /// The type of the message input.
4180    pub r#type: String,
4181}
4182
4183/// Text, image, or audio input to the model, used to generate a response.
4184#[derive(Clone, Debug)]
4185#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4186pub enum EasyInputMessage_Content {
4187    /// A text input to the model.
4188    String(String),
4189
4190    InputMessageContentList(InputMessageContentList),
4191}
4192
4193/// Represents an embedding vector returned by embedding endpoint.
4194#[derive(Clone, Debug)]
4195#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4196pub struct Embedding {
4197    /// The index of the embedding in the list of embeddings.
4198    pub r#index: i64,
4199
4200    /// The embedding vector, which is a list of floats.
4201    pub r#embedding: Vec<f64>,
4202
4203    /// The object type, which is always "embedding".
4204    pub r#object: String,
4205}
4206
4207#[derive(Clone, Debug, Default)]
4208#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4209pub struct Error {
4210    pub r#code: Option<String>,
4211
4212    pub r#message: String,
4213
4214    pub r#param: Option<String>,
4215
4216    pub r#type: String,
4217}
4218
4219/// Occurs when an [error](/docs/guides/error-codes#api-errors) occurs.
4220#[derive(Clone, Debug)]
4221#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4222pub struct ErrorEvent {
4223    pub r#event: String,
4224
4225    pub r#data: Error,
4226}
4227
4228#[derive(Clone, Debug)]
4229#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4230pub struct ErrorResponse {
4231    pub r#error: Error,
4232}
4233
4234/// An Eval object with a data source config and testing criteria.
4235#[derive(Clone, Debug)]
4236#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4237pub struct Eval {
4238    /// The object type.
4239    pub r#object: String,
4240
4241    /// Unique identifier for the evaluation.
4242    pub r#id: String,
4243
4244    /// The name of the evaluation.
4245    pub r#name: String,
4246
4247    pub r#data_source_config: Eval_DataSourceConfig,
4248
4249    /// A list of testing criteria.
4250    pub r#testing_criteria: Vec<Eval_TestingCriteria>,
4251
4252    /// The Unix timestamp (in seconds) for when the eval was created.
4253    pub r#created_at: i64,
4254
4255    pub r#metadata: Option<Metadata>,
4256}
4257
4258/// An object representing an error response from the Eval API.
4259#[derive(Clone, Debug, Default)]
4260#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4261pub struct EvalApiError {
4262    /// The error code.
4263    pub r#code: String,
4264
4265    /// The error message.
4266    pub r#message: String,
4267}
4268
4269/// A CustomDataSourceConfig which specifies the schema of your `item` and
4270/// optionally `sample` namespaces.
4271#[derive(Clone, Debug)]
4272#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4273pub struct EvalCustomDataSourceConfig {
4274    /// The type of data source.
4275    pub r#type: String,
4276
4277    /// The json schema for the run data source items.
4278    pub r#schema: EvalCustomDataSourceConfig_Schema,
4279}
4280
4281/// The json schema for the run data source items.
4282#[derive(Clone, Debug, Default)]
4283#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4284pub struct EvalCustomDataSourceConfig_Schema;
4285
4286/// A message input to the model with a role indicating instruction following
4287/// hierarchy.
4288#[derive(Clone, Debug)]
4289#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4290pub struct EvalItem {
4291    /// The role of the message input.
4292    pub r#role: String,
4293
4294    pub r#content: EvalItem_Content,
4295
4296    /// The type of the message input.
4297    pub r#type: String,
4298}
4299
4300/// Text inputs to the model - can contain template strings.
4301#[derive(Clone, Debug)]
4302#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4303pub enum EvalItem_Content {
4304    /// A text input to the model.
4305    String(String),
4306
4307    InputTextContent(InputTextContent),
4308
4309    EvalItem_Content_Variant3(EvalItem_Content_Variant3),
4310}
4311
4312/// A text output from the model.
4313#[derive(Clone, Debug, Default)]
4314#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4315pub struct EvalItem_Content_Variant3 {
4316    /// The type of the output text.
4317    pub r#type: String,
4318
4319    /// The text output from the model.
4320    pub r#text: String,
4321}
4322
4323#[derive(Clone, Debug)]
4324#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4325pub struct EvalJsonlFileContentSource {
4326    /// The type of jsonl source.
4327    pub r#type: String,
4328
4329    /// The content of the jsonl file.
4330    pub r#content: Vec<EvalJsonlFileContentSource_Content>,
4331}
4332
4333#[derive(Clone, Debug)]
4334#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4335pub struct EvalJsonlFileContentSource_Content {
4336    pub r#item: EvalJsonlFileContentSource_Content_Item,
4337
4338    pub r#sample: EvalJsonlFileContentSource_Content_Sample,
4339}
4340
4341#[derive(Clone, Debug, Default)]
4342#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4343pub struct EvalJsonlFileContentSource_Content_Item;
4344
4345#[derive(Clone, Debug, Default)]
4346#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4347pub struct EvalJsonlFileContentSource_Content_Sample;
4348
4349#[derive(Clone, Debug, Default)]
4350#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4351pub struct EvalJsonlFileIdSource {
4352    /// The type of jsonl source.
4353    pub r#type: String,
4354
4355    /// The identifier of the file.
4356    pub r#id: String,
4357}
4358
4359/// A LabelModelGrader object which uses a model to assign labels to each item
4360/// in the evaluation.
4361#[derive(Clone, Debug)]
4362#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4363pub struct EvalLabelModelGrader {
4364    /// The object type, which is always `label_model`.
4365    pub r#type: String,
4366
4367    /// The name of the grader.
4368    pub r#name: String,
4369
4370    /// The model to use for the evaluation.
4371    pub r#model: String,
4372
4373    pub r#input: Vec<EvalItem>,
4374
4375    /// The labels to assign to each item in the evaluation.
4376    pub r#labels: Vec<String>,
4377
4378    /// The labels that indicate a passing result.
4379    pub r#passing_labels: Vec<String>,
4380}
4381
4382/// An object representing a list of evals.
4383#[derive(Clone, Debug)]
4384#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4385pub struct EvalList {
4386    /// The type of this object.
4387    pub r#object: String,
4388
4389    /// An array of eval objects.
4390    pub r#data: Vec<Eval>,
4391
4392    /// The identifier of the first eval in the data array.
4393    pub r#first_id: String,
4394
4395    /// The identifier of the last eval in the data array.
4396    pub r#last_id: String,
4397
4398    /// Indicates whether there are more evals available.
4399    pub r#has_more: bool,
4400}
4401
4402/// A PythonGrader object that runs a python script on the input.
4403#[derive(Clone, Debug, Default)]
4404#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4405pub struct EvalPythonGrader {
4406    /// The object type, which is always `python`.
4407    pub r#type: String,
4408
4409    /// The name of the grader.
4410    pub r#name: String,
4411
4412    /// The source code of the python script.
4413    pub r#source: String,
4414
4415    /// The threshold for the score.
4416    pub r#pass_threshold: f64,
4417
4418    /// The image tag to use for the python script.
4419    pub r#image_tag: String,
4420}
4421
4422/// A EvalResponsesSource object describing a run data source configuration.
4423#[derive(Clone, Debug)]
4424#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4425pub struct EvalResponsesSource {
4426    /// The type of run data source.
4427    pub r#type: String,
4428
4429    /// Metadata filter for the responses.
4430    pub r#metadata: Option<EvalResponsesSource_Metadata>,
4431
4432    /// The name of the model to find responses for.
4433    pub r#model: Option<String>,
4434
4435    /// Optional search string for instructions.
4436    pub r#instructions_search: Option<String>,
4437
4438    /// Only include items created after this timestamp (inclusive).
4439    pub r#created_after: Option<i64>,
4440
4441    /// Only include items created before this timestamp (inclusive).
4442    pub r#created_before: Option<i64>,
4443
4444    /// Whether the response has tool calls.
4445    pub r#has_tool_calls: Option<bool>,
4446
4447    /// Optional reasoning effort parameter.
4448    pub r#reasoning_effort: Option<ReasoningEffort>,
4449
4450    /// Sampling temperature.
4451    pub r#temperature: Option<f64>,
4452
4453    /// Nucleus sampling parameter.
4454    pub r#top_p: Option<f64>,
4455
4456    /// List of user identifiers.
4457    pub r#users: Option<Vec<String>>,
4458
4459    /// Whether to allow parallel tool calls.
4460    pub r#allow_parallel_tool_calls: Option<bool>,
4461}
4462
4463/// Metadata filter for the responses.
4464#[derive(Clone, Debug, Default)]
4465#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4466pub struct EvalResponsesSource_Metadata;
4467
4468/// A schema representing an evaluation run.
4469#[derive(Clone, Debug)]
4470#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4471pub struct EvalRun {
4472    /// The type of the object.
4473    pub r#object: String,
4474
4475    /// Unique identifier for the evaluation run.
4476    pub r#id: String,
4477
4478    /// The identifier of the associated evaluation.
4479    pub r#eval_id: String,
4480
4481    /// The status of the evaluation run.
4482    pub r#status: String,
4483
4484    /// The model that is evaluated, if applicable.
4485    pub r#model: String,
4486
4487    /// The name of the evaluation run.
4488    pub r#name: String,
4489
4490    /// Unix timestamp (in seconds) when the evaluation run was created.
4491    pub r#created_at: i64,
4492
4493    /// The URL to the rendered evaluation run report on the UI dashboard.
4494    pub r#report_url: String,
4495
4496    pub r#result_counts: EvalRun_ResultCounts,
4497
4498    /// Usage statistics for each model during the evaluation run.
4499    pub r#per_model_usage: Vec<EvalRun_PerModelUsage>,
4500
4501    /// Results per testing criteria applied during the evaluation run.
4502    pub r#per_testing_criteria_results: Vec<EvalRun_PerTestingCriteriaResults>,
4503
4504    pub r#data_source: EvalRun_DataSource,
4505
4506    pub r#metadata: Option<Metadata>,
4507
4508    pub r#error: EvalApiError,
4509}
4510
4511/// An object representing a list of runs for an evaluation.
4512#[derive(Clone, Debug)]
4513#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4514pub struct EvalRunList {
4515    /// The type of this object.
4516    pub r#object: String,
4517
4518    /// An array of eval run objects.
4519    pub r#data: Vec<EvalRun>,
4520
4521    /// The identifier of the first eval run in the data array.
4522    pub r#first_id: String,
4523
4524    /// The identifier of the last eval run in the data array.
4525    pub r#last_id: String,
4526
4527    /// Indicates whether there are more evals available.
4528    pub r#has_more: bool,
4529}
4530
4531/// A schema representing an evaluation run output item.
4532#[derive(Clone, Debug)]
4533#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4534pub struct EvalRunOutputItem {
4535    /// The type of the object.
4536    pub r#object: String,
4537
4538    /// Unique identifier for the evaluation run output item.
4539    pub r#id: String,
4540
4541    /// The identifier of the evaluation run associated with this output item.
4542    pub r#run_id: String,
4543
4544    /// The identifier of the evaluation group.
4545    pub r#eval_id: String,
4546
4547    /// Unix timestamp (in seconds) when the evaluation run was created.
4548    pub r#created_at: i64,
4549
4550    /// The status of the evaluation run.
4551    pub r#status: String,
4552
4553    /// The identifier for the data source item.
4554    pub r#datasource_item_id: i64,
4555
4556    /// Details of the input data source item.
4557    pub r#datasource_item: EvalRunOutputItem_DatasourceItem,
4558
4559    /// A list of results from the evaluation run.
4560    pub r#results: Vec<EvalRunOutputItem_Results_Item>,
4561
4562    pub r#sample: EvalRunOutputItem_Sample,
4563}
4564
4565/// Details of the input data source item.
4566#[derive(Clone, Debug, Default)]
4567#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4568pub struct EvalRunOutputItem_DatasourceItem;
4569
4570/// A result object.
4571#[derive(Clone, Debug, Default)]
4572#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4573pub struct EvalRunOutputItem_Results_Item;
4574
4575/// An object representing a list of output items for an evaluation run.
4576#[derive(Clone, Debug)]
4577#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4578pub struct EvalRunOutputItemList {
4579    /// The type of this object.
4580    pub r#object: String,
4581
4582    /// An array of eval run output item objects.
4583    pub r#data: Vec<EvalRunOutputItem>,
4584
4585    /// The identifier of the first eval run output item in the data array.
4586    pub r#first_id: String,
4587
4588    /// The identifier of the last eval run output item in the data array.
4589    pub r#last_id: String,
4590
4591    /// Indicates whether there are more eval run output items available.
4592    pub r#has_more: bool,
4593}
4594
4595/// A sample containing the input and output of the evaluation run.
4596#[derive(Clone, Debug)]
4597#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4598pub struct EvalRunOutputItem_Sample {
4599    /// An array of input messages.
4600    pub r#input: Vec<EvalRunOutputItem_Sample_Input>,
4601
4602    /// An array of output messages.
4603    pub r#output: Vec<EvalRunOutputItem_Sample_Output>,
4604
4605    /// The reason why the sample generation was finished.
4606    pub r#finish_reason: String,
4607
4608    /// The model used for generating the sample.
4609    pub r#model: String,
4610
4611    pub r#usage: EvalRunOutputItem_Sample_Usage,
4612
4613    pub r#error: EvalApiError,
4614
4615    /// The sampling temperature used.
4616    pub r#temperature: f64,
4617
4618    /// The maximum number of tokens allowed for completion.
4619    pub r#max_completion_tokens: i64,
4620
4621    /// The top_p value used for sampling.
4622    pub r#top_p: f64,
4623
4624    /// The seed used for generating the sample.
4625    pub r#seed: i64,
4626}
4627
4628/// An input message.
4629#[derive(Clone, Debug, Default)]
4630#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4631pub struct EvalRunOutputItem_Sample_Input {
4632    /// The role of the message sender (e.g., system, user, developer).
4633    pub r#role: String,
4634
4635    /// The content of the message.
4636    pub r#content: String,
4637}
4638
4639#[derive(Clone, Debug, Default)]
4640#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4641pub struct EvalRunOutputItem_Sample_Output {
4642    /// The role of the message (e.g.
4643    pub r#role: String,
4644
4645    /// The content of the message.
4646    pub r#content: String,
4647}
4648
4649/// Token usage details for the sample.
4650#[derive(Clone, Debug, Default)]
4651#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4652pub struct EvalRunOutputItem_Sample_Usage {
4653    /// The total number of tokens used.
4654    pub r#total_tokens: i64,
4655
4656    /// The number of completion tokens generated.
4657    pub r#completion_tokens: i64,
4658
4659    /// The number of prompt tokens used.
4660    pub r#prompt_tokens: i64,
4661
4662    /// The number of tokens retrieved from cache.
4663    pub r#cached_tokens: i64,
4664}
4665
4666/// Information about the run's data source.
4667#[derive(Clone, Debug, Default)]
4668#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4669pub struct EvalRun_DataSource;
4670
4671#[derive(Clone, Debug, Default)]
4672#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4673pub struct EvalRun_PerModelUsage {
4674    /// The name of the model.
4675    pub r#model_name: String,
4676
4677    /// The number of invocations.
4678    pub r#invocation_count: i64,
4679
4680    /// The number of prompt tokens used.
4681    pub r#prompt_tokens: i64,
4682
4683    /// The number of completion tokens generated.
4684    pub r#completion_tokens: i64,
4685
4686    /// The total number of tokens used.
4687    pub r#total_tokens: i64,
4688
4689    /// The number of tokens retrieved from cache.
4690    pub r#cached_tokens: i64,
4691}
4692
4693#[derive(Clone, Debug, Default)]
4694#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4695pub struct EvalRun_PerTestingCriteriaResults {
4696    /// A description of the testing criteria.
4697    pub r#testing_criteria: String,
4698
4699    /// Number of tests passed for this criteria.
4700    pub r#passed: i64,
4701
4702    /// Number of tests failed for this criteria.
4703    pub r#failed: i64,
4704}
4705
4706/// Counters summarizing the outcomes of the evaluation run.
4707#[derive(Clone, Debug, Default)]
4708#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4709pub struct EvalRun_ResultCounts {
4710    /// Total number of executed output items.
4711    pub r#total: i64,
4712
4713    /// Number of output items that resulted in an error.
4714    pub r#errored: i64,
4715
4716    /// Number of output items that failed to pass the evaluation.
4717    pub r#failed: i64,
4718
4719    /// Number of output items that passed the evaluation.
4720    pub r#passed: i64,
4721}
4722
4723/// A ScoreModelGrader object that uses a model to assign a score to the input.
4724#[derive(Clone, Debug)]
4725#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4726pub struct EvalScoreModelGrader {
4727    /// The object type, which is always `score_model`.
4728    pub r#type: String,
4729
4730    /// The name of the grader.
4731    pub r#name: String,
4732
4733    /// The model to use for the evaluation.
4734    pub r#model: String,
4735
4736    /// The sampling parameters for the model.
4737    pub r#sampling_params: EvalScoreModelGrader_SamplingParams,
4738
4739    /// The input text.
4740    pub r#input: Vec<EvalItem>,
4741
4742    /// The threshold for the score.
4743    pub r#pass_threshold: f64,
4744
4745    /// The range of the score.
4746    pub r#range: Vec<f64>,
4747}
4748
4749/// The sampling parameters for the model.
4750#[derive(Clone, Debug, Default)]
4751#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4752pub struct EvalScoreModelGrader_SamplingParams;
4753
4754/// A StoredCompletionsDataSourceConfig which specifies the metadata property of
4755/// your stored completions query.
4756#[derive(Clone, Debug)]
4757#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4758pub struct EvalStoredCompletionsDataSourceConfig {
4759    /// The type of data source.
4760    pub r#type: String,
4761
4762    pub r#metadata: Option<Metadata>,
4763
4764    /// The json schema for the run data source items.
4765    pub r#schema: EvalStoredCompletionsDataSourceConfig_Schema,
4766}
4767
4768/// The json schema for the run data source items.
4769#[derive(Clone, Debug, Default)]
4770#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4771pub struct EvalStoredCompletionsDataSourceConfig_Schema;
4772
4773/// A StoredCompletionsRunDataSource configuration describing a set of filters
4774#[derive(Clone, Debug)]
4775#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4776pub struct EvalStoredCompletionsSource {
4777    /// The type of source.
4778    pub r#type: String,
4779
4780    pub r#metadata: Option<Metadata>,
4781
4782    /// An optional model to filter by (e.g., 'gpt-4o').
4783    pub r#model: Option<String>,
4784
4785    /// An optional Unix timestamp to filter items created after this time.
4786    pub r#created_after: Option<i64>,
4787
4788    /// An optional Unix timestamp to filter items created before this time.
4789    pub r#created_before: Option<i64>,
4790
4791    /// An optional maximum number of items to return.
4792    pub r#limit: Option<i64>,
4793}
4794
4795/// A StringCheckGrader object that performs a string comparison between input
4796/// and reference using a specified operation.
4797#[derive(Clone, Debug, Default)]
4798#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4799pub struct EvalStringCheckGrader {
4800    /// The object type, which is always `string_check`.
4801    pub r#type: String,
4802
4803    /// The name of the grader.
4804    pub r#name: String,
4805
4806    /// The input text.
4807    pub r#input: String,
4808
4809    /// The reference text.
4810    pub r#reference: String,
4811
4812    /// The string check operation to perform.
4813    pub r#operation: String,
4814}
4815
4816/// A TextSimilarityGrader object which grades text based on similarity metrics.
4817#[derive(Clone, Debug, Default)]
4818#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4819pub struct EvalTextSimilarityGrader {
4820    /// The type of grader.
4821    pub r#type: String,
4822
4823    /// The name of the grader.
4824    pub r#name: String,
4825
4826    /// The text being graded.
4827    pub r#input: String,
4828
4829    /// The text being graded against.
4830    pub r#reference: String,
4831
4832    /// A float score where a value greater than or equal indicates a passing
4833    /// grade.
4834    pub r#pass_threshold: f64,
4835
4836    /// The evaluation metric to use.
4837    pub r#evaluation_metric: String,
4838}
4839
4840/// Configuration of data sources used in runs of the evaluation.
4841#[derive(Clone, Debug, Default)]
4842#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4843pub struct Eval_DataSourceConfig;
4844
4845#[derive(Clone, Debug)]
4846#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4847pub enum Eval_TestingCriteria {
4848    EvalLabelModelGrader(EvalLabelModelGrader),
4849
4850    EvalStringCheckGrader(EvalStringCheckGrader),
4851
4852    EvalTextSimilarityGrader(EvalTextSimilarityGrader),
4853
4854    EvalPythonGrader(EvalPythonGrader),
4855
4856    EvalScoreModelGrader(EvalScoreModelGrader),
4857}
4858
4859/// A citation to a file.
4860#[derive(Clone, Debug, Default)]
4861#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4862pub struct FileCitationBody {
4863    /// The type of the file citation.
4864    pub r#type: String,
4865
4866    /// The ID of the file.
4867    pub r#file_id: String,
4868
4869    /// The index of the file in the list of files.
4870    pub r#index: i64,
4871}
4872
4873/// A path to a file.
4874#[derive(Clone, Debug, Default)]
4875#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4876pub struct FilePath {
4877    /// The type of the file path.
4878    pub r#type: String,
4879
4880    /// The ID of the file.
4881    pub r#file_id: String,
4882
4883    /// The index of the file in the list of files.
4884    pub r#index: i64,
4885}
4886
4887/// The ranker to use for the file search.
4888#[derive(Clone, Debug)]
4889#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4890pub struct FileSearchRanker(pub String);
4891
4892/// The ranking options for the file search.
4893#[derive(Clone, Debug)]
4894#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4895pub struct FileSearchRankingOptions {
4896    pub r#ranker: FileSearchRanker,
4897
4898    /// The score threshold for the file search.
4899    pub r#score_threshold: f64,
4900}
4901
4902/// A tool that searches for relevant content from uploaded files.
4903#[derive(Clone, Debug)]
4904#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4905pub struct FileSearchTool {
4906    /// The type of the file search tool.
4907    pub r#type: String,
4908
4909    /// The IDs of the vector stores to search.
4910    pub r#vector_store_ids: Vec<String>,
4911
4912    /// The maximum number of results to return.
4913    pub r#max_num_results: i64,
4914
4915    /// Ranking options for search.
4916    pub r#ranking_options: RankingOptions,
4917
4918    pub r#filters: FileSearchTool_Filters,
4919}
4920
4921/// The results of a file search tool call.
4922#[derive(Clone, Debug)]
4923#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4924pub struct FileSearchToolCall {
4925    /// The unique ID of the file search tool call.
4926    pub r#id: String,
4927
4928    /// The type of the file search tool call.
4929    pub r#type: String,
4930
4931    /// The status of the file search tool call.
4932    pub r#status: String,
4933
4934    /// The queries used to search for files.
4935    pub r#queries: Vec<String>,
4936
4937    /// The results of the file search tool call.
4938    pub r#results: Option<Vec<FileSearchToolCall_Results>>,
4939}
4940
4941#[derive(Clone, Debug)]
4942#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4943pub struct FileSearchToolCall_Results {
4944    /// The unique ID of the file.
4945    pub r#file_id: String,
4946
4947    /// The text that was retrieved from the file.
4948    pub r#text: String,
4949
4950    /// The name of the file.
4951    pub r#filename: String,
4952
4953    pub r#attributes: Option<VectorStoreFileAttributes>,
4954
4955    /// The relevance score of the file - a value between 0 and 1.
4956    pub r#score: f64,
4957}
4958
4959#[derive(Clone, Debug)]
4960#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4961pub enum FileSearchTool_Filters {
4962    /// A filter to apply.
4963    Filters(Filters),
4964
4965    Null(()),
4966}
4967
4968#[derive(Clone, Debug)]
4969#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4970pub enum Filters {
4971    ComparisonFilter(ComparisonFilter),
4972
4973    CompoundFilter(CompoundFilter),
4974}
4975
4976#[derive(Clone, Debug, Default)]
4977#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4978pub struct FineTuneChatCompletionRequestAssistantMessage(pub (/*AllOf*/));
4979
4980#[derive(Clone, Debug, Default)]
4981#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4982pub struct FineTuneChatCompletionRequestAssistantMessage_Variant1 {
4983    /// Controls whether the assistant message is trained against (0 or 1)
4984    pub r#weight: i64,
4985}
4986
4987/// The per-line training example of a fine-tuning input file for chat models
4988/// using the supervised method.
4989#[derive(Clone, Debug)]
4990#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4991pub struct FineTuneChatRequestInput {
4992    pub r#messages: Vec<FineTuneChatRequestInput_Messages>,
4993
4994    /// A list of tools the model may generate JSON inputs for.
4995    pub r#tools: Vec<ChatCompletionTool>,
4996
4997    pub r#parallel_tool_calls: ParallelToolCalls,
4998
4999    /// A list of functions the model may generate JSON inputs for.
5000    pub r#functions: Vec<ChatCompletionFunctions>,
5001}
5002
5003#[derive(Clone, Debug)]
5004#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5005pub enum FineTuneChatRequestInput_Messages {
5006    ChatCompletionRequestSystemMessage(ChatCompletionRequestSystemMessage),
5007
5008    ChatCompletionRequestUserMessage(ChatCompletionRequestUserMessage),
5009
5010    FineTuneChatCompletionRequestAssistantMessage(FineTuneChatCompletionRequestAssistantMessage),
5011
5012    ChatCompletionRequestToolMessage(ChatCompletionRequestToolMessage),
5013
5014    ChatCompletionRequestFunctionMessage(ChatCompletionRequestFunctionMessage),
5015}
5016
5017/// The per-line training example of a fine-tuning input file for completions
5018/// models
5019#[derive(Clone, Debug, Default)]
5020#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5021pub struct FineTuneCompletionRequestInput {
5022    /// The input prompt for this training example.
5023    pub r#prompt: String,
5024
5025    /// The desired completion for this training example.
5026    pub r#completion: String,
5027}
5028
5029/// Configuration for the DPO fine-tuning method.
5030#[derive(Clone, Debug)]
5031#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5032pub struct FineTuneDPOMethod {
5033    pub r#hyperparameters: FineTuneDPOMethod_Hyperparameters,
5034}
5035
5036/// The hyperparameters used for the fine-tuning job.
5037#[derive(Clone, Debug)]
5038#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5039pub struct FineTuneDPOMethod_Hyperparameters {
5040    pub r#beta: FineTuneDPOMethod_Hyperparameters_Beta,
5041
5042    pub r#batch_size: FineTuneDPOMethod_Hyperparameters_BatchSize,
5043
5044    pub r#learning_rate_multiplier: FineTuneDPOMethod_Hyperparameters_LearningRateMultiplier,
5045
5046    pub r#n_epochs: FineTuneDPOMethod_Hyperparameters_NEpochs,
5047}
5048
5049/// Number of examples in each batch.
5050#[derive(Clone, Debug)]
5051#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5052pub enum FineTuneDPOMethod_Hyperparameters_BatchSize {
5053    String(String),
5054
5055    Integer(i64),
5056}
5057
5058/// The beta value for the DPO method.
5059#[derive(Clone, Debug)]
5060#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5061pub enum FineTuneDPOMethod_Hyperparameters_Beta {
5062    String(String),
5063
5064    Number(f64),
5065}
5066
5067/// Scaling factor for the learning rate.
5068#[derive(Clone, Debug)]
5069#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5070pub enum FineTuneDPOMethod_Hyperparameters_LearningRateMultiplier {
5071    String(String),
5072
5073    Number(f64),
5074}
5075
5076/// The number of epochs to train the model for.
5077#[derive(Clone, Debug)]
5078#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5079pub enum FineTuneDPOMethod_Hyperparameters_NEpochs {
5080    String(String),
5081
5082    Integer(i64),
5083}
5084
5085/// The method used for fine-tuning.
5086#[derive(Clone, Debug)]
5087#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5088pub struct FineTuneMethod {
5089    /// The type of method.
5090    pub r#type: String,
5091
5092    pub r#supervised: FineTuneSupervisedMethod,
5093
5094    pub r#dpo: FineTuneDPOMethod,
5095}
5096
5097/// The per-line training example of a fine-tuning input file for chat models
5098/// using the dpo method.
5099#[derive(Clone, Debug)]
5100#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5101pub struct FineTunePreferenceRequestInput {
5102    pub r#input: FineTunePreferenceRequestInput_Input,
5103
5104    /// The preferred completion message for the output.
5105    pub r#preferred_completion: Vec<ChatCompletionRequestAssistantMessage>,
5106
5107    /// The non-preferred completion message for the output.
5108    pub r#non_preferred_completion: Vec<ChatCompletionRequestAssistantMessage>,
5109}
5110
5111#[derive(Clone, Debug)]
5112#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5113pub struct FineTunePreferenceRequestInput_Input {
5114    pub r#messages: Vec<FineTunePreferenceRequestInput_Input_Messages>,
5115
5116    /// A list of tools the model may generate JSON inputs for.
5117    pub r#tools: Vec<ChatCompletionTool>,
5118
5119    pub r#parallel_tool_calls: ParallelToolCalls,
5120}
5121
5122#[derive(Clone, Debug)]
5123#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5124pub enum FineTunePreferenceRequestInput_Input_Messages {
5125    ChatCompletionRequestSystemMessage(ChatCompletionRequestSystemMessage),
5126
5127    ChatCompletionRequestUserMessage(ChatCompletionRequestUserMessage),
5128
5129    FineTuneChatCompletionRequestAssistantMessage(FineTuneChatCompletionRequestAssistantMessage),
5130
5131    ChatCompletionRequestToolMessage(ChatCompletionRequestToolMessage),
5132
5133    ChatCompletionRequestFunctionMessage(ChatCompletionRequestFunctionMessage),
5134}
5135
5136#[derive(Clone, Debug)]
5137#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5138pub struct FineTunePreferenceRequestInput_NonPreferredCompletion(pub ChatCompletionRequestAssistantMessage);
5139
5140#[derive(Clone, Debug)]
5141#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5142pub struct FineTunePreferenceRequestInput_PreferredCompletion(pub ChatCompletionRequestAssistantMessage);
5143
5144/// Configuration for the supervised fine-tuning method.
5145#[derive(Clone, Debug)]
5146#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5147pub struct FineTuneSupervisedMethod {
5148    pub r#hyperparameters: FineTuneSupervisedMethod_Hyperparameters,
5149}
5150
5151/// The hyperparameters used for the fine-tuning job.
5152#[derive(Clone, Debug)]
5153#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5154pub struct FineTuneSupervisedMethod_Hyperparameters {
5155    pub r#batch_size: FineTuneSupervisedMethod_Hyperparameters_BatchSize,
5156
5157    pub r#learning_rate_multiplier: FineTuneSupervisedMethod_Hyperparameters_LearningRateMultiplier,
5158
5159    pub r#n_epochs: FineTuneSupervisedMethod_Hyperparameters_NEpochs,
5160}
5161
5162/// Number of examples in each batch.
5163#[derive(Clone, Debug)]
5164#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5165pub enum FineTuneSupervisedMethod_Hyperparameters_BatchSize {
5166    String(String),
5167
5168    Integer(i64),
5169}
5170
5171/// Scaling factor for the learning rate.
5172#[derive(Clone, Debug)]
5173#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5174pub enum FineTuneSupervisedMethod_Hyperparameters_LearningRateMultiplier {
5175    String(String),
5176
5177    Number(f64),
5178}
5179
5180/// The number of epochs to train the model for.
5181#[derive(Clone, Debug)]
5182#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5183pub enum FineTuneSupervisedMethod_Hyperparameters_NEpochs {
5184    String(String),
5185
5186    Integer(i64),
5187}
5188
5189/// The `checkpoint.permission` object represents a permission for a fine-tuned
5190/// model checkpoint.
5191#[derive(Clone, Debug, Default)]
5192#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5193pub struct FineTuningCheckpointPermission {
5194    /// The permission identifier, which can be referenced in the API endpoints.
5195    pub r#id: String,
5196
5197    /// The Unix timestamp (in seconds) for when the permission was created.
5198    pub r#created_at: i64,
5199
5200    /// The project identifier that the permission is for.
5201    pub r#project_id: String,
5202
5203    /// The object type, which is always "checkpoint.permission".
5204    pub r#object: String,
5205}
5206
5207#[derive(Clone, Debug)]
5208#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5209pub struct FineTuningIntegration {
5210    /// The type of the integration being enabled for the fine-tuning job
5211    pub r#type: String,
5212
5213    pub r#wandb: FineTuningIntegration_Wandb,
5214}
5215
5216/// The settings for your integration with Weights and Biases.
5217#[derive(Clone, Debug)]
5218#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5219pub struct FineTuningIntegration_Wandb {
5220    /// The name of the project that the new run will be created under.
5221    pub r#project: String,
5222
5223    /// A display name to set for the run.
5224    pub r#name: Option<String>,
5225
5226    /// The entity to use for the run.
5227    pub r#entity: Option<String>,
5228
5229    /// A list of tags to be attached to the newly created run.
5230    pub r#tags: Vec<String>,
5231}
5232
5233/// The `fine_tuning.job` object represents a fine-tuning job that has been
5234/// created through the API.
5235#[derive(Clone, Debug)]
5236#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5237pub struct FineTuningJob {
5238    /// The object identifier, which can be referenced in the API endpoints.
5239    pub r#id: String,
5240
5241    /// The Unix timestamp (in seconds) for when the fine-tuning job was
5242    /// created.
5243    pub r#created_at: i64,
5244
5245    pub r#error: Option<FineTuningJob_Error>,
5246
5247    /// The name of the fine-tuned model that is being created.
5248    pub r#fine_tuned_model: Option<String>,
5249
5250    /// The Unix timestamp (in seconds) for when the fine-tuning job was
5251    /// finished.
5252    pub r#finished_at: Option<i64>,
5253
5254    pub r#hyperparameters: FineTuningJob_Hyperparameters,
5255
5256    /// The base model that is being fine-tuned.
5257    pub r#model: String,
5258
5259    /// The object type, which is always "fine_tuning.job".
5260    pub r#object: String,
5261
5262    /// The organization that owns the fine-tuning job.
5263    pub r#organization_id: String,
5264
5265    /// The compiled results file ID(s) for the fine-tuning job.
5266    pub r#result_files: Vec<String>,
5267
5268    /// The current status of the fine-tuning job, which can be either
5269    /// `validating_files`, `queued`, `running`, `succeeded`, `failed`, or
5270    /// `cancelled`.
5271    pub r#status: String,
5272
5273    /// The total number of billable tokens processed by this fine-tuning job.
5274    pub r#trained_tokens: Option<i64>,
5275
5276    /// The file ID used for training.
5277    pub r#training_file: String,
5278
5279    /// The file ID used for validation.
5280    pub r#validation_file: Option<String>,
5281
5282    /// A list of integrations to enable for this fine-tuning job.
5283    pub r#integrations: Option<Vec<FineTuningIntegration>>,
5284
5285    /// The seed used for the fine-tuning job.
5286    pub r#seed: i64,
5287
5288    /// The Unix timestamp (in seconds) for when the fine-tuning job is
5289    /// estimated to finish.
5290    pub r#estimated_finish: Option<i64>,
5291
5292    pub r#method: FineTuneMethod,
5293
5294    pub r#metadata: Option<Metadata>,
5295}
5296
5297/// The `fine_tuning.job.checkpoint` object represents a model checkpoint for a
5298/// fine-tuning job that is ready to use.
5299#[derive(Clone, Debug)]
5300#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5301pub struct FineTuningJobCheckpoint {
5302    /// The checkpoint identifier, which can be referenced in the API endpoints.
5303    pub r#id: String,
5304
5305    /// The Unix timestamp (in seconds) for when the checkpoint was created.
5306    pub r#created_at: i64,
5307
5308    /// The name of the fine-tuned checkpoint model that is created.
5309    pub r#fine_tuned_model_checkpoint: String,
5310
5311    /// The step number that the checkpoint was created at.
5312    pub r#step_number: i64,
5313
5314    pub r#metrics: FineTuningJobCheckpoint_Metrics,
5315
5316    /// The name of the fine-tuning job that this checkpoint was created from.
5317    pub r#fine_tuning_job_id: String,
5318
5319    /// The object type, which is always "fine_tuning.job.checkpoint".
5320    pub r#object: String,
5321}
5322
5323/// Metrics at the step number during the fine-tuning job.
5324#[derive(Clone, Debug, Default)]
5325#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5326pub struct FineTuningJobCheckpoint_Metrics {
5327    pub r#step: f64,
5328
5329    pub r#train_loss: f64,
5330
5331    pub r#train_mean_token_accuracy: f64,
5332
5333    pub r#valid_loss: f64,
5334
5335    pub r#valid_mean_token_accuracy: f64,
5336
5337    pub r#full_valid_loss: f64,
5338
5339    pub r#full_valid_mean_token_accuracy: f64,
5340}
5341
5342/// Fine-tuning job event object
5343#[derive(Clone, Debug)]
5344#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5345pub struct FineTuningJobEvent {
5346    /// The object type, which is always "fine_tuning.job.event".
5347    pub r#object: String,
5348
5349    /// The object identifier.
5350    pub r#id: String,
5351
5352    /// The Unix timestamp (in seconds) for when the fine-tuning job was
5353    /// created.
5354    pub r#created_at: i64,
5355
5356    /// The log level of the event.
5357    pub r#level: String,
5358
5359    /// The message of the event.
5360    pub r#message: String,
5361
5362    /// The type of event.
5363    pub r#type: String,
5364
5365    /// The data associated with the event.
5366    pub r#data: FineTuningJobEvent_Data,
5367}
5368
5369/// The data associated with the event.
5370#[derive(Clone, Debug, Default)]
5371#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5372pub struct FineTuningJobEvent_Data;
5373
5374/// For fine-tuning jobs that have `failed`, this will contain more information
5375/// on the cause of the failure.
5376#[derive(Clone, Debug, Default)]
5377#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5378pub struct FineTuningJob_Error {
5379    /// A machine-readable error code.
5380    pub r#code: String,
5381
5382    /// A human-readable error message.
5383    pub r#message: String,
5384
5385    /// The parameter that was invalid, usually `training_file` or
5386    /// `validation_file`.
5387    pub r#param: Option<String>,
5388}
5389
5390/// The hyperparameters used for the fine-tuning job.
5391#[derive(Clone, Debug)]
5392#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5393pub struct FineTuningJob_Hyperparameters {
5394    pub r#batch_size: FineTuningJob_Hyperparameters_BatchSize,
5395
5396    pub r#learning_rate_multiplier: FineTuningJob_Hyperparameters_LearningRateMultiplier,
5397
5398    pub r#n_epochs: FineTuningJob_Hyperparameters_NEpochs,
5399}
5400
5401/// Number of examples in each batch.
5402#[derive(Clone, Debug)]
5403#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5404pub enum FineTuningJob_Hyperparameters_BatchSize {
5405    String(String),
5406
5407    Integer(i64),
5408}
5409
5410/// Scaling factor for the learning rate.
5411#[derive(Clone, Debug)]
5412#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5413pub enum FineTuningJob_Hyperparameters_LearningRateMultiplier {
5414    String(String),
5415
5416    Number(f64),
5417}
5418
5419/// The number of epochs to train the model for.
5420#[derive(Clone, Debug)]
5421#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5422pub enum FineTuningJob_Hyperparameters_NEpochs {
5423    String(String),
5424
5425    Integer(i64),
5426}
5427
5428#[derive(Clone, Debug)]
5429#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5430pub struct FineTuningJob_Integrations(pub FineTuningIntegration);
5431
5432/// The output of a function tool call.
5433#[derive(Clone, Debug)]
5434#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5435pub struct FunctionCallOutputItemParam {
5436    pub r#id: FunctionCallOutputItemParam_Id,
5437
5438    /// The unique ID of the function tool call generated by the model.
5439    pub r#call_id: String,
5440
5441    /// The type of the function tool call output.
5442    pub r#type: String,
5443
5444    /// A JSON string of the output of the function tool call.
5445    pub r#output: String,
5446
5447    pub r#status: FunctionCallOutputItemParam_Status,
5448}
5449
5450pub type FunctionCallOutputItemParam_Id = Option<String>;
5451
5452pub type FunctionCallOutputItemParam_Status = Option<String>;
5453
5454#[derive(Clone, Debug)]
5455#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5456pub struct FunctionObject {
5457    /// A description of what the function does, used by the model to choose
5458    /// when and how to call the function.
5459    pub r#description: String,
5460
5461    /// The name of the function to be called.
5462    pub r#name: String,
5463
5464    pub r#parameters: FunctionParameters,
5465
5466    /// Whether to enable strict schema adherence when generating the function
5467    /// call.
5468    pub r#strict: Option<bool>,
5469}
5470
5471/// The parameters the functions accepts, described as a JSON Schema object.
5472#[derive(Clone, Debug, Default)]
5473#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5474pub struct FunctionParameters;
5475
5476/// Defines a function in your own code the model can choose to call.
5477#[derive(Clone, Debug)]
5478#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5479pub struct FunctionTool {
5480    /// The type of the function tool.
5481    pub r#type: String,
5482
5483    /// The name of the function to call.
5484    pub r#name: String,
5485
5486    pub r#description: FunctionTool_Description,
5487
5488    pub r#parameters: FunctionTool_Parameters,
5489
5490    pub r#strict: FunctionTool_Strict,
5491}
5492
5493/// A tool call to run a function.
5494#[derive(Clone, Debug, Default)]
5495#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5496pub struct FunctionToolCall {
5497    /// The unique ID of the function tool call.
5498    pub r#id: String,
5499
5500    /// The type of the function tool call.
5501    pub r#type: String,
5502
5503    /// The unique ID of the function tool call generated by the model.
5504    pub r#call_id: String,
5505
5506    /// The name of the function to run.
5507    pub r#name: String,
5508
5509    /// A JSON string of the arguments to pass to the function.
5510    pub r#arguments: String,
5511
5512    /// The status of the item.
5513    pub r#status: String,
5514}
5515
5516/// The output of a function tool call.
5517#[derive(Clone, Debug, Default)]
5518#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5519pub struct FunctionToolCallOutput {
5520    /// The unique ID of the function tool call output.
5521    pub r#id: String,
5522
5523    /// The type of the function tool call output.
5524    pub r#type: String,
5525
5526    /// The unique ID of the function tool call generated by the model.
5527    pub r#call_id: String,
5528
5529    /// A JSON string of the output of the function tool call.
5530    pub r#output: String,
5531
5532    /// The status of the item.
5533    pub r#status: String,
5534}
5535
5536#[derive(Clone, Debug, Default)]
5537#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5538pub struct FunctionToolCallOutputResource(pub (/*AllOf*/));
5539
5540#[derive(Clone, Debug, Default)]
5541#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5542pub struct FunctionToolCallOutputResource_Variant2 {
5543    /// The unique ID of the function call tool output.
5544    pub r#id: String,
5545}
5546
5547#[derive(Clone, Debug, Default)]
5548#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5549pub struct FunctionToolCallResource(pub (/*AllOf*/));
5550
5551#[derive(Clone, Debug, Default)]
5552#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5553pub struct FunctionToolCallResource_Variant2 {
5554    /// The unique ID of the function tool call.
5555    pub r#id: String,
5556}
5557
5558pub type FunctionTool_Description = Option<String>;
5559
5560#[derive(Clone, Debug)]
5561#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5562pub enum FunctionTool_Parameters {
5563    /// A JSON schema object describing the parameters of the function.
5564    Object(FunctionTool_Parameters_1),
5565
5566    Null(()),
5567}
5568
5569/// A JSON schema object describing the parameters of the function.
5570#[derive(Clone, Debug, Default)]
5571#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5572pub struct FunctionTool_Parameters_1;
5573
5574#[derive(Clone, Debug)]
5575#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5576pub enum FunctionTool_Strict {
5577    /// Whether to enforce strict parameter validation.
5578    Boolean(bool),
5579
5580    Null(()),
5581}
5582
5583/// Represents the content or the URL of an image generated by the OpenAI API.
5584#[derive(Clone, Debug, Default)]
5585#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5586pub struct Image {
5587    /// The base64-encoded JSON of the generated image.
5588    pub r#b64_json: String,
5589
5590    /// When using `dall-e-2` or `dall-e-3`, the URL of the generated image if
5591    /// `response_format` is set to `url` (default value).
5592    pub r#url: String,
5593
5594    /// For `dall-e-3` only, the revised prompt that was used to generate the
5595    /// image.
5596    pub r#revised_prompt: String,
5597}
5598
5599/// The response from the image generation endpoint.
5600#[derive(Clone, Debug)]
5601#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5602pub struct ImagesResponse {
5603    /// The Unix timestamp (in seconds) of when the image was created.
5604    pub r#created: i64,
5605
5606    /// The list of generated images.
5607    pub r#data: Vec<Image>,
5608
5609    pub r#usage: ImagesResponse_Usage,
5610}
5611
5612/// For `gpt-image-1` only, the token usage information for the image
5613/// generation.
5614#[derive(Clone, Debug)]
5615#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5616pub struct ImagesResponse_Usage {
5617    /// The total number of tokens (images and text) used for the image
5618    /// generation.
5619    pub r#total_tokens: i64,
5620
5621    /// The number of tokens (images and text) in the input prompt.
5622    pub r#input_tokens: i64,
5623
5624    /// The number of image tokens in the output image.
5625    pub r#output_tokens: i64,
5626
5627    pub r#input_tokens_details: ImagesResponse_Usage_InputTokensDetails,
5628}
5629
5630/// The input tokens detailed information for the image generation.
5631#[derive(Clone, Debug, Default)]
5632#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5633pub struct ImagesResponse_Usage_InputTokensDetails {
5634    /// The number of text tokens in the input prompt.
5635    pub r#text_tokens: i64,
5636
5637    /// The number of image tokens in the input prompt.
5638    pub r#image_tokens: i64,
5639}
5640
5641/// Specify additional output data to include in the model response.
5642#[derive(Clone, Debug)]
5643#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5644pub struct Includable(pub String);
5645
5646/// An audio input to the model.
5647#[derive(Clone, Debug, Default)]
5648#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5649pub struct InputAudio {
5650    /// The type of the input item.
5651    pub r#type: String,
5652
5653    /// Base64-encoded audio data.
5654    pub r#data: String,
5655
5656    /// The format of the audio data.
5657    pub r#format: String,
5658}
5659
5660#[derive(Clone, Debug)]
5661#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5662pub enum InputContent {
5663    InputTextContent(InputTextContent),
5664
5665    InputImageContent(InputImageContent),
5666
5667    InputFileContent(InputFileContent),
5668}
5669
5670/// A file input to the model.
5671#[derive(Clone, Debug)]
5672#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5673pub struct InputFileContent {
5674    /// The type of the input item.
5675    pub r#type: String,
5676
5677    pub r#file_id: InputFileContent_FileId,
5678
5679    /// The name of the file to be sent to the model.
5680    pub r#filename: String,
5681
5682    /// The content of the file to be sent to the model.
5683    pub r#file_data: String,
5684}
5685
5686pub type InputFileContent_FileId = Option<String>;
5687
5688/// An image input to the model.
5689#[derive(Clone, Debug)]
5690#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5691pub struct InputImageContent {
5692    /// The type of the input item.
5693    pub r#type: String,
5694
5695    pub r#image_url: InputImageContent_ImageUrl,
5696
5697    pub r#file_id: InputImageContent_FileId,
5698
5699    /// The detail level of the image to be sent to the model.
5700    pub r#detail: String,
5701}
5702
5703pub type InputImageContent_FileId = Option<String>;
5704
5705pub type InputImageContent_ImageUrl = Option<String>;
5706
5707#[derive(Clone, Debug)]
5708#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5709pub enum InputItem {
5710    EasyInputMessage(EasyInputMessage),
5711
5712    /// An item representing part of the context for the response to be
5713    /// generated by the model.
5714    Item(Item),
5715
5716    ItemReferenceParam(ItemReferenceParam),
5717}
5718
5719/// A message input to the model with a role indicating instruction following
5720/// hierarchy.
5721#[derive(Clone, Debug)]
5722#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5723pub struct InputMessage {
5724    /// The type of the message input.
5725    pub r#type: String,
5726
5727    /// The role of the message input.
5728    pub r#role: String,
5729
5730    /// The status of item.
5731    pub r#status: String,
5732
5733    pub r#content: InputMessageContentList,
5734}
5735
5736/// A list of one or many input items to the model, containing different content
5737/// types.
5738#[derive(Clone, Debug)]
5739#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5740pub struct InputMessageContentList(pub Vec<InputContent>);
5741
5742#[derive(Clone, Debug, Default)]
5743#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5744pub struct InputMessageResource(pub (/*AllOf*/));
5745
5746#[derive(Clone, Debug, Default)]
5747#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5748pub struct InputMessageResource_Variant2 {
5749    /// The unique ID of the message input.
5750    pub r#id: String,
5751}
5752
5753/// A text input to the model.
5754#[derive(Clone, Debug, Default)]
5755#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5756pub struct InputTextContent {
5757    /// The type of the input item.
5758    pub r#type: String,
5759
5760    /// The text input to the model.
5761    pub r#text: String,
5762}
5763
5764/// Represents an individual `invite` to the organization.
5765#[derive(Clone, Debug)]
5766#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5767pub struct Invite {
5768    /// The object type, which is always `organization.invite`
5769    pub r#object: String,
5770
5771    /// The identifier, which can be referenced in API endpoints
5772    pub r#id: String,
5773
5774    /// The email address of the individual to whom the invite was sent
5775    pub r#email: String,
5776
5777    /// `owner` or `reader`
5778    pub r#role: String,
5779
5780    /// `accepted`,`expired`, or `pending`
5781    pub r#status: String,
5782
5783    /// The Unix timestamp (in seconds) of when the invite was sent.
5784    pub r#invited_at: i64,
5785
5786    /// The Unix timestamp (in seconds) of when the invite expires.
5787    pub r#expires_at: i64,
5788
5789    /// The Unix timestamp (in seconds) of when the invite was accepted.
5790    pub r#accepted_at: i64,
5791
5792    /// The projects that were granted membership upon acceptance of the invite.
5793    pub r#projects: Vec<Invite_Projects>,
5794}
5795
5796#[derive(Clone, Debug, Default)]
5797#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5798pub struct InviteDeleteResponse {
5799    /// The object type, which is always `organization.invite.deleted`
5800    pub r#object: String,
5801
5802    pub r#id: String,
5803
5804    pub r#deleted: bool,
5805}
5806
5807#[derive(Clone, Debug)]
5808#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5809pub struct InviteListResponse {
5810    /// The object type, which is always `list`
5811    pub r#object: String,
5812
5813    pub r#data: Vec<Invite>,
5814
5815    /// The first `invite_id` in the retrieved `list`
5816    pub r#first_id: String,
5817
5818    /// The last `invite_id` in the retrieved `list`
5819    pub r#last_id: String,
5820
5821    /// The `has_more` property is used for pagination to indicate there are
5822    /// additional results.
5823    pub r#has_more: bool,
5824}
5825
5826#[derive(Clone, Debug)]
5827#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5828pub struct InviteRequest {
5829    /// Send an email to this address
5830    pub r#email: String,
5831
5832    /// `owner` or `reader`
5833    pub r#role: String,
5834
5835    /// An array of projects to which membership is granted at the same time the
5836    /// org invite is accepted.
5837    pub r#projects: Vec<InviteRequest_Projects>,
5838}
5839
5840#[derive(Clone, Debug, Default)]
5841#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5842pub struct InviteRequest_Projects {
5843    /// Project's public ID
5844    pub r#id: String,
5845
5846    /// Project membership role
5847    pub r#role: String,
5848}
5849
5850#[derive(Clone, Debug, Default)]
5851#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5852pub struct Invite_Projects {
5853    /// Project's public ID
5854    pub r#id: String,
5855
5856    /// Project membership role
5857    pub r#role: String,
5858}
5859
5860/// Content item used to generate a response.
5861#[derive(Clone, Debug, Default)]
5862#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5863pub struct Item;
5864
5865/// An internal identifier for an item to reference.
5866#[derive(Clone, Debug)]
5867#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5868pub struct ItemReferenceParam {
5869    pub r#type: ItemReferenceParam_Type,
5870
5871    /// The ID of the item to reference.
5872    pub r#id: String,
5873}
5874
5875pub type ItemReferenceParam_Type = Option<String>;
5876
5877/// Content item used to generate a response.
5878#[derive(Clone, Debug)]
5879#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5880pub enum ItemResource {
5881    InputMessageResource(InputMessageResource),
5882
5883    OutputMessage(OutputMessage),
5884
5885    FileSearchToolCall(FileSearchToolCall),
5886
5887    ComputerToolCall(ComputerToolCall),
5888
5889    ComputerToolCallOutputResource(ComputerToolCallOutputResource),
5890
5891    WebSearchToolCall(WebSearchToolCall),
5892
5893    FunctionToolCallResource(FunctionToolCallResource),
5894
5895    FunctionToolCallOutputResource(FunctionToolCallOutputResource),
5896}
5897
5898/// A collection of keypresses the model would like to perform.
5899#[derive(Clone, Debug)]
5900#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5901pub struct KeyPress {
5902    /// Specifies the event type.
5903    pub r#type: String,
5904
5905    /// The combination of keys the model is requesting to be pressed.
5906    pub r#keys: Vec<String>,
5907}
5908
5909#[derive(Clone, Debug)]
5910#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5911pub struct ListAssistantsResponse {
5912    pub r#object: String,
5913
5914    pub r#data: Vec<AssistantObject>,
5915
5916    pub r#first_id: String,
5917
5918    pub r#last_id: String,
5919
5920    pub r#has_more: bool,
5921}
5922
5923#[derive(Clone, Debug)]
5924#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5925pub struct ListAuditLogsResponse {
5926    pub r#object: String,
5927
5928    pub r#data: Vec<AuditLog>,
5929
5930    pub r#first_id: String,
5931
5932    pub r#last_id: String,
5933
5934    pub r#has_more: bool,
5935}
5936
5937#[derive(Clone, Debug)]
5938#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5939pub struct ListBatchesResponse {
5940    pub r#data: Vec<Batch>,
5941
5942    pub r#first_id: String,
5943
5944    pub r#last_id: String,
5945
5946    pub r#has_more: bool,
5947
5948    pub r#object: String,
5949}
5950
5951#[derive(Clone, Debug)]
5952#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5953pub struct ListCertificatesResponse {
5954    pub r#data: Vec<Certificate>,
5955
5956    pub r#first_id: String,
5957
5958    pub r#last_id: String,
5959
5960    pub r#has_more: bool,
5961
5962    pub r#object: String,
5963}
5964
5965#[derive(Clone, Debug)]
5966#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5967pub struct ListFilesResponse {
5968    pub r#object: String,
5969
5970    pub r#data: Vec<OpenAIFile>,
5971
5972    pub r#first_id: String,
5973
5974    pub r#last_id: String,
5975
5976    pub r#has_more: bool,
5977}
5978
5979#[derive(Clone, Debug)]
5980#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5981pub struct ListFineTuningCheckpointPermissionResponse {
5982    pub r#data: Vec<FineTuningCheckpointPermission>,
5983
5984    pub r#object: String,
5985
5986    pub r#first_id: Option<String>,
5987
5988    pub r#last_id: Option<String>,
5989
5990    pub r#has_more: bool,
5991}
5992
5993#[derive(Clone, Debug)]
5994#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5995pub struct ListFineTuningJobCheckpointsResponse {
5996    pub r#data: Vec<FineTuningJobCheckpoint>,
5997
5998    pub r#object: String,
5999
6000    pub r#first_id: Option<String>,
6001
6002    pub r#last_id: Option<String>,
6003
6004    pub r#has_more: bool,
6005}
6006
6007#[derive(Clone, Debug)]
6008#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6009pub struct ListFineTuningJobEventsResponse {
6010    pub r#data: Vec<FineTuningJobEvent>,
6011
6012    pub r#object: String,
6013
6014    pub r#has_more: bool,
6015}
6016
6017#[derive(Clone, Debug)]
6018#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6019pub struct ListMessagesResponse {
6020    pub r#object: String,
6021
6022    pub r#data: Vec<MessageObject>,
6023
6024    pub r#first_id: String,
6025
6026    pub r#last_id: String,
6027
6028    pub r#has_more: bool,
6029}
6030
6031#[derive(Clone, Debug)]
6032#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6033pub struct ListModelsResponse {
6034    pub r#object: String,
6035
6036    pub r#data: Vec<Model>,
6037}
6038
6039#[derive(Clone, Debug)]
6040#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6041pub struct ListPaginatedFineTuningJobsResponse {
6042    pub r#data: Vec<FineTuningJob>,
6043
6044    pub r#has_more: bool,
6045
6046    pub r#object: String,
6047}
6048
6049#[derive(Clone, Debug)]
6050#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6051pub struct ListRunStepsResponse {
6052    pub r#object: String,
6053
6054    pub r#data: Vec<RunStepObject>,
6055
6056    pub r#first_id: String,
6057
6058    pub r#last_id: String,
6059
6060    pub r#has_more: bool,
6061}
6062
6063#[derive(Clone, Debug)]
6064#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6065pub struct ListRunsResponse {
6066    pub r#object: String,
6067
6068    pub r#data: Vec<RunObject>,
6069
6070    pub r#first_id: String,
6071
6072    pub r#last_id: String,
6073
6074    pub r#has_more: bool,
6075}
6076
6077#[derive(Clone, Debug)]
6078#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6079pub struct ListVectorStoreFilesResponse {
6080    pub r#object: String,
6081
6082    pub r#data: Vec<VectorStoreFileObject>,
6083
6084    pub r#first_id: String,
6085
6086    pub r#last_id: String,
6087
6088    pub r#has_more: bool,
6089}
6090
6091#[derive(Clone, Debug)]
6092#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6093pub struct ListVectorStoresResponse {
6094    pub r#object: String,
6095
6096    pub r#data: Vec<VectorStoreObject>,
6097
6098    pub r#first_id: String,
6099
6100    pub r#last_id: String,
6101
6102    pub r#has_more: bool,
6103}
6104
6105/// A log probability object.
6106#[derive(Clone, Debug)]
6107#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6108pub struct LogProbProperties {
6109    /// The token that was used to generate the log probability.
6110    pub r#token: String,
6111
6112    /// The log probability of the token.
6113    pub r#logprob: f64,
6114
6115    /// The bytes that were used to generate the log probability.
6116    pub r#bytes: Vec<i64>,
6117}
6118
6119/// References an image [File](/docs/api-reference/files) in the content of a
6120/// message.
6121#[derive(Clone, Debug)]
6122#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6123pub struct MessageContentImageFileObject {
6124    /// Always `image_file`.
6125    pub r#type: String,
6126
6127    pub r#image_file: MessageContentImageFileObject_ImageFile,
6128}
6129
6130#[derive(Clone, Debug, Default)]
6131#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6132pub struct MessageContentImageFileObject_ImageFile {
6133    /// The [File](/docs/api-reference/files) ID of the image in the message
6134    /// content.
6135    pub r#file_id: String,
6136
6137    /// Specifies the detail level of the image if specified by the user.
6138    pub r#detail: String,
6139}
6140
6141/// References an image URL in the content of a message.
6142#[derive(Clone, Debug)]
6143#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6144pub struct MessageContentImageUrlObject {
6145    /// The type of the content part.
6146    pub r#type: String,
6147
6148    pub r#image_url: MessageContentImageUrlObject_ImageUrl,
6149}
6150
6151#[derive(Clone, Debug, Default)]
6152#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6153pub struct MessageContentImageUrlObject_ImageUrl {
6154    /// The external URL of the image, must be a supported image types: jpeg,
6155    /// jpg, png, gif, webp.
6156    pub r#url: String,
6157
6158    /// Specifies the detail level of the image.
6159    pub r#detail: String,
6160}
6161
6162/// The refusal content generated by the assistant.
6163#[derive(Clone, Debug, Default)]
6164#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6165pub struct MessageContentRefusalObject {
6166    /// Always `refusal`.
6167    pub r#type: String,
6168
6169    pub r#refusal: String,
6170}
6171
6172/// A citation within the message that points to a specific quote from a
6173/// specific File associated with the assistant or the message.
6174#[derive(Clone, Debug)]
6175#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6176pub struct MessageContentTextAnnotationsFileCitationObject {
6177    /// Always `file_citation`.
6178    pub r#type: String,
6179
6180    /// The text in the message content that needs to be replaced.
6181    pub r#text: String,
6182
6183    pub r#file_citation: MessageContentTextAnnotationsFileCitationObject_FileCitation,
6184
6185    pub r#start_index: i64,
6186
6187    pub r#end_index: i64,
6188}
6189
6190#[derive(Clone, Debug, Default)]
6191#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6192pub struct MessageContentTextAnnotationsFileCitationObject_FileCitation {
6193    /// The ID of the specific File the citation is from.
6194    pub r#file_id: String,
6195}
6196
6197/// A URL for the file that's generated when the assistant used the
6198/// `code_interpreter` tool to generate a file.
6199#[derive(Clone, Debug)]
6200#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6201pub struct MessageContentTextAnnotationsFilePathObject {
6202    /// Always `file_path`.
6203    pub r#type: String,
6204
6205    /// The text in the message content that needs to be replaced.
6206    pub r#text: String,
6207
6208    pub r#file_path: MessageContentTextAnnotationsFilePathObject_FilePath,
6209
6210    pub r#start_index: i64,
6211
6212    pub r#end_index: i64,
6213}
6214
6215#[derive(Clone, Debug, Default)]
6216#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6217pub struct MessageContentTextAnnotationsFilePathObject_FilePath {
6218    /// The ID of the file that was generated.
6219    pub r#file_id: String,
6220}
6221
6222/// The text content that is part of a message.
6223#[derive(Clone, Debug)]
6224#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6225pub struct MessageContentTextObject {
6226    /// Always `text`.
6227    pub r#type: String,
6228
6229    pub r#text: MessageContentTextObject_Text,
6230}
6231
6232#[derive(Clone, Debug)]
6233#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6234pub struct MessageContentTextObject_Text {
6235    /// The data that makes up the text.
6236    pub r#value: String,
6237
6238    pub r#annotations: Vec<MessageContentTextObject_Text_Annotations>,
6239}
6240
6241#[derive(Clone, Debug)]
6242#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6243pub enum MessageContentTextObject_Text_Annotations {
6244    MessageContentTextAnnotationsFileCitationObject(MessageContentTextAnnotationsFileCitationObject),
6245
6246    MessageContentTextAnnotationsFilePathObject(MessageContentTextAnnotationsFilePathObject),
6247}
6248
6249/// References an image [File](/docs/api-reference/files) in the content of a
6250/// message.
6251#[derive(Clone, Debug)]
6252#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6253pub struct MessageDeltaContentImageFileObject {
6254    /// The index of the content part in the message.
6255    pub r#index: i64,
6256
6257    /// Always `image_file`.
6258    pub r#type: String,
6259
6260    pub r#image_file: MessageDeltaContentImageFileObject_ImageFile,
6261}
6262
6263#[derive(Clone, Debug, Default)]
6264#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6265pub struct MessageDeltaContentImageFileObject_ImageFile {
6266    /// The [File](/docs/api-reference/files) ID of the image in the message
6267    /// content.
6268    pub r#file_id: String,
6269
6270    /// Specifies the detail level of the image if specified by the user.
6271    pub r#detail: String,
6272}
6273
6274/// References an image URL in the content of a message.
6275#[derive(Clone, Debug)]
6276#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6277pub struct MessageDeltaContentImageUrlObject {
6278    /// The index of the content part in the message.
6279    pub r#index: i64,
6280
6281    /// Always `image_url`.
6282    pub r#type: String,
6283
6284    pub r#image_url: MessageDeltaContentImageUrlObject_ImageUrl,
6285}
6286
6287#[derive(Clone, Debug, Default)]
6288#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6289pub struct MessageDeltaContentImageUrlObject_ImageUrl {
6290    /// The URL of the image, must be a supported image types: jpeg, jpg, png,
6291    /// gif, webp.
6292    pub r#url: String,
6293
6294    /// Specifies the detail level of the image.
6295    pub r#detail: String,
6296}
6297
6298/// The refusal content that is part of a message.
6299#[derive(Clone, Debug, Default)]
6300#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6301pub struct MessageDeltaContentRefusalObject {
6302    /// The index of the refusal part in the message.
6303    pub r#index: i64,
6304
6305    /// Always `refusal`.
6306    pub r#type: String,
6307
6308    pub r#refusal: String,
6309}
6310
6311/// A citation within the message that points to a specific quote from a
6312/// specific File associated with the assistant or the message.
6313#[derive(Clone, Debug)]
6314#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6315pub struct MessageDeltaContentTextAnnotationsFileCitationObject {
6316    /// The index of the annotation in the text content part.
6317    pub r#index: i64,
6318
6319    /// Always `file_citation`.
6320    pub r#type: String,
6321
6322    /// The text in the message content that needs to be replaced.
6323    pub r#text: String,
6324
6325    pub r#file_citation: MessageDeltaContentTextAnnotationsFileCitationObject_FileCitation,
6326
6327    pub r#start_index: i64,
6328
6329    pub r#end_index: i64,
6330}
6331
6332#[derive(Clone, Debug, Default)]
6333#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6334pub struct MessageDeltaContentTextAnnotationsFileCitationObject_FileCitation {
6335    /// The ID of the specific File the citation is from.
6336    pub r#file_id: String,
6337
6338    /// The specific quote in the file.
6339    pub r#quote: String,
6340}
6341
6342/// A URL for the file that's generated when the assistant used the
6343/// `code_interpreter` tool to generate a file.
6344#[derive(Clone, Debug)]
6345#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6346pub struct MessageDeltaContentTextAnnotationsFilePathObject {
6347    /// The index of the annotation in the text content part.
6348    pub r#index: i64,
6349
6350    /// Always `file_path`.
6351    pub r#type: String,
6352
6353    /// The text in the message content that needs to be replaced.
6354    pub r#text: String,
6355
6356    pub r#file_path: MessageDeltaContentTextAnnotationsFilePathObject_FilePath,
6357
6358    pub r#start_index: i64,
6359
6360    pub r#end_index: i64,
6361}
6362
6363#[derive(Clone, Debug, Default)]
6364#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6365pub struct MessageDeltaContentTextAnnotationsFilePathObject_FilePath {
6366    /// The ID of the file that was generated.
6367    pub r#file_id: String,
6368}
6369
6370/// The text content that is part of a message.
6371#[derive(Clone, Debug)]
6372#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6373pub struct MessageDeltaContentTextObject {
6374    /// The index of the content part in the message.
6375    pub r#index: i64,
6376
6377    /// Always `text`.
6378    pub r#type: String,
6379
6380    pub r#text: MessageDeltaContentTextObject_Text,
6381}
6382
6383#[derive(Clone, Debug)]
6384#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6385pub struct MessageDeltaContentTextObject_Text {
6386    /// The data that makes up the text.
6387    pub r#value: String,
6388
6389    pub r#annotations: Vec<MessageDeltaContentTextObject_Text_Annotations>,
6390}
6391
6392#[derive(Clone, Debug)]
6393#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6394pub enum MessageDeltaContentTextObject_Text_Annotations {
6395    MessageDeltaContentTextAnnotationsFileCitationObject(MessageDeltaContentTextAnnotationsFileCitationObject),
6396
6397    MessageDeltaContentTextAnnotationsFilePathObject(MessageDeltaContentTextAnnotationsFilePathObject),
6398}
6399
6400/// Represents a message delta i.e.
6401#[derive(Clone, Debug)]
6402#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6403pub struct MessageDeltaObject {
6404    /// The identifier of the message, which can be referenced in API endpoints.
6405    pub r#id: String,
6406
6407    /// The object type, which is always `thread.message.delta`.
6408    pub r#object: String,
6409
6410    pub r#delta: MessageDeltaObject_Delta,
6411}
6412
6413/// The delta containing the fields that have changed on the Message.
6414#[derive(Clone, Debug)]
6415#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6416pub struct MessageDeltaObject_Delta {
6417    /// The entity that produced the message.
6418    pub r#role: String,
6419
6420    /// The content of the message in array of text and/or images.
6421    pub r#content: Vec<MessageDeltaObject_Delta_Content>,
6422}
6423
6424#[derive(Clone, Debug)]
6425#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6426pub enum MessageDeltaObject_Delta_Content {
6427    MessageDeltaContentImageFileObject(MessageDeltaContentImageFileObject),
6428
6429    MessageDeltaContentTextObject(MessageDeltaContentTextObject),
6430
6431    MessageDeltaContentRefusalObject(MessageDeltaContentRefusalObject),
6432
6433    MessageDeltaContentImageUrlObject(MessageDeltaContentImageUrlObject),
6434}
6435
6436/// Represents a message within a [thread](/docs/api-reference/threads).
6437#[derive(Clone, Debug)]
6438#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6439pub struct MessageObject {
6440    /// The identifier, which can be referenced in API endpoints.
6441    pub r#id: String,
6442
6443    /// The object type, which is always `thread.message`.
6444    pub r#object: String,
6445
6446    /// The Unix timestamp (in seconds) for when the message was created.
6447    pub r#created_at: i64,
6448
6449    /// The [thread](/docs/api-reference/threads) ID that this message belongs
6450    /// to.
6451    pub r#thread_id: String,
6452
6453    /// The status of the message, which can be either `in_progress`,
6454    /// `incomplete`, or `completed`.
6455    pub r#status: String,
6456
6457    pub r#incomplete_details: Option<MessageObject_IncompleteDetails>,
6458
6459    /// The Unix timestamp (in seconds) for when the message was completed.
6460    pub r#completed_at: Option<i64>,
6461
6462    /// The Unix timestamp (in seconds) for when the message was marked as
6463    /// incomplete.
6464    pub r#incomplete_at: Option<i64>,
6465
6466    /// The entity that produced the message.
6467    pub r#role: String,
6468
6469    /// The content of the message in array of text and/or images.
6470    pub r#content: Vec<MessageObject_Content>,
6471
6472    /// If applicable, the ID of the [assistant](/docs/api-reference/assistants)
6473    /// that authored this message.
6474    pub r#assistant_id: Option<String>,
6475
6476    /// The ID of the [run](/docs/api-reference/runs) associated with the
6477    /// creation of this message.
6478    pub r#run_id: Option<String>,
6479
6480    /// A list of files attached to the message, and the tools they were added
6481    /// to.
6482    pub r#attachments: Option<Vec<MessageObject_Attachments>>,
6483
6484    pub r#metadata: Option<Metadata>,
6485}
6486
6487#[derive(Clone, Debug)]
6488#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6489pub struct MessageObject_Attachments {
6490    /// The ID of the file to attach to the message.
6491    pub r#file_id: String,
6492
6493    /// The tools to add this file to.
6494    pub r#tools: Vec<MessageObject_Attachments_Tools>,
6495}
6496
6497#[derive(Clone, Debug)]
6498#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6499pub enum MessageObject_Attachments_Tools {
6500    AssistantToolsCode(AssistantToolsCode),
6501
6502    AssistantToolsFileSearchTypeOnly(AssistantToolsFileSearchTypeOnly),
6503}
6504
6505#[derive(Clone, Debug)]
6506#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6507pub enum MessageObject_Content {
6508    MessageContentImageFileObject(MessageContentImageFileObject),
6509
6510    MessageContentImageUrlObject(MessageContentImageUrlObject),
6511
6512    MessageContentTextObject(MessageContentTextObject),
6513
6514    MessageContentRefusalObject(MessageContentRefusalObject),
6515}
6516
6517/// On an incomplete message, details about why the message is incomplete.
6518#[derive(Clone, Debug, Default)]
6519#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6520pub struct MessageObject_IncompleteDetails {
6521    /// The reason the message is incomplete.
6522    pub r#reason: String,
6523}
6524
6525/// The text content that is part of a message.
6526#[derive(Clone, Debug, Default)]
6527#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6528pub struct MessageRequestContentTextObject {
6529    /// Always `text`.
6530    pub r#type: String,
6531
6532    /// Text content to be sent to the model
6533    pub r#text: String,
6534}
6535
6536include!("components/message_stream_event.rs");
6537
6538/// Occurs when a [message](/docs/api-reference/messages/object) is created.
6539#[derive(Clone, Debug)]
6540#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6541pub struct MessageStreamEvent_Variant1 {
6542    pub r#event: String,
6543
6544    pub r#data: MessageObject,
6545}
6546
6547/// Occurs when a [message](/docs/api-reference/messages/object) moves to an
6548/// `in_progress` state.
6549#[derive(Clone, Debug)]
6550#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6551pub struct MessageStreamEvent_Variant2 {
6552    pub r#event: String,
6553
6554    pub r#data: MessageObject,
6555}
6556
6557/// Occurs when parts of a [Message](/docs/api-reference/messages/object) are
6558/// being streamed.
6559#[derive(Clone, Debug)]
6560#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6561pub struct MessageStreamEvent_Variant3 {
6562    pub r#event: String,
6563
6564    pub r#data: MessageDeltaObject,
6565}
6566
6567/// Occurs when a [message](/docs/api-reference/messages/object) is completed.
6568#[derive(Clone, Debug)]
6569#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6570pub struct MessageStreamEvent_Variant4 {
6571    pub r#event: String,
6572
6573    pub r#data: MessageObject,
6574}
6575
6576/// Occurs when a [message](/docs/api-reference/messages/object) ends before it
6577/// is completed.
6578#[derive(Clone, Debug)]
6579#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6580pub struct MessageStreamEvent_Variant5 {
6581    pub r#event: String,
6582
6583    pub r#data: MessageObject,
6584}
6585
6586/// Set of 16 key-value pairs that can be attached to an object.
6587#[derive(Clone, Debug, Default)]
6588#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6589pub struct Metadata;
6590
6591/// Describes an OpenAI model offering that can be used with the API.
6592#[derive(Clone, Debug, Default)]
6593#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6594pub struct Model {
6595    /// The model identifier, which can be referenced in the API endpoints.
6596    pub r#id: String,
6597
6598    /// The Unix timestamp (in seconds) when the model was created.
6599    pub r#created: i64,
6600
6601    /// The object type, which is always "model".
6602    pub r#object: String,
6603
6604    /// The organization that owns the model.
6605    pub r#owned_by: String,
6606}
6607
6608#[derive(Clone, Debug)]
6609#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6610pub enum ModelIds {
6611    ModelIdsShared(ModelIdsShared),
6612
6613    ModelIdsResponses(ModelIdsResponses),
6614}
6615
6616#[derive(Clone, Debug)]
6617#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6618pub enum ModelIdsResponses {
6619    ModelIdsShared(ModelIdsShared),
6620
6621    String(String),
6622}
6623
6624pub type ModelIdsShared = String;
6625
6626#[derive(Clone, Debug)]
6627#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6628pub struct ModelResponseProperties {
6629    pub r#metadata: Option<Metadata>,
6630
6631    /// What sampling temperature to use, between 0 and 2.
6632    pub r#temperature: Option<f64>,
6633
6634    /// An alternative to sampling with temperature, called nucleus sampling,
6635    /// where the model considers the results of the tokens with top_p
6636    /// probability mass.
6637    pub r#top_p: Option<f64>,
6638
6639    /// A unique identifier representing your end-user, which can help OpenAI to
6640    /// monitor and detect abuse.
6641    pub r#user: String,
6642
6643    pub r#service_tier: Option<ServiceTier>,
6644}
6645
6646#[derive(Clone, Debug)]
6647#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6648pub struct ModifyAssistantRequest {
6649    pub r#model: ModifyAssistantRequest_Model,
6650
6651    pub r#reasoning_effort: Option<ReasoningEffort>,
6652
6653    /// The name of the assistant.
6654    pub r#name: Option<String>,
6655
6656    /// The description of the assistant.
6657    pub r#description: Option<String>,
6658
6659    /// The system instructions that the assistant uses.
6660    pub r#instructions: Option<String>,
6661
6662    /// A list of tool enabled on the assistant.
6663    pub r#tools: Vec<ModifyAssistantRequest_Tools>,
6664
6665    pub r#tool_resources: Option<ModifyAssistantRequest_ToolResources>,
6666
6667    pub r#metadata: Option<Metadata>,
6668
6669    /// What sampling temperature to use, between 0 and 2.
6670    pub r#temperature: Option<f64>,
6671
6672    /// An alternative to sampling with temperature, called nucleus sampling,
6673    /// where the model considers the results of the tokens with top_p
6674    /// probability mass.
6675    pub r#top_p: Option<f64>,
6676
6677    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
6678}
6679
6680/// ID of the model to use.
6681#[derive(Clone, Debug)]
6682#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6683pub enum ModifyAssistantRequest_Model {
6684    String(String),
6685
6686    AssistantSupportedModels(AssistantSupportedModels),
6687}
6688
6689/// A set of resources that are used by the assistant's tools.
6690#[derive(Clone, Debug)]
6691#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6692pub struct ModifyAssistantRequest_ToolResources {
6693    pub r#code_interpreter: ModifyAssistantRequest_ToolResources_CodeInterpreter,
6694
6695    pub r#file_search: ModifyAssistantRequest_ToolResources_FileSearch,
6696}
6697
6698#[derive(Clone, Debug)]
6699#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6700pub struct ModifyAssistantRequest_ToolResources_CodeInterpreter {
6701    /// Overrides the list of [file](/docs/api-reference/files) IDs made
6702    /// available to the `code_interpreter` tool.
6703    pub r#file_ids: Vec<String>,
6704}
6705
6706#[derive(Clone, Debug)]
6707#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6708pub struct ModifyAssistantRequest_ToolResources_FileSearch {
6709    /// Overrides the [vector store](/docs/api-reference/vector-stores/object)
6710    /// attached to this assistant.
6711    pub r#vector_store_ids: Vec<String>,
6712}
6713
6714#[derive(Clone, Debug)]
6715#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6716pub enum ModifyAssistantRequest_Tools {
6717    AssistantToolsCode(AssistantToolsCode),
6718
6719    AssistantToolsFileSearch(AssistantToolsFileSearch),
6720
6721    AssistantToolsFunction(AssistantToolsFunction),
6722}
6723
6724#[derive(Clone, Debug, Default)]
6725#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6726pub struct ModifyCertificateRequest {
6727    /// The updated name for the certificate
6728    pub r#name: String,
6729}
6730
6731#[derive(Clone, Debug)]
6732#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6733pub struct ModifyMessageRequest {
6734    pub r#metadata: Option<Metadata>,
6735}
6736
6737#[derive(Clone, Debug)]
6738#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6739pub struct ModifyRunRequest {
6740    pub r#metadata: Option<Metadata>,
6741}
6742
6743#[derive(Clone, Debug)]
6744#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6745pub struct ModifyThreadRequest {
6746    pub r#tool_resources: Option<ModifyThreadRequest_ToolResources>,
6747
6748    pub r#metadata: Option<Metadata>,
6749}
6750
6751/// A set of resources that are made available to the assistant's tools in this
6752/// thread.
6753#[derive(Clone, Debug)]
6754#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6755pub struct ModifyThreadRequest_ToolResources {
6756    pub r#code_interpreter: ModifyThreadRequest_ToolResources_CodeInterpreter,
6757
6758    pub r#file_search: ModifyThreadRequest_ToolResources_FileSearch,
6759}
6760
6761#[derive(Clone, Debug)]
6762#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6763pub struct ModifyThreadRequest_ToolResources_CodeInterpreter {
6764    /// A list of [file](/docs/api-reference/files) IDs made available to the
6765    /// `code_interpreter` tool.
6766    pub r#file_ids: Vec<String>,
6767}
6768
6769#[derive(Clone, Debug)]
6770#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6771pub struct ModifyThreadRequest_ToolResources_FileSearch {
6772    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
6773    /// this thread.
6774    pub r#vector_store_ids: Vec<String>,
6775}
6776
6777/// A mouse move action.
6778#[derive(Clone, Debug, Default)]
6779#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6780pub struct Move {
6781    /// Specifies the event type.
6782    pub r#type: String,
6783
6784    /// The x-coordinate to move to.
6785    pub r#x: i64,
6786
6787    /// The y-coordinate to move to.
6788    pub r#y: i64,
6789}
6790
6791/// The `File` object represents a document that has been uploaded to OpenAI.
6792#[derive(Clone, Debug, Default)]
6793#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6794pub struct OpenAIFile {
6795    /// The file identifier, which can be referenced in the API endpoints.
6796    pub r#id: String,
6797
6798    /// The size of the file, in bytes.
6799    pub r#bytes: i64,
6800
6801    /// The Unix timestamp (in seconds) for when the file was created.
6802    pub r#created_at: i64,
6803
6804    /// The Unix timestamp (in seconds) for when the file will expire.
6805    pub r#expires_at: i64,
6806
6807    /// The name of the file.
6808    pub r#filename: String,
6809
6810    /// The object type, which is always `file`.
6811    pub r#object: String,
6812
6813    /// The intended purpose of the file.
6814    pub r#purpose: String,
6815
6816    /// Deprecated.
6817    pub r#status: String,
6818
6819    /// Deprecated.
6820    pub r#status_details: String,
6821}
6822
6823/// This is returned when the chunking strategy is unknown.
6824#[derive(Clone, Debug, Default)]
6825#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6826pub struct OtherChunkingStrategyResponseParam {
6827    /// Always `other`.
6828    pub r#type: String,
6829}
6830
6831/// An audio output from the model.
6832#[derive(Clone, Debug, Default)]
6833#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6834pub struct OutputAudio {
6835    /// The type of the output audio.
6836    pub r#type: String,
6837
6838    /// Base64-encoded audio data from the model.
6839    pub r#data: String,
6840
6841    /// The transcript of the audio data from the model.
6842    pub r#transcript: String,
6843}
6844
6845#[derive(Clone, Debug)]
6846#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6847pub enum OutputContent {
6848    OutputTextContent(OutputTextContent),
6849
6850    RefusalContent(RefusalContent),
6851}
6852
6853#[derive(Clone, Debug)]
6854#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6855pub enum OutputItem {
6856    OutputMessage(OutputMessage),
6857
6858    FileSearchToolCall(FileSearchToolCall),
6859
6860    FunctionToolCall(FunctionToolCall),
6861
6862    WebSearchToolCall(WebSearchToolCall),
6863
6864    ComputerToolCall(ComputerToolCall),
6865
6866    ReasoningItem(ReasoningItem),
6867}
6868
6869/// An output message from the model.
6870#[derive(Clone, Debug)]
6871#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6872pub struct OutputMessage {
6873    /// The unique ID of the output message.
6874    pub r#id: String,
6875
6876    /// The type of the output message.
6877    pub r#type: String,
6878
6879    /// The role of the output message.
6880    pub r#role: String,
6881
6882    /// The content of the output message.
6883    pub r#content: Vec<OutputContent>,
6884
6885    /// The status of the message input.
6886    pub r#status: String,
6887}
6888
6889/// A text output from the model.
6890#[derive(Clone, Debug)]
6891#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6892pub struct OutputTextContent {
6893    /// The type of the output text.
6894    pub r#type: String,
6895
6896    /// The text output from the model.
6897    pub r#text: String,
6898
6899    /// The annotations of the text output.
6900    pub r#annotations: Vec<Annotation>,
6901}
6902
6903/// Whether to enable [parallel function
6904/// calling](/docs/guides/function-calling#configuring-parallel-function-calling)
6905/// during tool use.
6906#[derive(Clone, Debug)]
6907#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6908pub struct ParallelToolCalls(pub bool);
6909
6910/// Static predicted output content, such as the content of a text file that is
6911/// being regenerated.
6912#[derive(Clone, Debug)]
6913#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6914pub struct PredictionContent {
6915    /// The type of the predicted content you want to provide.
6916    pub r#type: String,
6917
6918    pub r#content: PredictionContent_Content,
6919}
6920
6921/// The content that should be matched when generating a model response.
6922#[derive(Clone, Debug)]
6923#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6924pub enum PredictionContent_Content {
6925    /// The content used for a Predicted Output.
6926    String(String),
6927
6928    /// An array of content parts with a defined type.
6929    Array(Vec<ChatCompletionRequestMessageContentPartText>),
6930}
6931
6932/// Represents an individual project.
6933#[derive(Clone, Debug, Default)]
6934#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6935pub struct Project {
6936    /// The identifier, which can be referenced in API endpoints
6937    pub r#id: String,
6938
6939    /// The object type, which is always `organization.project`
6940    pub r#object: String,
6941
6942    /// The name of the project.
6943    pub r#name: String,
6944
6945    /// The Unix timestamp (in seconds) of when the project was created.
6946    pub r#created_at: i64,
6947
6948    /// The Unix timestamp (in seconds) of when the project was archived or
6949    /// `null`.
6950    pub r#archived_at: Option<i64>,
6951
6952    /// `active` or `archived`
6953    pub r#status: String,
6954}
6955
6956/// Represents an individual API key in a project.
6957#[derive(Clone, Debug)]
6958#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6959pub struct ProjectApiKey {
6960    /// The object type, which is always `organization.project.api_key`
6961    pub r#object: String,
6962
6963    /// The redacted value of the API key
6964    pub r#redacted_value: String,
6965
6966    /// The name of the API key
6967    pub r#name: String,
6968
6969    /// The Unix timestamp (in seconds) of when the API key was created
6970    pub r#created_at: i64,
6971
6972    /// The Unix timestamp (in seconds) of when the API key was last used.
6973    pub r#last_used_at: i64,
6974
6975    /// The identifier, which can be referenced in API endpoints
6976    pub r#id: String,
6977
6978    pub r#owner: ProjectApiKey_Owner,
6979}
6980
6981#[derive(Clone, Debug, Default)]
6982#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6983pub struct ProjectApiKeyDeleteResponse {
6984    pub r#object: String,
6985
6986    pub r#id: String,
6987
6988    pub r#deleted: bool,
6989}
6990
6991#[derive(Clone, Debug)]
6992#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6993pub struct ProjectApiKeyListResponse {
6994    pub r#object: String,
6995
6996    pub r#data: Vec<ProjectApiKey>,
6997
6998    pub r#first_id: String,
6999
7000    pub r#last_id: String,
7001
7002    pub r#has_more: bool,
7003}
7004
7005#[derive(Clone, Debug)]
7006#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7007pub struct ProjectApiKey_Owner {
7008    /// `user` or `service_account`
7009    pub r#type: String,
7010
7011    pub r#user: ProjectUser,
7012
7013    pub r#service_account: ProjectServiceAccount,
7014}
7015
7016#[derive(Clone, Debug, Default)]
7017#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7018pub struct ProjectCreateRequest {
7019    /// The friendly name of the project, this name appears in reports.
7020    pub r#name: String,
7021}
7022
7023#[derive(Clone, Debug)]
7024#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7025pub struct ProjectListResponse {
7026    pub r#object: String,
7027
7028    pub r#data: Vec<Project>,
7029
7030    pub r#first_id: String,
7031
7032    pub r#last_id: String,
7033
7034    pub r#has_more: bool,
7035}
7036
7037/// Represents a project rate limit config.
7038#[derive(Clone, Debug, Default)]
7039#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7040pub struct ProjectRateLimit {
7041    /// The object type, which is always `project.rate_limit`
7042    pub r#object: String,
7043
7044    /// The identifier, which can be referenced in API endpoints.
7045    pub r#id: String,
7046
7047    /// The model this rate limit applies to.
7048    pub r#model: String,
7049
7050    /// The maximum requests per minute.
7051    pub r#max_requests_per_1_minute: i64,
7052
7053    /// The maximum tokens per minute.
7054    pub r#max_tokens_per_1_minute: i64,
7055
7056    /// The maximum images per minute.
7057    pub r#max_images_per_1_minute: i64,
7058
7059    /// The maximum audio megabytes per minute.
7060    pub r#max_audio_megabytes_per_1_minute: i64,
7061
7062    /// The maximum requests per day.
7063    pub r#max_requests_per_1_day: i64,
7064
7065    /// The maximum batch input tokens per day.
7066    pub r#batch_1_day_max_input_tokens: i64,
7067}
7068
7069#[derive(Clone, Debug)]
7070#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7071pub struct ProjectRateLimitListResponse {
7072    pub r#object: String,
7073
7074    pub r#data: Vec<ProjectRateLimit>,
7075
7076    pub r#first_id: String,
7077
7078    pub r#last_id: String,
7079
7080    pub r#has_more: bool,
7081}
7082
7083#[derive(Clone, Debug, Default)]
7084#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7085pub struct ProjectRateLimitUpdateRequest {
7086    /// The maximum requests per minute.
7087    pub r#max_requests_per_1_minute: i64,
7088
7089    /// The maximum tokens per minute.
7090    pub r#max_tokens_per_1_minute: i64,
7091
7092    /// The maximum images per minute.
7093    pub r#max_images_per_1_minute: i64,
7094
7095    /// The maximum audio megabytes per minute.
7096    pub r#max_audio_megabytes_per_1_minute: i64,
7097
7098    /// The maximum requests per day.
7099    pub r#max_requests_per_1_day: i64,
7100
7101    /// The maximum batch input tokens per day.
7102    pub r#batch_1_day_max_input_tokens: i64,
7103}
7104
7105/// Represents an individual service account in a project.
7106#[derive(Clone, Debug, Default)]
7107#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7108pub struct ProjectServiceAccount {
7109    /// The object type, which is always `organization.project.service_account`
7110    pub r#object: String,
7111
7112    /// The identifier, which can be referenced in API endpoints
7113    pub r#id: String,
7114
7115    /// The name of the service account
7116    pub r#name: String,
7117
7118    /// `owner` or `member`
7119    pub r#role: String,
7120
7121    /// The Unix timestamp (in seconds) of when the service account was created
7122    pub r#created_at: i64,
7123}
7124
7125#[derive(Clone, Debug, Default)]
7126#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7127pub struct ProjectServiceAccountApiKey {
7128    /// The object type, which is always
7129    /// `organization.project.service_account.api_key`
7130    pub r#object: String,
7131
7132    pub r#value: String,
7133
7134    pub r#name: String,
7135
7136    pub r#created_at: i64,
7137
7138    pub r#id: String,
7139}
7140
7141#[derive(Clone, Debug, Default)]
7142#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7143pub struct ProjectServiceAccountCreateRequest {
7144    /// The name of the service account being created.
7145    pub r#name: String,
7146}
7147
7148#[derive(Clone, Debug)]
7149#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7150pub struct ProjectServiceAccountCreateResponse {
7151    pub r#object: String,
7152
7153    pub r#id: String,
7154
7155    pub r#name: String,
7156
7157    /// Service accounts can only have one role of type `member`
7158    pub r#role: String,
7159
7160    pub r#created_at: i64,
7161
7162    pub r#api_key: ProjectServiceAccountApiKey,
7163}
7164
7165#[derive(Clone, Debug, Default)]
7166#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7167pub struct ProjectServiceAccountDeleteResponse {
7168    pub r#object: String,
7169
7170    pub r#id: String,
7171
7172    pub r#deleted: bool,
7173}
7174
7175#[derive(Clone, Debug)]
7176#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7177pub struct ProjectServiceAccountListResponse {
7178    pub r#object: String,
7179
7180    pub r#data: Vec<ProjectServiceAccount>,
7181
7182    pub r#first_id: String,
7183
7184    pub r#last_id: String,
7185
7186    pub r#has_more: bool,
7187}
7188
7189#[derive(Clone, Debug, Default)]
7190#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7191pub struct ProjectUpdateRequest {
7192    /// The updated name of the project, this name appears in reports.
7193    pub r#name: String,
7194}
7195
7196/// Represents an individual user in a project.
7197#[derive(Clone, Debug, Default)]
7198#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7199pub struct ProjectUser {
7200    /// The object type, which is always `organization.project.user`
7201    pub r#object: String,
7202
7203    /// The identifier, which can be referenced in API endpoints
7204    pub r#id: String,
7205
7206    /// The name of the user
7207    pub r#name: String,
7208
7209    /// The email address of the user
7210    pub r#email: String,
7211
7212    /// `owner` or `member`
7213    pub r#role: String,
7214
7215    /// The Unix timestamp (in seconds) of when the project was added.
7216    pub r#added_at: i64,
7217}
7218
7219#[derive(Clone, Debug, Default)]
7220#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7221pub struct ProjectUserCreateRequest {
7222    /// The ID of the user.
7223    pub r#user_id: String,
7224
7225    /// `owner` or `member`
7226    pub r#role: String,
7227}
7228
7229#[derive(Clone, Debug, Default)]
7230#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7231pub struct ProjectUserDeleteResponse {
7232    pub r#object: String,
7233
7234    pub r#id: String,
7235
7236    pub r#deleted: bool,
7237}
7238
7239#[derive(Clone, Debug)]
7240#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7241pub struct ProjectUserListResponse {
7242    pub r#object: String,
7243
7244    pub r#data: Vec<ProjectUser>,
7245
7246    pub r#first_id: String,
7247
7248    pub r#last_id: String,
7249
7250    pub r#has_more: bool,
7251}
7252
7253#[derive(Clone, Debug, Default)]
7254#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7255pub struct ProjectUserUpdateRequest {
7256    /// `owner` or `member`
7257    pub r#role: String,
7258}
7259
7260#[derive(Clone, Debug, Default)]
7261#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7262pub struct RankingOptions {
7263    /// The ranker to use for the file search.
7264    pub r#ranker: String,
7265
7266    /// The score threshold for the file search, a number between 0 and 1.
7267    pub r#score_threshold: f64,
7268}
7269
7270/// A realtime client event.
7271#[derive(Clone, Debug)]
7272#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7273pub enum RealtimeClientEvent {
7274    RealtimeClientEventConversationItemCreate(RealtimeClientEventConversationItemCreate),
7275
7276    RealtimeClientEventConversationItemDelete(RealtimeClientEventConversationItemDelete),
7277
7278    RealtimeClientEventConversationItemRetrieve(RealtimeClientEventConversationItemRetrieve),
7279
7280    RealtimeClientEventConversationItemTruncate(RealtimeClientEventConversationItemTruncate),
7281
7282    RealtimeClientEventInputAudioBufferAppend(RealtimeClientEventInputAudioBufferAppend),
7283
7284    RealtimeClientEventInputAudioBufferClear(RealtimeClientEventInputAudioBufferClear),
7285
7286    RealtimeClientEventOutputAudioBufferClear(RealtimeClientEventOutputAudioBufferClear),
7287
7288    RealtimeClientEventInputAudioBufferCommit(RealtimeClientEventInputAudioBufferCommit),
7289
7290    RealtimeClientEventResponseCancel(RealtimeClientEventResponseCancel),
7291
7292    RealtimeClientEventResponseCreate(RealtimeClientEventResponseCreate),
7293
7294    RealtimeClientEventSessionUpdate(RealtimeClientEventSessionUpdate),
7295
7296    RealtimeClientEventTranscriptionSessionUpdate(RealtimeClientEventTranscriptionSessionUpdate),
7297}
7298
7299/// Add a new Item to the Conversation's context, including messages, function
7300/// calls, and function call responses.
7301#[derive(Clone, Debug)]
7302#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7303pub struct RealtimeClientEventConversationItemCreate {
7304    /// Optional client-generated ID used to identify this event.
7305    pub r#event_id: String,
7306
7307    /// The event type, must be `conversation.item.create`.
7308    pub r#type: String,
7309
7310    /// The ID of the preceding item after which the new item will be inserted.
7311    pub r#previous_item_id: String,
7312
7313    pub r#item: RealtimeConversationItem,
7314}
7315
7316/// Send this event when you want to remove any item from the conversation
7317/// history.
7318#[derive(Clone, Debug, Default)]
7319#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7320pub struct RealtimeClientEventConversationItemDelete {
7321    /// Optional client-generated ID used to identify this event.
7322    pub r#event_id: String,
7323
7324    /// The event type, must be `conversation.item.delete`.
7325    pub r#type: String,
7326
7327    /// The ID of the item to delete.
7328    pub r#item_id: String,
7329}
7330
7331/// Send this event when you want to retrieve the server's representation of a
7332/// specific item in the conversation history.
7333#[derive(Clone, Debug, Default)]
7334#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7335pub struct RealtimeClientEventConversationItemRetrieve {
7336    /// Optional client-generated ID used to identify this event.
7337    pub r#event_id: String,
7338
7339    /// The event type, must be `conversation.item.retrieve`.
7340    pub r#type: String,
7341
7342    /// The ID of the item to retrieve.
7343    pub r#item_id: String,
7344}
7345
7346/// Send this event to truncate a previous assistant message’s audio.
7347#[derive(Clone, Debug, Default)]
7348#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7349pub struct RealtimeClientEventConversationItemTruncate {
7350    /// Optional client-generated ID used to identify this event.
7351    pub r#event_id: String,
7352
7353    /// The event type, must be `conversation.item.truncate`.
7354    pub r#type: String,
7355
7356    /// The ID of the assistant message item to truncate.
7357    pub r#item_id: String,
7358
7359    /// The index of the content part to truncate.
7360    pub r#content_index: i64,
7361
7362    /// Inclusive duration up to which audio is truncated, in milliseconds.
7363    pub r#audio_end_ms: i64,
7364}
7365
7366/// Send this event to append audio bytes to the input audio buffer.
7367#[derive(Clone, Debug, Default)]
7368#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7369pub struct RealtimeClientEventInputAudioBufferAppend {
7370    /// Optional client-generated ID used to identify this event.
7371    pub r#event_id: String,
7372
7373    /// The event type, must be `input_audio_buffer.append`.
7374    pub r#type: String,
7375
7376    /// Base64-encoded audio bytes.
7377    pub r#audio: String,
7378}
7379
7380/// Send this event to clear the audio bytes in the buffer.
7381#[derive(Clone, Debug, Default)]
7382#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7383pub struct RealtimeClientEventInputAudioBufferClear {
7384    /// Optional client-generated ID used to identify this event.
7385    pub r#event_id: String,
7386
7387    /// The event type, must be `input_audio_buffer.clear`.
7388    pub r#type: String,
7389}
7390
7391/// Send this event to commit the user input audio buffer, which will create a
7392/// new user message item in the conversation.
7393#[derive(Clone, Debug, Default)]
7394#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7395pub struct RealtimeClientEventInputAudioBufferCommit {
7396    /// Optional client-generated ID used to identify this event.
7397    pub r#event_id: String,
7398
7399    /// The event type, must be `input_audio_buffer.commit`.
7400    pub r#type: String,
7401}
7402
7403/// **WebRTC Only:** Emit to cut off the current audio response.
7404#[derive(Clone, Debug, Default)]
7405#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7406pub struct RealtimeClientEventOutputAudioBufferClear {
7407    /// The unique ID of the client event used for error handling.
7408    pub r#event_id: String,
7409
7410    /// The event type, must be `output_audio_buffer.clear`.
7411    pub r#type: String,
7412}
7413
7414/// Send this event to cancel an in-progress response.
7415#[derive(Clone, Debug, Default)]
7416#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7417pub struct RealtimeClientEventResponseCancel {
7418    /// Optional client-generated ID used to identify this event.
7419    pub r#event_id: String,
7420
7421    /// The event type, must be `response.cancel`.
7422    pub r#type: String,
7423
7424    /// A specific response ID to cancel - if not provided, will cancel an
7425    /// in-progress response in the default conversation.
7426    pub r#response_id: String,
7427}
7428
7429/// This event instructs the server to create a Response, which means triggering
7430/// model inference.
7431#[derive(Clone, Debug)]
7432#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7433pub struct RealtimeClientEventResponseCreate {
7434    /// Optional client-generated ID used to identify this event.
7435    pub r#event_id: String,
7436
7437    /// The event type, must be `response.create`.
7438    pub r#type: String,
7439
7440    pub r#response: RealtimeResponseCreateParams,
7441}
7442
7443/// Send this event to update the session’s default configuration.
7444#[derive(Clone, Debug)]
7445#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7446pub struct RealtimeClientEventSessionUpdate {
7447    /// Optional client-generated ID used to identify this event.
7448    pub r#event_id: String,
7449
7450    /// The event type, must be `session.update`.
7451    pub r#type: String,
7452
7453    pub r#session: RealtimeSessionCreateRequest,
7454}
7455
7456/// Send this event to update a transcription session.
7457#[derive(Clone, Debug)]
7458#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7459pub struct RealtimeClientEventTranscriptionSessionUpdate {
7460    /// Optional client-generated ID used to identify this event.
7461    pub r#event_id: String,
7462
7463    /// The event type, must be `transcription_session.update`.
7464    pub r#type: String,
7465
7466    pub r#session: RealtimeTranscriptionSessionCreateRequest,
7467}
7468
7469/// The item to add to the conversation.
7470#[derive(Clone, Debug)]
7471#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7472pub struct RealtimeConversationItem {
7473    /// The unique ID of the item, this can be generated by the client to help
7474    /// manage server-side context, but is not required because the server will
7475    /// generate one if not provided.
7476    pub r#id: String,
7477
7478    /// The type of the item (`message`, `function_call`,
7479    /// `function_call_output`).
7480    pub r#type: String,
7481
7482    /// Identifier for the API object being returned - always `realtime.item`.
7483    pub r#object: String,
7484
7485    /// The status of the item (`completed`, `incomplete`).
7486    pub r#status: String,
7487
7488    /// The role of the message sender (`user`, `assistant`, `system`), only
7489    /// applicable for `message` items.
7490    pub r#role: String,
7491
7492    /// The content of the message, applicable for `message` items.
7493    pub r#content: Vec<RealtimeConversationItem_Content>,
7494
7495    /// The ID of the function call (for `function_call` and
7496    /// `function_call_output` items).
7497    pub r#call_id: String,
7498
7499    /// The name of the function being called (for `function_call` items).
7500    pub r#name: String,
7501
7502    /// The arguments of the function call (for `function_call` items).
7503    pub r#arguments: String,
7504
7505    /// The output of the function call (for `function_call_output` items).
7506    pub r#output: String,
7507}
7508
7509/// The item to add to the conversation.
7510#[derive(Clone, Debug)]
7511#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7512pub struct RealtimeConversationItemWithReference {
7513    /// For an item of type (`message` | `function_call` |
7514    /// `function_call_output`) this field allows the client to assign the
7515    /// unique ID of the item.
7516    pub r#id: String,
7517
7518    /// The type of the item (`message`, `function_call`,
7519    /// `function_call_output`, `item_reference`).
7520    pub r#type: String,
7521
7522    /// Identifier for the API object being returned - always `realtime.item`.
7523    pub r#object: String,
7524
7525    /// The status of the item (`completed`, `incomplete`).
7526    pub r#status: String,
7527
7528    /// The role of the message sender (`user`, `assistant`, `system`), only
7529    /// applicable for `message` items.
7530    pub r#role: String,
7531
7532    /// The content of the message, applicable for `message` items.
7533    pub r#content: Vec<RealtimeConversationItemWithReference_Content>,
7534
7535    /// The ID of the function call (for `function_call` and
7536    /// `function_call_output` items).
7537    pub r#call_id: String,
7538
7539    /// The name of the function being called (for `function_call` items).
7540    pub r#name: String,
7541
7542    /// The arguments of the function call (for `function_call` items).
7543    pub r#arguments: String,
7544
7545    /// The output of the function call (for `function_call_output` items).
7546    pub r#output: String,
7547}
7548
7549#[derive(Clone, Debug, Default)]
7550#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7551pub struct RealtimeConversationItemWithReference_Content {
7552    /// The content type (`input_text`, `input_audio`, `item_reference`,
7553    /// `text`).
7554    pub r#type: String,
7555
7556    /// The text content, used for `input_text` and `text` content types.
7557    pub r#text: String,
7558
7559    /// ID of a previous conversation item to reference (for `item_reference`
7560    /// content types in `response.create` events).
7561    pub r#id: String,
7562
7563    /// Base64-encoded audio bytes, used for `input_audio` content type.
7564    pub r#audio: String,
7565
7566    /// The transcript of the audio, used for `input_audio` content type.
7567    pub r#transcript: String,
7568}
7569
7570#[derive(Clone, Debug, Default)]
7571#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7572pub struct RealtimeConversationItem_Content {
7573    /// The content type (`input_text`, `input_audio`, `item_reference`,
7574    /// `text`).
7575    pub r#type: String,
7576
7577    /// The text content, used for `input_text` and `text` content types.
7578    pub r#text: String,
7579
7580    /// ID of a previous conversation item to reference (for `item_reference`
7581    /// content types in `response.create` events).
7582    pub r#id: String,
7583
7584    /// Base64-encoded audio bytes, used for `input_audio` content type.
7585    pub r#audio: String,
7586
7587    /// The transcript of the audio, used for `input_audio` content type.
7588    pub r#transcript: String,
7589}
7590
7591/// The response resource.
7592#[derive(Clone, Debug)]
7593#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7594pub struct RealtimeResponse {
7595    /// The unique ID of the response.
7596    pub r#id: String,
7597
7598    /// The object type, must be `realtime.response`.
7599    pub r#object: String,
7600
7601    /// The final status of the response (`completed`, `cancelled`, `failed`, or
7602    /// `incomplete`).
7603    pub r#status: String,
7604
7605    pub r#status_details: RealtimeResponse_StatusDetails,
7606
7607    /// The list of output items generated by the response.
7608    pub r#output: Vec<RealtimeConversationItem>,
7609
7610    pub r#metadata: Option<Metadata>,
7611
7612    pub r#usage: RealtimeResponse_Usage,
7613
7614    /// Which conversation the response is added to, determined by the
7615    /// `conversation` field in the `response.create` event.
7616    pub r#conversation_id: String,
7617
7618    /// The voice the model used to respond.
7619    pub r#voice: VoiceIdsShared,
7620
7621    /// The set of modalities the model used to respond.
7622    pub r#modalities: Vec<String>,
7623
7624    /// The format of output audio.
7625    pub r#output_audio_format: String,
7626
7627    /// Sampling temperature for the model, limited to [0.6, 1.2].
7628    pub r#temperature: f64,
7629
7630    pub r#max_output_tokens: RealtimeResponse_MaxOutputTokens,
7631}
7632
7633/// Create a new Realtime response with these parameters
7634#[derive(Clone, Debug)]
7635#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7636pub struct RealtimeResponseCreateParams {
7637    /// The set of modalities the model can respond with.
7638    pub r#modalities: Vec<String>,
7639
7640    /// The default system instructions (i.e.
7641    pub r#instructions: String,
7642
7643    /// The voice the model uses to respond.
7644    pub r#voice: VoiceIdsShared,
7645
7646    /// The format of output audio.
7647    pub r#output_audio_format: String,
7648
7649    /// Tools (functions) available to the model.
7650    pub r#tools: Vec<RealtimeResponseCreateParams_Tools>,
7651
7652    /// How the model chooses tools.
7653    pub r#tool_choice: String,
7654
7655    /// Sampling temperature for the model, limited to [0.6, 1.2].
7656    pub r#temperature: f64,
7657
7658    pub r#max_response_output_tokens: RealtimeResponseCreateParams_MaxResponseOutputTokens,
7659
7660    pub r#conversation: RealtimeResponseCreateParams_Conversation,
7661
7662    pub r#metadata: Option<Metadata>,
7663
7664    /// Input items to include in the prompt for the model.
7665    pub r#input: Vec<RealtimeConversationItemWithReference>,
7666}
7667
7668/// Controls which conversation the response is added to.
7669pub type RealtimeResponseCreateParams_Conversation = String;
7670
7671/// Maximum number of output tokens for a single assistant response, inclusive
7672/// of tool calls.
7673#[derive(Clone, Debug)]
7674#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7675pub enum RealtimeResponseCreateParams_MaxResponseOutputTokens {
7676    Integer(i64),
7677
7678    String(String),
7679}
7680
7681#[derive(Clone, Debug)]
7682#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7683pub struct RealtimeResponseCreateParams_Tools {
7684    /// The type of the tool, i.e.
7685    pub r#type: String,
7686
7687    /// The name of the function.
7688    pub r#name: String,
7689
7690    /// The description of the function, including guidance on when and how to
7691    /// call it, and guidance about what to tell the user when calling (if
7692    /// anything).
7693    pub r#description: String,
7694
7695    /// Parameters of the function in JSON Schema.
7696    pub r#parameters: RealtimeResponseCreateParams_Tools_Parameters,
7697}
7698
7699/// Parameters of the function in JSON Schema.
7700#[derive(Clone, Debug, Default)]
7701#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7702pub struct RealtimeResponseCreateParams_Tools_Parameters;
7703
7704/// Maximum number of output tokens for a single assistant response, inclusive
7705/// of tool calls, that was used in this response.
7706#[derive(Clone, Debug)]
7707#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7708pub enum RealtimeResponse_MaxOutputTokens {
7709    Integer(i64),
7710
7711    String(String),
7712}
7713
7714/// Additional details about the status.
7715#[derive(Clone, Debug)]
7716#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7717pub struct RealtimeResponse_StatusDetails {
7718    /// The type of error that caused the response to fail, corresponding with
7719    /// the `status` field (`completed`, `cancelled`, `incomplete`, `failed`).
7720    pub r#type: String,
7721
7722    /// The reason the Response did not complete.
7723    pub r#reason: String,
7724
7725    pub r#error: RealtimeResponse_StatusDetails_Error,
7726}
7727
7728/// A description of the error that caused the response to fail, populated when
7729/// the `status` is `failed`.
7730#[derive(Clone, Debug, Default)]
7731#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7732pub struct RealtimeResponse_StatusDetails_Error {
7733    /// The type of error.
7734    pub r#type: String,
7735
7736    /// Error code, if any.
7737    pub r#code: String,
7738}
7739
7740/// Usage statistics for the Response, this will correspond to billing.
7741#[derive(Clone, Debug)]
7742#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7743pub struct RealtimeResponse_Usage {
7744    /// The total number of tokens in the Response including input and output
7745    /// text and audio tokens.
7746    pub r#total_tokens: i64,
7747
7748    /// The number of input tokens used in the Response, including text and
7749    /// audio tokens.
7750    pub r#input_tokens: i64,
7751
7752    /// The number of output tokens sent in the Response, including text and
7753    /// audio tokens.
7754    pub r#output_tokens: i64,
7755
7756    pub r#input_token_details: RealtimeResponse_Usage_InputTokenDetails,
7757
7758    pub r#output_token_details: RealtimeResponse_Usage_OutputTokenDetails,
7759}
7760
7761/// Details about the input tokens used in the Response.
7762#[derive(Clone, Debug, Default)]
7763#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7764pub struct RealtimeResponse_Usage_InputTokenDetails {
7765    /// The number of cached tokens used in the Response.
7766    pub r#cached_tokens: i64,
7767
7768    /// The number of text tokens used in the Response.
7769    pub r#text_tokens: i64,
7770
7771    /// The number of audio tokens used in the Response.
7772    pub r#audio_tokens: i64,
7773}
7774
7775/// Details about the output tokens used in the Response.
7776#[derive(Clone, Debug, Default)]
7777#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7778pub struct RealtimeResponse_Usage_OutputTokenDetails {
7779    /// The number of text tokens used in the Response.
7780    pub r#text_tokens: i64,
7781
7782    /// The number of audio tokens used in the Response.
7783    pub r#audio_tokens: i64,
7784}
7785
7786/// A realtime server event.
7787#[derive(Clone, Debug)]
7788#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7789pub enum RealtimeServerEvent {
7790    RealtimeServerEventConversationCreated(RealtimeServerEventConversationCreated),
7791
7792    RealtimeServerEventConversationItemCreated(RealtimeServerEventConversationItemCreated),
7793
7794    RealtimeServerEventConversationItemDeleted(RealtimeServerEventConversationItemDeleted),
7795
7796    RealtimeServerEventConversationItemInputAudioTranscriptionCompleted(RealtimeServerEventConversationItemInputAudioTranscriptionCompleted),
7797
7798    RealtimeServerEventConversationItemInputAudioTranscriptionDelta(RealtimeServerEventConversationItemInputAudioTranscriptionDelta),
7799
7800    RealtimeServerEventConversationItemInputAudioTranscriptionFailed(RealtimeServerEventConversationItemInputAudioTranscriptionFailed),
7801
7802    RealtimeServerEventConversationItemRetrieved(RealtimeServerEventConversationItemRetrieved),
7803
7804    RealtimeServerEventConversationItemTruncated(RealtimeServerEventConversationItemTruncated),
7805
7806    RealtimeServerEventError(RealtimeServerEventError),
7807
7808    RealtimeServerEventInputAudioBufferCleared(RealtimeServerEventInputAudioBufferCleared),
7809
7810    RealtimeServerEventInputAudioBufferCommitted(RealtimeServerEventInputAudioBufferCommitted),
7811
7812    RealtimeServerEventInputAudioBufferSpeechStarted(RealtimeServerEventInputAudioBufferSpeechStarted),
7813
7814    RealtimeServerEventInputAudioBufferSpeechStopped(RealtimeServerEventInputAudioBufferSpeechStopped),
7815
7816    RealtimeServerEventRateLimitsUpdated(RealtimeServerEventRateLimitsUpdated),
7817
7818    RealtimeServerEventResponseAudioDelta(RealtimeServerEventResponseAudioDelta),
7819
7820    RealtimeServerEventResponseAudioDone(RealtimeServerEventResponseAudioDone),
7821
7822    RealtimeServerEventResponseAudioTranscriptDelta(RealtimeServerEventResponseAudioTranscriptDelta),
7823
7824    RealtimeServerEventResponseAudioTranscriptDone(RealtimeServerEventResponseAudioTranscriptDone),
7825
7826    RealtimeServerEventResponseContentPartAdded(RealtimeServerEventResponseContentPartAdded),
7827
7828    RealtimeServerEventResponseContentPartDone(RealtimeServerEventResponseContentPartDone),
7829
7830    RealtimeServerEventResponseCreated(RealtimeServerEventResponseCreated),
7831
7832    RealtimeServerEventResponseDone(RealtimeServerEventResponseDone),
7833
7834    RealtimeServerEventResponseFunctionCallArgumentsDelta(RealtimeServerEventResponseFunctionCallArgumentsDelta),
7835
7836    RealtimeServerEventResponseFunctionCallArgumentsDone(RealtimeServerEventResponseFunctionCallArgumentsDone),
7837
7838    RealtimeServerEventResponseOutputItemAdded(RealtimeServerEventResponseOutputItemAdded),
7839
7840    RealtimeServerEventResponseOutputItemDone(RealtimeServerEventResponseOutputItemDone),
7841
7842    RealtimeServerEventResponseTextDelta(RealtimeServerEventResponseTextDelta),
7843
7844    RealtimeServerEventResponseTextDone(RealtimeServerEventResponseTextDone),
7845
7846    RealtimeServerEventSessionCreated(RealtimeServerEventSessionCreated),
7847
7848    RealtimeServerEventSessionUpdated(RealtimeServerEventSessionUpdated),
7849
7850    RealtimeServerEventTranscriptionSessionUpdated(RealtimeServerEventTranscriptionSessionUpdated),
7851
7852    RealtimeServerEventOutputAudioBufferStarted(RealtimeServerEventOutputAudioBufferStarted),
7853
7854    RealtimeServerEventOutputAudioBufferStopped(RealtimeServerEventOutputAudioBufferStopped),
7855
7856    RealtimeServerEventOutputAudioBufferCleared(RealtimeServerEventOutputAudioBufferCleared),
7857}
7858
7859/// Returned when a conversation is created.
7860#[derive(Clone, Debug)]
7861#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7862pub struct RealtimeServerEventConversationCreated {
7863    /// The unique ID of the server event.
7864    pub r#event_id: String,
7865
7866    /// The event type, must be `conversation.created`.
7867    pub r#type: String,
7868
7869    pub r#conversation: RealtimeServerEventConversationCreated_Conversation,
7870}
7871
7872/// The conversation resource.
7873#[derive(Clone, Debug, Default)]
7874#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7875pub struct RealtimeServerEventConversationCreated_Conversation {
7876    /// The unique ID of the conversation.
7877    pub r#id: String,
7878
7879    /// The object type, must be `realtime.conversation`.
7880    pub r#object: String,
7881}
7882
7883/// Returned when a conversation item is created.
7884#[derive(Clone, Debug)]
7885#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7886pub struct RealtimeServerEventConversationItemCreated {
7887    /// The unique ID of the server event.
7888    pub r#event_id: String,
7889
7890    /// The event type, must be `conversation.item.created`.
7891    pub r#type: String,
7892
7893    /// The ID of the preceding item in the Conversation context, allows the
7894    /// client to understand the order of the conversation.
7895    pub r#previous_item_id: String,
7896
7897    pub r#item: RealtimeConversationItem,
7898}
7899
7900/// Returned when an item in the conversation is deleted by the client with a
7901/// `conversation.item.delete` event.
7902#[derive(Clone, Debug, Default)]
7903#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7904pub struct RealtimeServerEventConversationItemDeleted {
7905    /// The unique ID of the server event.
7906    pub r#event_id: String,
7907
7908    /// The event type, must be `conversation.item.deleted`.
7909    pub r#type: String,
7910
7911    /// The ID of the item that was deleted.
7912    pub r#item_id: String,
7913}
7914
7915/// This event is the output of audio transcription for user audio written to
7916/// the user audio buffer.
7917#[derive(Clone, Debug)]
7918#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7919pub struct RealtimeServerEventConversationItemInputAudioTranscriptionCompleted {
7920    /// The unique ID of the server event.
7921    pub r#event_id: String,
7922
7923    /// The event type, must be
7924    /// `conversation.item.input_audio_transcription.completed`.
7925    pub r#type: String,
7926
7927    /// The ID of the user message item containing the audio.
7928    pub r#item_id: String,
7929
7930    /// The index of the content part containing the audio.
7931    pub r#content_index: i64,
7932
7933    /// The transcribed text.
7934    pub r#transcript: String,
7935
7936    /// The log probabilities of the transcription.
7937    pub r#logprobs: Option<Vec<LogProbProperties>>,
7938}
7939
7940/// Returned when the text value of an input audio transcription content part is
7941/// updated.
7942#[derive(Clone, Debug)]
7943#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7944pub struct RealtimeServerEventConversationItemInputAudioTranscriptionDelta {
7945    /// The unique ID of the server event.
7946    pub r#event_id: String,
7947
7948    /// The event type, must be
7949    /// `conversation.item.input_audio_transcription.delta`.
7950    pub r#type: String,
7951
7952    /// The ID of the item.
7953    pub r#item_id: String,
7954
7955    /// The index of the content part in the item's content array.
7956    pub r#content_index: i64,
7957
7958    /// The text delta.
7959    pub r#delta: String,
7960
7961    /// The log probabilities of the transcription.
7962    pub r#logprobs: Option<Vec<LogProbProperties>>,
7963}
7964
7965/// Returned when input audio transcription is configured, and a transcription
7966/// request for a user message failed.
7967#[derive(Clone, Debug)]
7968#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7969pub struct RealtimeServerEventConversationItemInputAudioTranscriptionFailed {
7970    /// The unique ID of the server event.
7971    pub r#event_id: String,
7972
7973    /// The event type, must be
7974    /// `conversation.item.input_audio_transcription.failed`.
7975    pub r#type: String,
7976
7977    /// The ID of the user message item.
7978    pub r#item_id: String,
7979
7980    /// The index of the content part containing the audio.
7981    pub r#content_index: i64,
7982
7983    pub r#error: RealtimeServerEventConversationItemInputAudioTranscriptionFailed_Error,
7984}
7985
7986/// Details of the transcription error.
7987#[derive(Clone, Debug, Default)]
7988#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7989pub struct RealtimeServerEventConversationItemInputAudioTranscriptionFailed_Error {
7990    /// The type of error.
7991    pub r#type: String,
7992
7993    /// Error code, if any.
7994    pub r#code: String,
7995
7996    /// A human-readable error message.
7997    pub r#message: String,
7998
7999    /// Parameter related to the error, if any.
8000    pub r#param: String,
8001}
8002
8003/// Returned when a conversation item is retrieved with
8004/// `conversation.item.retrieve`.
8005#[derive(Clone, Debug)]
8006#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8007pub struct RealtimeServerEventConversationItemRetrieved {
8008    /// The unique ID of the server event.
8009    pub r#event_id: String,
8010
8011    /// The event type, must be `conversation.item.retrieved`.
8012    pub r#type: String,
8013
8014    pub r#item: RealtimeConversationItem,
8015}
8016
8017/// Returned when an earlier assistant audio message item is truncated by the
8018/// client with a `conversation.item.truncate` event.
8019#[derive(Clone, Debug, Default)]
8020#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8021pub struct RealtimeServerEventConversationItemTruncated {
8022    /// The unique ID of the server event.
8023    pub r#event_id: String,
8024
8025    /// The event type, must be `conversation.item.truncated`.
8026    pub r#type: String,
8027
8028    /// The ID of the assistant message item that was truncated.
8029    pub r#item_id: String,
8030
8031    /// The index of the content part that was truncated.
8032    pub r#content_index: i64,
8033
8034    /// The duration up to which the audio was truncated, in milliseconds.
8035    pub r#audio_end_ms: i64,
8036}
8037
8038/// Returned when an error occurs, which could be a client problem or a server
8039/// problem.
8040#[derive(Clone, Debug)]
8041#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8042pub struct RealtimeServerEventError {
8043    /// The unique ID of the server event.
8044    pub r#event_id: String,
8045
8046    /// The event type, must be `error`.
8047    pub r#type: String,
8048
8049    pub r#error: RealtimeServerEventError_Error,
8050}
8051
8052/// Details of the error.
8053#[derive(Clone, Debug, Default)]
8054#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8055pub struct RealtimeServerEventError_Error {
8056    /// The type of error (e.g., "invalid_request_error", "server_error").
8057    pub r#type: String,
8058
8059    /// Error code, if any.
8060    pub r#code: Option<String>,
8061
8062    /// A human-readable error message.
8063    pub r#message: String,
8064
8065    /// Parameter related to the error, if any.
8066    pub r#param: Option<String>,
8067
8068    /// The event_id of the client event that caused the error, if applicable.
8069    pub r#event_id: Option<String>,
8070}
8071
8072/// Returned when the input audio buffer is cleared by the client with a
8073/// `input_audio_buffer.clear` event.
8074#[derive(Clone, Debug, Default)]
8075#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8076pub struct RealtimeServerEventInputAudioBufferCleared {
8077    /// The unique ID of the server event.
8078    pub r#event_id: String,
8079
8080    /// The event type, must be `input_audio_buffer.cleared`.
8081    pub r#type: String,
8082}
8083
8084/// Returned when an input audio buffer is committed, either by the client or
8085/// automatically in server VAD mode.
8086#[derive(Clone, Debug, Default)]
8087#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8088pub struct RealtimeServerEventInputAudioBufferCommitted {
8089    /// The unique ID of the server event.
8090    pub r#event_id: String,
8091
8092    /// The event type, must be `input_audio_buffer.committed`.
8093    pub r#type: String,
8094
8095    /// The ID of the preceding item after which the new item will be inserted.
8096    pub r#previous_item_id: String,
8097
8098    /// The ID of the user message item that will be created.
8099    pub r#item_id: String,
8100}
8101
8102/// Sent by the server when in `server_vad` mode to indicate that speech has
8103/// been detected in the audio buffer.
8104#[derive(Clone, Debug, Default)]
8105#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8106pub struct RealtimeServerEventInputAudioBufferSpeechStarted {
8107    /// The unique ID of the server event.
8108    pub r#event_id: String,
8109
8110    /// The event type, must be `input_audio_buffer.speech_started`.
8111    pub r#type: String,
8112
8113    /// Milliseconds from the start of all audio written to the buffer during
8114    /// the session when speech was first detected.
8115    pub r#audio_start_ms: i64,
8116
8117    /// The ID of the user message item that will be created when speech stops.
8118    pub r#item_id: String,
8119}
8120
8121/// Returned in `server_vad` mode when the server detects the end of speech in
8122/// the audio buffer.
8123#[derive(Clone, Debug, Default)]
8124#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8125pub struct RealtimeServerEventInputAudioBufferSpeechStopped {
8126    /// The unique ID of the server event.
8127    pub r#event_id: String,
8128
8129    /// The event type, must be `input_audio_buffer.speech_stopped`.
8130    pub r#type: String,
8131
8132    /// Milliseconds since the session started when speech stopped.
8133    pub r#audio_end_ms: i64,
8134
8135    /// The ID of the user message item that will be created.
8136    pub r#item_id: String,
8137}
8138
8139/// **WebRTC Only:** Emitted when the output audio buffer is cleared.
8140#[derive(Clone, Debug, Default)]
8141#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8142pub struct RealtimeServerEventOutputAudioBufferCleared {
8143    /// The unique ID of the server event.
8144    pub r#event_id: String,
8145
8146    /// The event type, must be `output_audio_buffer.cleared`.
8147    pub r#type: String,
8148
8149    /// The unique ID of the response that produced the audio.
8150    pub r#response_id: String,
8151}
8152
8153/// **WebRTC Only:** Emitted when the server begins streaming audio to the
8154/// client.
8155#[derive(Clone, Debug, Default)]
8156#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8157pub struct RealtimeServerEventOutputAudioBufferStarted {
8158    /// The unique ID of the server event.
8159    pub r#event_id: String,
8160
8161    /// The event type, must be `output_audio_buffer.started`.
8162    pub r#type: String,
8163
8164    /// The unique ID of the response that produced the audio.
8165    pub r#response_id: String,
8166}
8167
8168/// **WebRTC Only:** Emitted when the output audio buffer has been completely
8169/// drained on the server, and no more audio is forthcoming.
8170#[derive(Clone, Debug, Default)]
8171#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8172pub struct RealtimeServerEventOutputAudioBufferStopped {
8173    /// The unique ID of the server event.
8174    pub r#event_id: String,
8175
8176    /// The event type, must be `output_audio_buffer.stopped`.
8177    pub r#type: String,
8178
8179    /// The unique ID of the response that produced the audio.
8180    pub r#response_id: String,
8181}
8182
8183/// Emitted at the beginning of a Response to indicate the updated rate limits.
8184#[derive(Clone, Debug)]
8185#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8186pub struct RealtimeServerEventRateLimitsUpdated {
8187    /// The unique ID of the server event.
8188    pub r#event_id: String,
8189
8190    /// The event type, must be `rate_limits.updated`.
8191    pub r#type: String,
8192
8193    /// List of rate limit information.
8194    pub r#rate_limits: Vec<RealtimeServerEventRateLimitsUpdated_RateLimits>,
8195}
8196
8197#[derive(Clone, Debug, Default)]
8198#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8199pub struct RealtimeServerEventRateLimitsUpdated_RateLimits {
8200    /// The name of the rate limit (`requests`, `tokens`).
8201    pub r#name: String,
8202
8203    /// The maximum allowed value for the rate limit.
8204    pub r#limit: i64,
8205
8206    /// The remaining value before the limit is reached.
8207    pub r#remaining: i64,
8208
8209    /// Seconds until the rate limit resets.
8210    pub r#reset_seconds: f64,
8211}
8212
8213/// Returned when the model-generated audio is updated.
8214#[derive(Clone, Debug, Default)]
8215#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8216pub struct RealtimeServerEventResponseAudioDelta {
8217    /// The unique ID of the server event.
8218    pub r#event_id: String,
8219
8220    /// The event type, must be `response.audio.delta`.
8221    pub r#type: String,
8222
8223    /// The ID of the response.
8224    pub r#response_id: String,
8225
8226    /// The ID of the item.
8227    pub r#item_id: String,
8228
8229    /// The index of the output item in the response.
8230    pub r#output_index: i64,
8231
8232    /// The index of the content part in the item's content array.
8233    pub r#content_index: i64,
8234
8235    /// Base64-encoded audio data delta.
8236    pub r#delta: String,
8237}
8238
8239/// Returned when the model-generated audio is done.
8240#[derive(Clone, Debug, Default)]
8241#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8242pub struct RealtimeServerEventResponseAudioDone {
8243    /// The unique ID of the server event.
8244    pub r#event_id: String,
8245
8246    /// The event type, must be `response.audio.done`.
8247    pub r#type: String,
8248
8249    /// The ID of the response.
8250    pub r#response_id: String,
8251
8252    /// The ID of the item.
8253    pub r#item_id: String,
8254
8255    /// The index of the output item in the response.
8256    pub r#output_index: i64,
8257
8258    /// The index of the content part in the item's content array.
8259    pub r#content_index: i64,
8260}
8261
8262/// Returned when the model-generated transcription of audio output is updated.
8263#[derive(Clone, Debug, Default)]
8264#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8265pub struct RealtimeServerEventResponseAudioTranscriptDelta {
8266    /// The unique ID of the server event.
8267    pub r#event_id: String,
8268
8269    /// The event type, must be `response.audio_transcript.delta`.
8270    pub r#type: String,
8271
8272    /// The ID of the response.
8273    pub r#response_id: String,
8274
8275    /// The ID of the item.
8276    pub r#item_id: String,
8277
8278    /// The index of the output item in the response.
8279    pub r#output_index: i64,
8280
8281    /// The index of the content part in the item's content array.
8282    pub r#content_index: i64,
8283
8284    /// The transcript delta.
8285    pub r#delta: String,
8286}
8287
8288/// Returned when the model-generated transcription of audio output is done
8289/// streaming.
8290#[derive(Clone, Debug, Default)]
8291#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8292pub struct RealtimeServerEventResponseAudioTranscriptDone {
8293    /// The unique ID of the server event.
8294    pub r#event_id: String,
8295
8296    /// The event type, must be `response.audio_transcript.done`.
8297    pub r#type: String,
8298
8299    /// The ID of the response.
8300    pub r#response_id: String,
8301
8302    /// The ID of the item.
8303    pub r#item_id: String,
8304
8305    /// The index of the output item in the response.
8306    pub r#output_index: i64,
8307
8308    /// The index of the content part in the item's content array.
8309    pub r#content_index: i64,
8310
8311    /// The final transcript of the audio.
8312    pub r#transcript: String,
8313}
8314
8315/// Returned when a new content part is added to an assistant message item
8316/// during response generation.
8317#[derive(Clone, Debug)]
8318#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8319pub struct RealtimeServerEventResponseContentPartAdded {
8320    /// The unique ID of the server event.
8321    pub r#event_id: String,
8322
8323    /// The event type, must be `response.content_part.added`.
8324    pub r#type: String,
8325
8326    /// The ID of the response.
8327    pub r#response_id: String,
8328
8329    /// The ID of the item to which the content part was added.
8330    pub r#item_id: String,
8331
8332    /// The index of the output item in the response.
8333    pub r#output_index: i64,
8334
8335    /// The index of the content part in the item's content array.
8336    pub r#content_index: i64,
8337
8338    pub r#part: RealtimeServerEventResponseContentPartAdded_Part,
8339}
8340
8341/// The content part that was added.
8342#[derive(Clone, Debug, Default)]
8343#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8344pub struct RealtimeServerEventResponseContentPartAdded_Part {
8345    /// The content type ("text", "audio").
8346    pub r#type: String,
8347
8348    /// The text content (if type is "text").
8349    pub r#text: String,
8350
8351    /// Base64-encoded audio data (if type is "audio").
8352    pub r#audio: String,
8353
8354    /// The transcript of the audio (if type is "audio").
8355    pub r#transcript: String,
8356}
8357
8358/// Returned when a content part is done streaming in an assistant message item.
8359#[derive(Clone, Debug)]
8360#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8361pub struct RealtimeServerEventResponseContentPartDone {
8362    /// The unique ID of the server event.
8363    pub r#event_id: String,
8364
8365    /// The event type, must be `response.content_part.done`.
8366    pub r#type: String,
8367
8368    /// The ID of the response.
8369    pub r#response_id: String,
8370
8371    /// The ID of the item.
8372    pub r#item_id: String,
8373
8374    /// The index of the output item in the response.
8375    pub r#output_index: i64,
8376
8377    /// The index of the content part in the item's content array.
8378    pub r#content_index: i64,
8379
8380    pub r#part: RealtimeServerEventResponseContentPartDone_Part,
8381}
8382
8383/// The content part that is done.
8384#[derive(Clone, Debug, Default)]
8385#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8386pub struct RealtimeServerEventResponseContentPartDone_Part {
8387    /// The content type ("text", "audio").
8388    pub r#type: String,
8389
8390    /// The text content (if type is "text").
8391    pub r#text: String,
8392
8393    /// Base64-encoded audio data (if type is "audio").
8394    pub r#audio: String,
8395
8396    /// The transcript of the audio (if type is "audio").
8397    pub r#transcript: String,
8398}
8399
8400/// Returned when a new Response is created.
8401#[derive(Clone, Debug)]
8402#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8403pub struct RealtimeServerEventResponseCreated {
8404    /// The unique ID of the server event.
8405    pub r#event_id: String,
8406
8407    /// The event type, must be `response.created`.
8408    pub r#type: String,
8409
8410    pub r#response: RealtimeResponse,
8411}
8412
8413/// Returned when a Response is done streaming.
8414#[derive(Clone, Debug)]
8415#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8416pub struct RealtimeServerEventResponseDone {
8417    /// The unique ID of the server event.
8418    pub r#event_id: String,
8419
8420    /// The event type, must be `response.done`.
8421    pub r#type: String,
8422
8423    pub r#response: RealtimeResponse,
8424}
8425
8426/// Returned when the model-generated function call arguments are updated.
8427#[derive(Clone, Debug, Default)]
8428#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8429pub struct RealtimeServerEventResponseFunctionCallArgumentsDelta {
8430    /// The unique ID of the server event.
8431    pub r#event_id: String,
8432
8433    /// The event type, must be `response.function_call_arguments.delta`.
8434    pub r#type: String,
8435
8436    /// The ID of the response.
8437    pub r#response_id: String,
8438
8439    /// The ID of the function call item.
8440    pub r#item_id: String,
8441
8442    /// The index of the output item in the response.
8443    pub r#output_index: i64,
8444
8445    /// The ID of the function call.
8446    pub r#call_id: String,
8447
8448    /// The arguments delta as a JSON string.
8449    pub r#delta: String,
8450}
8451
8452/// Returned when the model-generated function call arguments are done
8453/// streaming.
8454#[derive(Clone, Debug, Default)]
8455#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8456pub struct RealtimeServerEventResponseFunctionCallArgumentsDone {
8457    /// The unique ID of the server event.
8458    pub r#event_id: String,
8459
8460    /// The event type, must be `response.function_call_arguments.done`.
8461    pub r#type: String,
8462
8463    /// The ID of the response.
8464    pub r#response_id: String,
8465
8466    /// The ID of the function call item.
8467    pub r#item_id: String,
8468
8469    /// The index of the output item in the response.
8470    pub r#output_index: i64,
8471
8472    /// The ID of the function call.
8473    pub r#call_id: String,
8474
8475    /// The final arguments as a JSON string.
8476    pub r#arguments: String,
8477}
8478
8479/// Returned when a new Item is created during Response generation.
8480#[derive(Clone, Debug)]
8481#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8482pub struct RealtimeServerEventResponseOutputItemAdded {
8483    /// The unique ID of the server event.
8484    pub r#event_id: String,
8485
8486    /// The event type, must be `response.output_item.added`.
8487    pub r#type: String,
8488
8489    /// The ID of the Response to which the item belongs.
8490    pub r#response_id: String,
8491
8492    /// The index of the output item in the Response.
8493    pub r#output_index: i64,
8494
8495    pub r#item: RealtimeConversationItem,
8496}
8497
8498/// Returned when an Item is done streaming.
8499#[derive(Clone, Debug)]
8500#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8501pub struct RealtimeServerEventResponseOutputItemDone {
8502    /// The unique ID of the server event.
8503    pub r#event_id: String,
8504
8505    /// The event type, must be `response.output_item.done`.
8506    pub r#type: String,
8507
8508    /// The ID of the Response to which the item belongs.
8509    pub r#response_id: String,
8510
8511    /// The index of the output item in the Response.
8512    pub r#output_index: i64,
8513
8514    pub r#item: RealtimeConversationItem,
8515}
8516
8517/// Returned when the text value of a "text" content part is updated.
8518#[derive(Clone, Debug, Default)]
8519#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8520pub struct RealtimeServerEventResponseTextDelta {
8521    /// The unique ID of the server event.
8522    pub r#event_id: String,
8523
8524    /// The event type, must be `response.text.delta`.
8525    pub r#type: String,
8526
8527    /// The ID of the response.
8528    pub r#response_id: String,
8529
8530    /// The ID of the item.
8531    pub r#item_id: String,
8532
8533    /// The index of the output item in the response.
8534    pub r#output_index: i64,
8535
8536    /// The index of the content part in the item's content array.
8537    pub r#content_index: i64,
8538
8539    /// The text delta.
8540    pub r#delta: String,
8541}
8542
8543/// Returned when the text value of a "text" content part is done streaming.
8544#[derive(Clone, Debug, Default)]
8545#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8546pub struct RealtimeServerEventResponseTextDone {
8547    /// The unique ID of the server event.
8548    pub r#event_id: String,
8549
8550    /// The event type, must be `response.text.done`.
8551    pub r#type: String,
8552
8553    /// The ID of the response.
8554    pub r#response_id: String,
8555
8556    /// The ID of the item.
8557    pub r#item_id: String,
8558
8559    /// The index of the output item in the response.
8560    pub r#output_index: i64,
8561
8562    /// The index of the content part in the item's content array.
8563    pub r#content_index: i64,
8564
8565    /// The final text content.
8566    pub r#text: String,
8567}
8568
8569/// Returned when a Session is created.
8570#[derive(Clone, Debug)]
8571#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8572pub struct RealtimeServerEventSessionCreated {
8573    /// The unique ID of the server event.
8574    pub r#event_id: String,
8575
8576    /// The event type, must be `session.created`.
8577    pub r#type: String,
8578
8579    pub r#session: RealtimeSession,
8580}
8581
8582/// Returned when a session is updated with a `session.update` event, unless
8583/// there is an error.
8584#[derive(Clone, Debug)]
8585#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8586pub struct RealtimeServerEventSessionUpdated {
8587    /// The unique ID of the server event.
8588    pub r#event_id: String,
8589
8590    /// The event type, must be `session.updated`.
8591    pub r#type: String,
8592
8593    pub r#session: RealtimeSession,
8594}
8595
8596/// Returned when a transcription session is updated with a
8597/// `transcription_session.update` event, unless there is an error.
8598#[derive(Clone, Debug)]
8599#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8600pub struct RealtimeServerEventTranscriptionSessionUpdated {
8601    /// The unique ID of the server event.
8602    pub r#event_id: String,
8603
8604    /// The event type, must be `transcription_session.updated`.
8605    pub r#type: String,
8606
8607    pub r#session: RealtimeTranscriptionSessionCreateResponse,
8608}
8609
8610/// Realtime session object configuration.
8611#[derive(Clone, Debug)]
8612#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8613pub struct RealtimeSession {
8614    /// Unique identifier for the session that looks like
8615    /// `sess_1234567890abcdef`.
8616    pub r#id: String,
8617
8618    /// The set of modalities the model can respond with.
8619    pub r#modalities: Vec<String>,
8620
8621    /// The Realtime model used for this session.
8622    pub r#model: String,
8623
8624    /// The default system instructions (i.e.
8625    pub r#instructions: String,
8626
8627    /// The voice the model uses to respond.
8628    pub r#voice: VoiceIdsShared,
8629
8630    /// The format of input audio.
8631    pub r#input_audio_format: String,
8632
8633    /// The format of output audio.
8634    pub r#output_audio_format: String,
8635
8636    pub r#input_audio_transcription: RealtimeSession_InputAudioTranscription,
8637
8638    pub r#turn_detection: RealtimeSession_TurnDetection,
8639
8640    pub r#input_audio_noise_reduction: RealtimeSession_InputAudioNoiseReduction,
8641
8642    /// Tools (functions) available to the model.
8643    pub r#tools: Vec<RealtimeSession_Tools>,
8644
8645    /// How the model chooses tools.
8646    pub r#tool_choice: String,
8647
8648    /// Sampling temperature for the model, limited to [0.6, 1.2].
8649    pub r#temperature: f64,
8650
8651    pub r#max_response_output_tokens: RealtimeSession_MaxResponseOutputTokens,
8652}
8653
8654/// Realtime session object configuration.
8655#[derive(Clone, Debug)]
8656#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8657pub struct RealtimeSessionCreateRequest {
8658    /// The set of modalities the model can respond with.
8659    pub r#modalities: Vec<String>,
8660
8661    /// The Realtime model used for this session.
8662    pub r#model: String,
8663
8664    /// The default system instructions (i.e.
8665    pub r#instructions: String,
8666
8667    /// The voice the model uses to respond.
8668    pub r#voice: VoiceIdsShared,
8669
8670    /// The format of input audio.
8671    pub r#input_audio_format: String,
8672
8673    /// The format of output audio.
8674    pub r#output_audio_format: String,
8675
8676    pub r#input_audio_transcription: RealtimeSessionCreateRequest_InputAudioTranscription,
8677
8678    pub r#turn_detection: RealtimeSessionCreateRequest_TurnDetection,
8679
8680    pub r#input_audio_noise_reduction: RealtimeSessionCreateRequest_InputAudioNoiseReduction,
8681
8682    /// Tools (functions) available to the model.
8683    pub r#tools: Vec<RealtimeSessionCreateRequest_Tools>,
8684
8685    /// How the model chooses tools.
8686    pub r#tool_choice: String,
8687
8688    /// Sampling temperature for the model, limited to [0.6, 1.2].
8689    pub r#temperature: f64,
8690
8691    pub r#max_response_output_tokens: RealtimeSessionCreateRequest_MaxResponseOutputTokens,
8692}
8693
8694/// Configuration for input audio noise reduction.
8695#[derive(Clone, Debug, Default)]
8696#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8697pub struct RealtimeSessionCreateRequest_InputAudioNoiseReduction {
8698    /// Type of noise reduction.
8699    pub r#type: String,
8700}
8701
8702/// Configuration for input audio transcription, defaults to off and can be  set
8703/// to `null` to turn off once on.
8704#[derive(Clone, Debug, Default)]
8705#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8706pub struct RealtimeSessionCreateRequest_InputAudioTranscription {
8707    /// The model to use for transcription, current options are
8708    /// `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
8709    pub r#model: String,
8710
8711    /// The language of the input audio.
8712    pub r#language: String,
8713
8714    /// An optional text to guide the model's style or continue a previous audio
8715    /// segment.
8716    pub r#prompt: String,
8717}
8718
8719/// Maximum number of output tokens for a single assistant response, inclusive
8720/// of tool calls.
8721#[derive(Clone, Debug)]
8722#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8723pub enum RealtimeSessionCreateRequest_MaxResponseOutputTokens {
8724    Integer(i64),
8725
8726    String(String),
8727}
8728
8729#[derive(Clone, Debug)]
8730#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8731pub struct RealtimeSessionCreateRequest_Tools {
8732    /// The type of the tool, i.e.
8733    pub r#type: String,
8734
8735    /// The name of the function.
8736    pub r#name: String,
8737
8738    /// The description of the function, including guidance on when and how to
8739    /// call it, and guidance about what to tell the user when calling (if
8740    /// anything).
8741    pub r#description: String,
8742
8743    /// Parameters of the function in JSON Schema.
8744    pub r#parameters: RealtimeSessionCreateRequest_Tools_Parameters,
8745}
8746
8747/// Parameters of the function in JSON Schema.
8748#[derive(Clone, Debug, Default)]
8749#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8750pub struct RealtimeSessionCreateRequest_Tools_Parameters;
8751
8752/// Configuration for turn detection, ether Server VAD or Semantic VAD.
8753#[derive(Clone, Debug, Default)]
8754#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8755pub struct RealtimeSessionCreateRequest_TurnDetection {
8756    /// Type of turn detection.
8757    pub r#type: String,
8758
8759    /// Used only for `semantic_vad` mode.
8760    pub r#eagerness: String,
8761
8762    /// Used only for `server_vad` mode.
8763    pub r#threshold: f64,
8764
8765    /// Used only for `server_vad` mode.
8766    pub r#prefix_padding_ms: i64,
8767
8768    /// Used only for `server_vad` mode.
8769    pub r#silence_duration_ms: i64,
8770
8771    /// Whether or not to automatically generate a response when a VAD stop
8772    /// event occurs.
8773    pub r#create_response: bool,
8774
8775    /// Whether or not to automatically interrupt any ongoing response with
8776    /// output to the default conversation (i.e.
8777    pub r#interrupt_response: bool,
8778}
8779
8780/// A new Realtime session configuration, with an ephermeral key.
8781#[derive(Clone, Debug)]
8782#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8783pub struct RealtimeSessionCreateResponse {
8784    pub r#client_secret: RealtimeSessionCreateResponse_ClientSecret,
8785
8786    /// The set of modalities the model can respond with.
8787    pub r#modalities: Vec<String>,
8788
8789    /// The default system instructions (i.e.
8790    pub r#instructions: String,
8791
8792    /// The voice the model uses to respond.
8793    pub r#voice: VoiceIdsShared,
8794
8795    /// The format of input audio.
8796    pub r#input_audio_format: String,
8797
8798    /// The format of output audio.
8799    pub r#output_audio_format: String,
8800
8801    pub r#input_audio_transcription: RealtimeSessionCreateResponse_InputAudioTranscription,
8802
8803    pub r#turn_detection: RealtimeSessionCreateResponse_TurnDetection,
8804
8805    /// Tools (functions) available to the model.
8806    pub r#tools: Vec<RealtimeSessionCreateResponse_Tools>,
8807
8808    /// How the model chooses tools.
8809    pub r#tool_choice: String,
8810
8811    /// Sampling temperature for the model, limited to [0.6, 1.2].
8812    pub r#temperature: f64,
8813
8814    pub r#max_response_output_tokens: RealtimeSessionCreateResponse_MaxResponseOutputTokens,
8815}
8816
8817/// Ephemeral key returned by the API.
8818#[derive(Clone, Debug, Default)]
8819#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8820pub struct RealtimeSessionCreateResponse_ClientSecret {
8821    /// Ephemeral key usable in client environments to authenticate connections
8822    /// to the Realtime API.
8823    pub r#value: String,
8824
8825    /// Timestamp for when the token expires.
8826    pub r#expires_at: i64,
8827}
8828
8829/// Configuration for input audio transcription, defaults to off and can be set
8830/// to `null` to turn off once on.
8831#[derive(Clone, Debug, Default)]
8832#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8833pub struct RealtimeSessionCreateResponse_InputAudioTranscription {
8834    /// The model to use for transcription, `whisper-1` is the only currently
8835    /// supported model.
8836    pub r#model: String,
8837}
8838
8839/// Maximum number of output tokens for a single assistant response, inclusive
8840/// of tool calls.
8841#[derive(Clone, Debug)]
8842#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8843pub enum RealtimeSessionCreateResponse_MaxResponseOutputTokens {
8844    Integer(i64),
8845
8846    String(String),
8847}
8848
8849#[derive(Clone, Debug)]
8850#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8851pub struct RealtimeSessionCreateResponse_Tools {
8852    /// The type of the tool, i.e.
8853    pub r#type: String,
8854
8855    /// The name of the function.
8856    pub r#name: String,
8857
8858    /// The description of the function, including guidance on when and how to
8859    /// call it, and guidance about what to tell the user when calling (if
8860    /// anything).
8861    pub r#description: String,
8862
8863    /// Parameters of the function in JSON Schema.
8864    pub r#parameters: RealtimeSessionCreateResponse_Tools_Parameters,
8865}
8866
8867/// Parameters of the function in JSON Schema.
8868#[derive(Clone, Debug, Default)]
8869#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8870pub struct RealtimeSessionCreateResponse_Tools_Parameters;
8871
8872/// Configuration for turn detection.
8873#[derive(Clone, Debug, Default)]
8874#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8875pub struct RealtimeSessionCreateResponse_TurnDetection {
8876    /// Type of turn detection, only `server_vad` is currently supported.
8877    pub r#type: String,
8878
8879    /// Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5.
8880    pub r#threshold: f64,
8881
8882    /// Amount of audio to include before the VAD detected speech (in
8883    /// milliseconds).
8884    pub r#prefix_padding_ms: i64,
8885
8886    /// Duration of silence to detect speech stop (in milliseconds).
8887    pub r#silence_duration_ms: i64,
8888}
8889
8890/// Configuration for input audio noise reduction.
8891#[derive(Clone, Debug, Default)]
8892#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8893pub struct RealtimeSession_InputAudioNoiseReduction {
8894    /// Type of noise reduction.
8895    pub r#type: String,
8896}
8897
8898/// Configuration for input audio transcription, defaults to off and can be  set
8899/// to `null` to turn off once on.
8900#[derive(Clone, Debug, Default)]
8901#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8902pub struct RealtimeSession_InputAudioTranscription {
8903    /// The model to use for transcription, current options are
8904    /// `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
8905    pub r#model: String,
8906
8907    /// The language of the input audio.
8908    pub r#language: String,
8909
8910    /// An optional text to guide the model's style or continue a previous audio
8911    /// segment.
8912    pub r#prompt: String,
8913}
8914
8915/// Maximum number of output tokens for a single assistant response, inclusive
8916/// of tool calls.
8917#[derive(Clone, Debug)]
8918#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8919pub enum RealtimeSession_MaxResponseOutputTokens {
8920    Integer(i64),
8921
8922    String(String),
8923}
8924
8925#[derive(Clone, Debug)]
8926#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8927pub struct RealtimeSession_Tools {
8928    /// The type of the tool, i.e.
8929    pub r#type: String,
8930
8931    /// The name of the function.
8932    pub r#name: String,
8933
8934    /// The description of the function, including guidance on when and how to
8935    /// call it, and guidance about what to tell the user when calling (if
8936    /// anything).
8937    pub r#description: String,
8938
8939    /// Parameters of the function in JSON Schema.
8940    pub r#parameters: RealtimeSession_Tools_Parameters,
8941}
8942
8943/// Parameters of the function in JSON Schema.
8944#[derive(Clone, Debug, Default)]
8945#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8946pub struct RealtimeSession_Tools_Parameters;
8947
8948/// Configuration for turn detection, ether Server VAD or Semantic VAD.
8949#[derive(Clone, Debug, Default)]
8950#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8951pub struct RealtimeSession_TurnDetection {
8952    /// Type of turn detection.
8953    pub r#type: String,
8954
8955    /// Used only for `semantic_vad` mode.
8956    pub r#eagerness: String,
8957
8958    /// Used only for `server_vad` mode.
8959    pub r#threshold: f64,
8960
8961    /// Used only for `server_vad` mode.
8962    pub r#prefix_padding_ms: i64,
8963
8964    /// Used only for `server_vad` mode.
8965    pub r#silence_duration_ms: i64,
8966
8967    /// Whether or not to automatically generate a response when a VAD stop
8968    /// event occurs.
8969    pub r#create_response: bool,
8970
8971    /// Whether or not to automatically interrupt any ongoing response with
8972    /// output to the default conversation (i.e.
8973    pub r#interrupt_response: bool,
8974}
8975
8976/// Realtime transcription session object configuration.
8977#[derive(Clone, Debug)]
8978#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8979pub struct RealtimeTranscriptionSessionCreateRequest {
8980    /// The set of modalities the model can respond with.
8981    pub r#modalities: Vec<String>,
8982
8983    /// The format of input audio.
8984    pub r#input_audio_format: String,
8985
8986    pub r#input_audio_transcription: RealtimeTranscriptionSessionCreateRequest_InputAudioTranscription,
8987
8988    pub r#turn_detection: RealtimeTranscriptionSessionCreateRequest_TurnDetection,
8989
8990    pub r#input_audio_noise_reduction: RealtimeTranscriptionSessionCreateRequest_InputAudioNoiseReduction,
8991
8992    /// The set of items to include in the transcription.
8993    pub r#include: Vec<String>,
8994}
8995
8996/// Configuration for input audio noise reduction.
8997#[derive(Clone, Debug, Default)]
8998#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8999pub struct RealtimeTranscriptionSessionCreateRequest_InputAudioNoiseReduction {
9000    /// Type of noise reduction.
9001    pub r#type: String,
9002}
9003
9004/// Configuration for input audio transcription.
9005#[derive(Clone, Debug, Default)]
9006#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9007pub struct RealtimeTranscriptionSessionCreateRequest_InputAudioTranscription {
9008    /// The model to use for transcription, current options are
9009    /// `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
9010    pub r#model: String,
9011
9012    /// The language of the input audio.
9013    pub r#language: String,
9014
9015    /// An optional text to guide the model's style or continue a previous audio
9016    /// segment.
9017    pub r#prompt: String,
9018}
9019
9020/// Configuration for turn detection, ether Server VAD or Semantic VAD.
9021#[derive(Clone, Debug, Default)]
9022#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9023pub struct RealtimeTranscriptionSessionCreateRequest_TurnDetection {
9024    /// Type of turn detection.
9025    pub r#type: String,
9026
9027    /// Used only for `semantic_vad` mode.
9028    pub r#eagerness: String,
9029
9030    /// Used only for `server_vad` mode.
9031    pub r#threshold: f64,
9032
9033    /// Used only for `server_vad` mode.
9034    pub r#prefix_padding_ms: i64,
9035
9036    /// Used only for `server_vad` mode.
9037    pub r#silence_duration_ms: i64,
9038
9039    /// Whether or not to automatically generate a response when a VAD stop
9040    /// event occurs.
9041    pub r#create_response: bool,
9042
9043    /// Whether or not to automatically interrupt any ongoing response with
9044    /// output to the default conversation (i.e.
9045    pub r#interrupt_response: bool,
9046}
9047
9048/// A new Realtime transcription session configuration.
9049#[derive(Clone, Debug)]
9050#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9051pub struct RealtimeTranscriptionSessionCreateResponse {
9052    pub r#client_secret: RealtimeTranscriptionSessionCreateResponse_ClientSecret,
9053
9054    /// The set of modalities the model can respond with.
9055    pub r#modalities: Vec<String>,
9056
9057    /// The format of input audio.
9058    pub r#input_audio_format: String,
9059
9060    pub r#input_audio_transcription: RealtimeTranscriptionSessionCreateResponse_InputAudioTranscription,
9061
9062    pub r#turn_detection: RealtimeTranscriptionSessionCreateResponse_TurnDetection,
9063}
9064
9065/// Ephemeral key returned by the API.
9066#[derive(Clone, Debug, Default)]
9067#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9068pub struct RealtimeTranscriptionSessionCreateResponse_ClientSecret {
9069    /// Ephemeral key usable in client environments to authenticate connections
9070    /// to the Realtime API.
9071    pub r#value: String,
9072
9073    /// Timestamp for when the token expires.
9074    pub r#expires_at: i64,
9075}
9076
9077/// Configuration of the transcription model.
9078#[derive(Clone, Debug, Default)]
9079#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9080pub struct RealtimeTranscriptionSessionCreateResponse_InputAudioTranscription {
9081    /// The model to use for transcription.
9082    pub r#model: String,
9083
9084    /// The language of the input audio.
9085    pub r#language: String,
9086
9087    /// An optional text to guide the model's style or continue a previous audio
9088    /// segment.
9089    pub r#prompt: String,
9090}
9091
9092/// Configuration for turn detection.
9093#[derive(Clone, Debug, Default)]
9094#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9095pub struct RealtimeTranscriptionSessionCreateResponse_TurnDetection {
9096    /// Type of turn detection, only `server_vad` is currently supported.
9097    pub r#type: String,
9098
9099    /// Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5.
9100    pub r#threshold: f64,
9101
9102    /// Amount of audio to include before the VAD detected speech (in
9103    /// milliseconds).
9104    pub r#prefix_padding_ms: i64,
9105
9106    /// Duration of silence to detect speech stop (in milliseconds).
9107    pub r#silence_duration_ms: i64,
9108}
9109
9110/// **o-series models only** Configuration options for [reasoning
9111/// models](https://platform.openai.com/docs/guides/reasoning).
9112#[derive(Clone, Debug)]
9113#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9114pub struct Reasoning {
9115    pub r#effort: Option<ReasoningEffort>,
9116
9117    /// A summary of the reasoning performed by the model.
9118    pub r#summary: Option<String>,
9119
9120    /// **Deprecated:** use `summary` instead.
9121    pub r#generate_summary: Option<String>,
9122}
9123
9124/// **o-series models only** Constrains effort on reasoning for [reasoning
9125/// models](https://platform.openai.com/docs/guides/reasoning).
9126#[derive(Clone, Debug)]
9127#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9128pub struct ReasoningEffort(pub String);
9129
9130/// A description of the chain of thought used by a reasoning model while
9131/// generating a response.
9132#[derive(Clone, Debug)]
9133#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9134pub struct ReasoningItem {
9135    /// The type of the object.
9136    pub r#type: String,
9137
9138    /// The unique identifier of the reasoning content.
9139    pub r#id: String,
9140
9141    /// Reasoning text contents.
9142    pub r#summary: Vec<ReasoningItem_Summary>,
9143
9144    /// The status of the item.
9145    pub r#status: String,
9146}
9147
9148#[derive(Clone, Debug, Default)]
9149#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9150pub struct ReasoningItem_Summary {
9151    /// The type of the object.
9152    pub r#type: String,
9153
9154    /// A short summary of the reasoning used by the model when generating the
9155    /// response.
9156    pub r#text: String,
9157}
9158
9159/// A refusal from the model.
9160#[derive(Clone, Debug, Default)]
9161#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9162pub struct RefusalContent {
9163    /// The type of the refusal.
9164    pub r#type: String,
9165
9166    /// The refusal explanationfrom the model.
9167    pub r#refusal: String,
9168}
9169
9170#[derive(Clone, Debug, Default)]
9171#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9172pub struct Response(pub (/*AllOf*/));
9173
9174/// Emitted when there is a partial audio response.
9175#[derive(Clone, Debug, Default)]
9176#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9177pub struct ResponseAudioDeltaEvent {
9178    /// The type of the event.
9179    pub r#type: String,
9180
9181    /// A chunk of Base64 encoded response audio bytes.
9182    pub r#delta: String,
9183}
9184
9185/// Emitted when the audio response is complete.
9186#[derive(Clone, Debug, Default)]
9187#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9188pub struct ResponseAudioDoneEvent {
9189    /// The type of the event.
9190    pub r#type: String,
9191}
9192
9193/// Emitted when there is a partial transcript of audio.
9194#[derive(Clone, Debug, Default)]
9195#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9196pub struct ResponseAudioTranscriptDeltaEvent {
9197    /// The type of the event.
9198    pub r#type: String,
9199
9200    /// The partial transcript of the audio response.
9201    pub r#delta: String,
9202}
9203
9204/// Emitted when the full audio transcript is completed.
9205#[derive(Clone, Debug, Default)]
9206#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9207pub struct ResponseAudioTranscriptDoneEvent {
9208    /// The type of the event.
9209    pub r#type: String,
9210}
9211
9212/// Emitted when a partial code snippet is added by the code interpreter.
9213#[derive(Clone, Debug, Default)]
9214#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9215pub struct ResponseCodeInterpreterCallCodeDeltaEvent {
9216    /// The type of the event.
9217    pub r#type: String,
9218
9219    /// The index of the output item that the code interpreter call is in
9220    /// progress.
9221    pub r#output_index: i64,
9222
9223    /// The partial code snippet added by the code interpreter.
9224    pub r#delta: String,
9225}
9226
9227/// Emitted when code snippet output is finalized by the code interpreter.
9228#[derive(Clone, Debug, Default)]
9229#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9230pub struct ResponseCodeInterpreterCallCodeDoneEvent {
9231    /// The type of the event.
9232    pub r#type: String,
9233
9234    /// The index of the output item that the code interpreter call is in
9235    /// progress.
9236    pub r#output_index: i64,
9237
9238    /// The final code snippet output by the code interpreter.
9239    pub r#code: String,
9240}
9241
9242/// Emitted when the code interpreter call is completed.
9243#[derive(Clone, Debug)]
9244#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9245pub struct ResponseCodeInterpreterCallCompletedEvent {
9246    /// The type of the event.
9247    pub r#type: String,
9248
9249    /// The index of the output item that the code interpreter call is in
9250    /// progress.
9251    pub r#output_index: i64,
9252
9253    pub r#code_interpreter_call: CodeInterpreterToolCall,
9254}
9255
9256/// Emitted when a code interpreter call is in progress.
9257#[derive(Clone, Debug)]
9258#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9259pub struct ResponseCodeInterpreterCallInProgressEvent {
9260    /// The type of the event.
9261    pub r#type: String,
9262
9263    /// The index of the output item that the code interpreter call is in
9264    /// progress.
9265    pub r#output_index: i64,
9266
9267    pub r#code_interpreter_call: CodeInterpreterToolCall,
9268}
9269
9270/// Emitted when the code interpreter is actively interpreting the code snippet.
9271#[derive(Clone, Debug)]
9272#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9273pub struct ResponseCodeInterpreterCallInterpretingEvent {
9274    /// The type of the event.
9275    pub r#type: String,
9276
9277    /// The index of the output item that the code interpreter call is in
9278    /// progress.
9279    pub r#output_index: i64,
9280
9281    pub r#code_interpreter_call: CodeInterpreterToolCall,
9282}
9283
9284/// Emitted when the model response is complete.
9285#[derive(Clone, Debug)]
9286#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9287pub struct ResponseCompletedEvent {
9288    /// The type of the event.
9289    pub r#type: String,
9290
9291    /// Properties of the completed response.
9292    pub r#response: Response,
9293}
9294
9295/// Emitted when a new content part is added.
9296#[derive(Clone, Debug)]
9297#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9298pub struct ResponseContentPartAddedEvent {
9299    /// The type of the event.
9300    pub r#type: String,
9301
9302    /// The ID of the output item that the content part was added to.
9303    pub r#item_id: String,
9304
9305    /// The index of the output item that the content part was added to.
9306    pub r#output_index: i64,
9307
9308    /// The index of the content part that was added.
9309    pub r#content_index: i64,
9310
9311    /// The content part that was added.
9312    pub r#part: OutputContent,
9313}
9314
9315/// Emitted when a content part is done.
9316#[derive(Clone, Debug)]
9317#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9318pub struct ResponseContentPartDoneEvent {
9319    /// The type of the event.
9320    pub r#type: String,
9321
9322    /// The ID of the output item that the content part was added to.
9323    pub r#item_id: String,
9324
9325    /// The index of the output item that the content part was added to.
9326    pub r#output_index: i64,
9327
9328    /// The index of the content part that is done.
9329    pub r#content_index: i64,
9330
9331    /// The content part that is done.
9332    pub r#part: OutputContent,
9333}
9334
9335/// An event that is emitted when a response is created.
9336#[derive(Clone, Debug)]
9337#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9338pub struct ResponseCreatedEvent {
9339    /// The type of the event.
9340    pub r#type: String,
9341
9342    /// The response that was created.
9343    pub r#response: Response,
9344}
9345
9346/// An error object returned when the model fails to generate a Response.
9347#[derive(Clone, Debug)]
9348#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9349pub struct ResponseError {
9350    pub r#code: ResponseErrorCode,
9351
9352    /// A human-readable description of the error.
9353    pub r#message: String,
9354}
9355
9356/// The error code for the response.
9357#[derive(Clone, Debug)]
9358#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9359pub struct ResponseErrorCode(pub String);
9360
9361/// Emitted when an error occurs.
9362#[derive(Clone, Debug, Default)]
9363#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9364pub struct ResponseErrorEvent {
9365    /// The type of the event.
9366    pub r#type: String,
9367
9368    /// The error code.
9369    pub r#code: Option<String>,
9370
9371    /// The error message.
9372    pub r#message: String,
9373
9374    /// The error parameter.
9375    pub r#param: Option<String>,
9376}
9377
9378/// An event that is emitted when a response fails.
9379#[derive(Clone, Debug)]
9380#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9381pub struct ResponseFailedEvent {
9382    /// The type of the event.
9383    pub r#type: String,
9384
9385    /// The response that failed.
9386    pub r#response: Response,
9387}
9388
9389/// Emitted when a file search call is completed (results found).
9390#[derive(Clone, Debug, Default)]
9391#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9392pub struct ResponseFileSearchCallCompletedEvent {
9393    /// The type of the event.
9394    pub r#type: String,
9395
9396    /// The index of the output item that the file search call is initiated.
9397    pub r#output_index: i64,
9398
9399    /// The ID of the output item that the file search call is initiated.
9400    pub r#item_id: String,
9401}
9402
9403/// Emitted when a file search call is initiated.
9404#[derive(Clone, Debug, Default)]
9405#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9406pub struct ResponseFileSearchCallInProgressEvent {
9407    /// The type of the event.
9408    pub r#type: String,
9409
9410    /// The index of the output item that the file search call is initiated.
9411    pub r#output_index: i64,
9412
9413    /// The ID of the output item that the file search call is initiated.
9414    pub r#item_id: String,
9415}
9416
9417/// Emitted when a file search is currently searching.
9418#[derive(Clone, Debug, Default)]
9419#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9420pub struct ResponseFileSearchCallSearchingEvent {
9421    /// The type of the event.
9422    pub r#type: String,
9423
9424    /// The index of the output item that the file search call is searching.
9425    pub r#output_index: i64,
9426
9427    /// The ID of the output item that the file search call is initiated.
9428    pub r#item_id: String,
9429}
9430
9431/// JSON object response format.
9432#[derive(Clone, Debug, Default)]
9433#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9434pub struct ResponseFormatJsonObject {
9435    /// The type of response format being defined.
9436    pub r#type: String,
9437}
9438
9439/// JSON Schema response format.
9440#[derive(Clone, Debug)]
9441#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9442pub struct ResponseFormatJsonSchema {
9443    /// The type of response format being defined.
9444    pub r#type: String,
9445
9446    pub r#json_schema: ResponseFormatJsonSchema_JsonSchema,
9447}
9448
9449/// The schema for the response format, described as a JSON Schema object.
9450#[derive(Clone, Debug, Default)]
9451#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9452pub struct ResponseFormatJsonSchemaSchema;
9453
9454/// Structured Outputs configuration options, including a JSON Schema.
9455#[derive(Clone, Debug)]
9456#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9457pub struct ResponseFormatJsonSchema_JsonSchema {
9458    /// A description of what the response format is for, used by the model to
9459    /// determine how to respond in the format.
9460    pub r#description: String,
9461
9462    /// The name of the response format.
9463    pub r#name: String,
9464
9465    pub r#schema: ResponseFormatJsonSchemaSchema,
9466
9467    /// Whether to enable strict schema adherence when generating the output.
9468    pub r#strict: Option<bool>,
9469}
9470
9471/// Default response format.
9472#[derive(Clone, Debug, Default)]
9473#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9474pub struct ResponseFormatText {
9475    /// The type of response format being defined.
9476    pub r#type: String,
9477}
9478
9479/// Emitted when there is a partial function-call arguments delta.
9480#[derive(Clone, Debug, Default)]
9481#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9482pub struct ResponseFunctionCallArgumentsDeltaEvent {
9483    /// The type of the event.
9484    pub r#type: String,
9485
9486    /// The ID of the output item that the function-call arguments delta is
9487    /// added to.
9488    pub r#item_id: String,
9489
9490    /// The index of the output item that the function-call arguments delta is
9491    /// added to.
9492    pub r#output_index: i64,
9493
9494    /// The function-call arguments delta that is added.
9495    pub r#delta: String,
9496}
9497
9498/// Emitted when function-call arguments are finalized.
9499#[derive(Clone, Debug, Default)]
9500#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9501pub struct ResponseFunctionCallArgumentsDoneEvent {
9502    pub r#type: String,
9503
9504    /// The ID of the item.
9505    pub r#item_id: String,
9506
9507    /// The index of the output item.
9508    pub r#output_index: i64,
9509
9510    /// The function-call arguments.
9511    pub r#arguments: String,
9512}
9513
9514/// Emitted when the response is in progress.
9515#[derive(Clone, Debug)]
9516#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9517pub struct ResponseInProgressEvent {
9518    /// The type of the event.
9519    pub r#type: String,
9520
9521    /// The response that is in progress.
9522    pub r#response: Response,
9523}
9524
9525/// An event that is emitted when a response finishes as incomplete.
9526#[derive(Clone, Debug)]
9527#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9528pub struct ResponseIncompleteEvent {
9529    /// The type of the event.
9530    pub r#type: String,
9531
9532    /// The response that was incomplete.
9533    pub r#response: Response,
9534}
9535
9536/// A list of Response items.
9537#[derive(Clone, Debug)]
9538#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9539pub struct ResponseItemList {
9540    /// The type of object returned, must be `list`.
9541    pub r#object: String,
9542
9543    /// A list of items used to generate this response.
9544    pub r#data: Vec<ItemResource>,
9545
9546    /// Whether there are more items available.
9547    pub r#has_more: bool,
9548
9549    /// The ID of the first item in the list.
9550    pub r#first_id: String,
9551
9552    /// The ID of the last item in the list.
9553    pub r#last_id: String,
9554}
9555
9556/// Output types that you would like the model to generate.
9557#[derive(Clone, Debug)]
9558#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9559pub struct ResponseModalities(pub Vec<String>);
9560
9561/// Emitted when a new output item is added.
9562#[derive(Clone, Debug)]
9563#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9564pub struct ResponseOutputItemAddedEvent {
9565    /// The type of the event.
9566    pub r#type: String,
9567
9568    /// The index of the output item that was added.
9569    pub r#output_index: i64,
9570
9571    /// The output item that was added.
9572    pub r#item: OutputItem,
9573}
9574
9575/// Emitted when an output item is marked done.
9576#[derive(Clone, Debug)]
9577#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9578pub struct ResponseOutputItemDoneEvent {
9579    /// The type of the event.
9580    pub r#type: String,
9581
9582    /// The index of the output item that was marked done.
9583    pub r#output_index: i64,
9584
9585    /// The output item that was marked done.
9586    pub r#item: OutputItem,
9587}
9588
9589#[derive(Clone, Debug)]
9590#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9591pub struct ResponseProperties {
9592    /// The unique ID of the previous response to the model.
9593    pub r#previous_response_id: Option<String>,
9594
9595    /// Model ID used to generate the response, like `gpt-4o` or `o3`.
9596    pub r#model: ModelIdsResponses,
9597
9598    pub r#reasoning: Option<Reasoning>,
9599
9600    /// An upper bound for the number of tokens that can be generated for a
9601    /// response, including visible output tokens and [reasoning
9602    /// tokens](/docs/guides/reasoning).
9603    pub r#max_output_tokens: Option<i64>,
9604
9605    /// Inserts a system (or developer) message as the first item in the model's
9606    /// context.
9607    pub r#instructions: Option<String>,
9608
9609    pub r#text: ResponseProperties_Text,
9610
9611    /// An array of tools the model may call while generating a response.
9612    pub r#tools: Vec<Tool>,
9613
9614    pub r#tool_choice: ResponseProperties_ToolChoice,
9615
9616    /// The truncation strategy to use for the model response.
9617    pub r#truncation: Option<String>,
9618}
9619
9620/// Configuration options for a text response from the model.
9621#[derive(Clone, Debug)]
9622#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9623pub struct ResponseProperties_Text {
9624    pub r#format: TextResponseFormatConfiguration,
9625}
9626
9627/// How the model should select which tool (or tools) to use when generating a
9628/// response.
9629#[derive(Clone, Debug)]
9630#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9631pub enum ResponseProperties_ToolChoice {
9632    ToolChoiceOptions(ToolChoiceOptions),
9633
9634    ToolChoiceTypes(ToolChoiceTypes),
9635
9636    ToolChoiceFunction(ToolChoiceFunction),
9637}
9638
9639/// Emitted when a new reasoning summary part is added.
9640#[derive(Clone, Debug)]
9641#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9642pub struct ResponseReasoningSummaryPartAddedEvent {
9643    /// The type of the event.
9644    pub r#type: String,
9645
9646    /// The ID of the item this summary part is associated with.
9647    pub r#item_id: String,
9648
9649    /// The index of the output item this summary part is associated with.
9650    pub r#output_index: i64,
9651
9652    /// The index of the summary part within the reasoning summary.
9653    pub r#summary_index: i64,
9654
9655    pub r#part: ResponseReasoningSummaryPartAddedEvent_Part,
9656}
9657
9658/// The summary part that was added.
9659#[derive(Clone, Debug, Default)]
9660#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9661pub struct ResponseReasoningSummaryPartAddedEvent_Part {
9662    /// The type of the summary part.
9663    pub r#type: String,
9664
9665    /// The text of the summary part.
9666    pub r#text: String,
9667}
9668
9669/// Emitted when a reasoning summary part is completed.
9670#[derive(Clone, Debug)]
9671#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9672pub struct ResponseReasoningSummaryPartDoneEvent {
9673    /// The type of the event.
9674    pub r#type: String,
9675
9676    /// The ID of the item this summary part is associated with.
9677    pub r#item_id: String,
9678
9679    /// The index of the output item this summary part is associated with.
9680    pub r#output_index: i64,
9681
9682    /// The index of the summary part within the reasoning summary.
9683    pub r#summary_index: i64,
9684
9685    pub r#part: ResponseReasoningSummaryPartDoneEvent_Part,
9686}
9687
9688/// The completed summary part.
9689#[derive(Clone, Debug, Default)]
9690#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9691pub struct ResponseReasoningSummaryPartDoneEvent_Part {
9692    /// The type of the summary part.
9693    pub r#type: String,
9694
9695    /// The text of the summary part.
9696    pub r#text: String,
9697}
9698
9699/// Emitted when a delta is added to a reasoning summary text.
9700#[derive(Clone, Debug, Default)]
9701#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9702pub struct ResponseReasoningSummaryTextDeltaEvent {
9703    /// The type of the event.
9704    pub r#type: String,
9705
9706    /// The ID of the item this summary text delta is associated with.
9707    pub r#item_id: String,
9708
9709    /// The index of the output item this summary text delta is associated with.
9710    pub r#output_index: i64,
9711
9712    /// The index of the summary part within the reasoning summary.
9713    pub r#summary_index: i64,
9714
9715    /// The text delta that was added to the summary.
9716    pub r#delta: String,
9717}
9718
9719/// Emitted when a reasoning summary text is completed.
9720#[derive(Clone, Debug, Default)]
9721#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9722pub struct ResponseReasoningSummaryTextDoneEvent {
9723    /// The type of the event.
9724    pub r#type: String,
9725
9726    /// The ID of the item this summary text is associated with.
9727    pub r#item_id: String,
9728
9729    /// The index of the output item this summary text is associated with.
9730    pub r#output_index: i64,
9731
9732    /// The index of the summary part within the reasoning summary.
9733    pub r#summary_index: i64,
9734
9735    /// The full text of the completed reasoning summary.
9736    pub r#text: String,
9737}
9738
9739/// Emitted when there is a partial refusal text.
9740#[derive(Clone, Debug, Default)]
9741#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9742pub struct ResponseRefusalDeltaEvent {
9743    /// The type of the event.
9744    pub r#type: String,
9745
9746    /// The ID of the output item that the refusal text is added to.
9747    pub r#item_id: String,
9748
9749    /// The index of the output item that the refusal text is added to.
9750    pub r#output_index: i64,
9751
9752    /// The index of the content part that the refusal text is added to.
9753    pub r#content_index: i64,
9754
9755    /// The refusal text that is added.
9756    pub r#delta: String,
9757}
9758
9759/// Emitted when refusal text is finalized.
9760#[derive(Clone, Debug, Default)]
9761#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9762pub struct ResponseRefusalDoneEvent {
9763    /// The type of the event.
9764    pub r#type: String,
9765
9766    /// The ID of the output item that the refusal text is finalized.
9767    pub r#item_id: String,
9768
9769    /// The index of the output item that the refusal text is finalized.
9770    pub r#output_index: i64,
9771
9772    /// The index of the content part that the refusal text is finalized.
9773    pub r#content_index: i64,
9774
9775    /// The refusal text that is finalized.
9776    pub r#refusal: String,
9777}
9778
9779#[derive(Clone, Debug)]
9780#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9781pub enum ResponseStreamEvent {
9782    ResponseAudioDeltaEvent(ResponseAudioDeltaEvent),
9783
9784    ResponseAudioDoneEvent(ResponseAudioDoneEvent),
9785
9786    ResponseAudioTranscriptDeltaEvent(ResponseAudioTranscriptDeltaEvent),
9787
9788    ResponseAudioTranscriptDoneEvent(ResponseAudioTranscriptDoneEvent),
9789
9790    ResponseCodeInterpreterCallCodeDeltaEvent(ResponseCodeInterpreterCallCodeDeltaEvent),
9791
9792    ResponseCodeInterpreterCallCodeDoneEvent(ResponseCodeInterpreterCallCodeDoneEvent),
9793
9794    ResponseCodeInterpreterCallCompletedEvent(ResponseCodeInterpreterCallCompletedEvent),
9795
9796    ResponseCodeInterpreterCallInProgressEvent(ResponseCodeInterpreterCallInProgressEvent),
9797
9798    ResponseCodeInterpreterCallInterpretingEvent(ResponseCodeInterpreterCallInterpretingEvent),
9799
9800    ResponseCompletedEvent(ResponseCompletedEvent),
9801
9802    ResponseContentPartAddedEvent(ResponseContentPartAddedEvent),
9803
9804    ResponseContentPartDoneEvent(ResponseContentPartDoneEvent),
9805
9806    ResponseCreatedEvent(ResponseCreatedEvent),
9807
9808    ResponseErrorEvent(ResponseErrorEvent),
9809
9810    ResponseFileSearchCallCompletedEvent(ResponseFileSearchCallCompletedEvent),
9811
9812    ResponseFileSearchCallInProgressEvent(ResponseFileSearchCallInProgressEvent),
9813
9814    ResponseFileSearchCallSearchingEvent(ResponseFileSearchCallSearchingEvent),
9815
9816    ResponseFunctionCallArgumentsDeltaEvent(ResponseFunctionCallArgumentsDeltaEvent),
9817
9818    ResponseFunctionCallArgumentsDoneEvent(ResponseFunctionCallArgumentsDoneEvent),
9819
9820    ResponseInProgressEvent(ResponseInProgressEvent),
9821
9822    ResponseFailedEvent(ResponseFailedEvent),
9823
9824    ResponseIncompleteEvent(ResponseIncompleteEvent),
9825
9826    ResponseOutputItemAddedEvent(ResponseOutputItemAddedEvent),
9827
9828    ResponseOutputItemDoneEvent(ResponseOutputItemDoneEvent),
9829
9830    ResponseReasoningSummaryPartAddedEvent(ResponseReasoningSummaryPartAddedEvent),
9831
9832    ResponseReasoningSummaryPartDoneEvent(ResponseReasoningSummaryPartDoneEvent),
9833
9834    ResponseReasoningSummaryTextDeltaEvent(ResponseReasoningSummaryTextDeltaEvent),
9835
9836    ResponseReasoningSummaryTextDoneEvent(ResponseReasoningSummaryTextDoneEvent),
9837
9838    ResponseRefusalDeltaEvent(ResponseRefusalDeltaEvent),
9839
9840    ResponseRefusalDoneEvent(ResponseRefusalDoneEvent),
9841
9842    ResponseTextAnnotationDeltaEvent(ResponseTextAnnotationDeltaEvent),
9843
9844    ResponseTextDeltaEvent(ResponseTextDeltaEvent),
9845
9846    ResponseTextDoneEvent(ResponseTextDoneEvent),
9847
9848    ResponseWebSearchCallCompletedEvent(ResponseWebSearchCallCompletedEvent),
9849
9850    ResponseWebSearchCallInProgressEvent(ResponseWebSearchCallInProgressEvent),
9851
9852    ResponseWebSearchCallSearchingEvent(ResponseWebSearchCallSearchingEvent),
9853}
9854
9855/// Emitted when a text annotation is added.
9856#[derive(Clone, Debug)]
9857#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9858pub struct ResponseTextAnnotationDeltaEvent {
9859    /// The type of the event.
9860    pub r#type: String,
9861
9862    /// The ID of the output item that the text annotation was added to.
9863    pub r#item_id: String,
9864
9865    /// The index of the output item that the text annotation was added to.
9866    pub r#output_index: i64,
9867
9868    /// The index of the content part that the text annotation was added to.
9869    pub r#content_index: i64,
9870
9871    /// The index of the annotation that was added.
9872    pub r#annotation_index: i64,
9873
9874    pub r#annotation: Annotation,
9875}
9876
9877/// Emitted when there is an additional text delta.
9878#[derive(Clone, Debug, Default)]
9879#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9880pub struct ResponseTextDeltaEvent {
9881    /// The type of the event.
9882    pub r#type: String,
9883
9884    /// The ID of the output item that the text delta was added to.
9885    pub r#item_id: String,
9886
9887    /// The index of the output item that the text delta was added to.
9888    pub r#output_index: i64,
9889
9890    /// The index of the content part that the text delta was added to.
9891    pub r#content_index: i64,
9892
9893    /// The text delta that was added.
9894    pub r#delta: String,
9895}
9896
9897/// Emitted when text content is finalized.
9898#[derive(Clone, Debug, Default)]
9899#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9900pub struct ResponseTextDoneEvent {
9901    /// The type of the event.
9902    pub r#type: String,
9903
9904    /// The ID of the output item that the text content is finalized.
9905    pub r#item_id: String,
9906
9907    /// The index of the output item that the text content is finalized.
9908    pub r#output_index: i64,
9909
9910    /// The index of the content part that the text content is finalized.
9911    pub r#content_index: i64,
9912
9913    /// The text content that is finalized.
9914    pub r#text: String,
9915}
9916
9917/// Represents token usage details including input tokens, output tokens, a
9918/// breakdown of output tokens, and the total tokens used.
9919#[derive(Clone, Debug)]
9920#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9921pub struct ResponseUsage {
9922    /// The number of input tokens.
9923    pub r#input_tokens: i64,
9924
9925    pub r#input_tokens_details: ResponseUsage_InputTokensDetails,
9926
9927    /// The number of output tokens.
9928    pub r#output_tokens: i64,
9929
9930    pub r#output_tokens_details: ResponseUsage_OutputTokensDetails,
9931
9932    /// The total number of tokens used.
9933    pub r#total_tokens: i64,
9934}
9935
9936/// A detailed breakdown of the input tokens.
9937#[derive(Clone, Debug, Default)]
9938#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9939pub struct ResponseUsage_InputTokensDetails {
9940    /// The number of tokens that were retrieved from the cache.
9941    pub r#cached_tokens: i64,
9942}
9943
9944/// A detailed breakdown of the output tokens.
9945#[derive(Clone, Debug, Default)]
9946#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9947pub struct ResponseUsage_OutputTokensDetails {
9948    /// The number of reasoning tokens.
9949    pub r#reasoning_tokens: i64,
9950}
9951
9952/// Emitted when a web search call is completed.
9953#[derive(Clone, Debug, Default)]
9954#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9955pub struct ResponseWebSearchCallCompletedEvent {
9956    /// The type of the event.
9957    pub r#type: String,
9958
9959    /// The index of the output item that the web search call is associated
9960    /// with.
9961    pub r#output_index: i64,
9962
9963    /// Unique ID for the output item associated with the web search call.
9964    pub r#item_id: String,
9965}
9966
9967/// Emitted when a web search call is initiated.
9968#[derive(Clone, Debug, Default)]
9969#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9970pub struct ResponseWebSearchCallInProgressEvent {
9971    /// The type of the event.
9972    pub r#type: String,
9973
9974    /// The index of the output item that the web search call is associated
9975    /// with.
9976    pub r#output_index: i64,
9977
9978    /// Unique ID for the output item associated with the web search call.
9979    pub r#item_id: String,
9980}
9981
9982/// Emitted when a web search call is executing.
9983#[derive(Clone, Debug, Default)]
9984#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9985pub struct ResponseWebSearchCallSearchingEvent {
9986    /// The type of the event.
9987    pub r#type: String,
9988
9989    /// The index of the output item that the web search call is associated
9990    /// with.
9991    pub r#output_index: i64,
9992
9993    /// Unique ID for the output item associated with the web search call.
9994    pub r#item_id: String,
9995}
9996
9997#[derive(Clone, Debug)]
9998#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9999pub struct Response_Variant3 {
10000    /// Unique identifier for this Response.
10001    pub r#id: String,
10002
10003    /// The object type of this resource - always set to `response`.
10004    pub r#object: String,
10005
10006    /// The status of the response generation.
10007    pub r#status: String,
10008
10009    /// Unix timestamp (in seconds) of when this Response was created.
10010    pub r#created_at: f64,
10011
10012    pub r#error: Option<ResponseError>,
10013
10014    pub r#incomplete_details: Option<Response_Variant3_IncompleteDetails>,
10015
10016    /// An array of content items generated by the model.
10017    pub r#output: Vec<OutputItem>,
10018
10019    /// SDK-only convenience property that contains the aggregated text output
10020    /// from all `output_text` items in the `output` array, if any are present.
10021    pub r#output_text: Option<String>,
10022
10023    pub r#usage: ResponseUsage,
10024
10025    /// Whether to allow the model to run tool calls in parallel.
10026    pub r#parallel_tool_calls: bool,
10027}
10028
10029/// Details about why the response is incomplete.
10030#[derive(Clone, Debug, Default)]
10031#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10032pub struct Response_Variant3_IncompleteDetails {
10033    /// The reason why the response is incomplete.
10034    pub r#reason: String,
10035}
10036
10037/// Usage statistics related to the run.
10038#[derive(Clone, Debug, Default)]
10039#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10040pub struct RunCompletionUsage {
10041    /// Number of completion tokens used over the course of the run.
10042    pub r#completion_tokens: i64,
10043
10044    /// Number of prompt tokens used over the course of the run.
10045    pub r#prompt_tokens: i64,
10046
10047    /// Total number of tokens used (prompt + completion).
10048    pub r#total_tokens: i64,
10049}
10050
10051/// Represents an execution run on a [thread](/docs/api-reference/threads).
10052#[derive(Clone, Debug)]
10053#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10054pub struct RunObject {
10055    /// The identifier, which can be referenced in API endpoints.
10056    pub r#id: String,
10057
10058    /// The object type, which is always `thread.run`.
10059    pub r#object: String,
10060
10061    /// The Unix timestamp (in seconds) for when the run was created.
10062    pub r#created_at: i64,
10063
10064    /// The ID of the [thread](/docs/api-reference/threads) that was executed on
10065    /// as a part of this run.
10066    pub r#thread_id: String,
10067
10068    /// The ID of the [assistant](/docs/api-reference/assistants) used for
10069    /// execution of this run.
10070    pub r#assistant_id: String,
10071
10072    /// The status of the run, which can be either `queued`, `in_progress`,
10073    /// `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`,
10074    /// `incomplete`, or `expired`.
10075    pub r#status: String,
10076
10077    pub r#required_action: Option<RunObject_RequiredAction>,
10078
10079    pub r#last_error: Option<RunObject_LastError>,
10080
10081    /// The Unix timestamp (in seconds) for when the run will expire.
10082    pub r#expires_at: Option<i64>,
10083
10084    /// The Unix timestamp (in seconds) for when the run was started.
10085    pub r#started_at: Option<i64>,
10086
10087    /// The Unix timestamp (in seconds) for when the run was cancelled.
10088    pub r#cancelled_at: Option<i64>,
10089
10090    /// The Unix timestamp (in seconds) for when the run failed.
10091    pub r#failed_at: Option<i64>,
10092
10093    /// The Unix timestamp (in seconds) for when the run was completed.
10094    pub r#completed_at: Option<i64>,
10095
10096    pub r#incomplete_details: Option<RunObject_IncompleteDetails>,
10097
10098    /// The model that the [assistant](/docs/api-reference/assistants) used for
10099    /// this run.
10100    pub r#model: String,
10101
10102    /// The instructions that the [assistant](/docs/api-reference/assistants)
10103    /// used for this run.
10104    pub r#instructions: String,
10105
10106    /// The list of tools that the [assistant](/docs/api-reference/assistants)
10107    /// used for this run.
10108    pub r#tools: Vec<RunObject_Tools>,
10109
10110    pub r#metadata: Option<Metadata>,
10111
10112    pub r#usage: Option<RunCompletionUsage>,
10113
10114    /// The sampling temperature used for this run.
10115    pub r#temperature: Option<f64>,
10116
10117    /// The nucleus sampling value used for this run.
10118    pub r#top_p: Option<f64>,
10119
10120    /// The maximum number of prompt tokens specified to have been used over the
10121    /// course of the run.
10122    pub r#max_prompt_tokens: Option<i64>,
10123
10124    /// The maximum number of completion tokens specified to have been used over
10125    /// the course of the run.
10126    pub r#max_completion_tokens: Option<i64>,
10127
10128    pub r#truncation_strategy: RunObject_TruncationStrategy,
10129
10130    pub r#tool_choice: RunObject_ToolChoice,
10131
10132    pub r#parallel_tool_calls: ParallelToolCalls,
10133
10134    pub r#response_format: Option<AssistantsApiResponseFormatOption>,
10135}
10136
10137/// Details on why the run is incomplete.
10138#[derive(Clone, Debug, Default)]
10139#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10140pub struct RunObject_IncompleteDetails {
10141    /// The reason why the run is incomplete.
10142    pub r#reason: String,
10143}
10144
10145/// The last error associated with this run.
10146#[derive(Clone, Debug, Default)]
10147#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10148pub struct RunObject_LastError {
10149    /// One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.
10150    pub r#code: String,
10151
10152    /// A human-readable description of the error.
10153    pub r#message: String,
10154}
10155
10156/// Details on the action required to continue the run.
10157#[derive(Clone, Debug)]
10158#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10159pub struct RunObject_RequiredAction {
10160    /// For now, this is always `submit_tool_outputs`.
10161    pub r#type: String,
10162
10163    pub r#submit_tool_outputs: RunObject_RequiredAction_SubmitToolOutputs,
10164}
10165
10166/// Details on the tool outputs needed for this run to continue.
10167#[derive(Clone, Debug)]
10168#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10169pub struct RunObject_RequiredAction_SubmitToolOutputs {
10170    /// A list of the relevant tool calls.
10171    pub r#tool_calls: Vec<RunToolCallObject>,
10172}
10173
10174#[derive(Clone, Debug, Default)]
10175#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10176pub struct RunObject_ToolChoice(pub (/*AllOf*/));
10177
10178#[derive(Clone, Debug)]
10179#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10180pub enum RunObject_Tools {
10181    AssistantToolsCode(AssistantToolsCode),
10182
10183    AssistantToolsFileSearch(AssistantToolsFileSearch),
10184
10185    AssistantToolsFunction(AssistantToolsFunction),
10186}
10187
10188#[derive(Clone, Debug, Default)]
10189#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10190pub struct RunObject_TruncationStrategy(pub (/*AllOf*/));
10191
10192/// Usage statistics related to the run step.
10193#[derive(Clone, Debug, Default)]
10194#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10195pub struct RunStepCompletionUsage {
10196    /// Number of completion tokens used over the course of the run step.
10197    pub r#completion_tokens: i64,
10198
10199    /// Number of prompt tokens used over the course of the run step.
10200    pub r#prompt_tokens: i64,
10201
10202    /// Total number of tokens used (prompt + completion).
10203    pub r#total_tokens: i64,
10204}
10205
10206/// Represents a run step delta i.e.
10207#[derive(Clone, Debug)]
10208#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10209pub struct RunStepDeltaObject {
10210    /// The identifier of the run step, which can be referenced in API
10211    /// endpoints.
10212    pub r#id: String,
10213
10214    /// The object type, which is always `thread.run.step.delta`.
10215    pub r#object: String,
10216
10217    pub r#delta: RunStepDeltaObject_Delta,
10218}
10219
10220/// The delta containing the fields that have changed on the run step.
10221#[derive(Clone, Debug)]
10222#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10223pub struct RunStepDeltaObject_Delta {
10224    pub r#step_details: RunStepDeltaObject_Delta_StepDetails,
10225}
10226
10227/// The details of the run step.
10228#[derive(Clone, Debug, Default)]
10229#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10230pub struct RunStepDeltaObject_Delta_StepDetails;
10231
10232/// Details of the message creation by the run step.
10233#[derive(Clone, Debug)]
10234#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10235pub struct RunStepDeltaStepDetailsMessageCreationObject {
10236    /// Always `message_creation`.
10237    pub r#type: String,
10238
10239    pub r#message_creation: RunStepDeltaStepDetailsMessageCreationObject_MessageCreation,
10240}
10241
10242#[derive(Clone, Debug, Default)]
10243#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10244pub struct RunStepDeltaStepDetailsMessageCreationObject_MessageCreation {
10245    /// The ID of the message that was created by this run step.
10246    pub r#message_id: String,
10247}
10248
10249/// Details of the Code Interpreter tool call the run step was involved in.
10250#[derive(Clone, Debug)]
10251#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10252pub struct RunStepDeltaStepDetailsToolCallsCodeObject {
10253    /// The index of the tool call in the tool calls array.
10254    pub r#index: i64,
10255
10256    /// The ID of the tool call.
10257    pub r#id: String,
10258
10259    /// The type of tool call.
10260    pub r#type: String,
10261
10262    pub r#code_interpreter: RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter,
10263}
10264
10265/// The Code Interpreter tool call definition.
10266#[derive(Clone, Debug)]
10267#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10268pub struct RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter {
10269    /// The input to the Code Interpreter tool call.
10270    pub r#input: String,
10271
10272    /// The outputs from the Code Interpreter tool call.
10273    pub r#outputs: Vec<RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs>,
10274}
10275
10276#[derive(Clone, Debug, Default)]
10277#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10278pub struct RunStepDeltaStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs;
10279
10280#[derive(Clone, Debug)]
10281#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10282pub struct RunStepDeltaStepDetailsToolCallsCodeOutputImageObject {
10283    /// The index of the output in the outputs array.
10284    pub r#index: i64,
10285
10286    /// Always `image`.
10287    pub r#type: String,
10288
10289    pub r#image: RunStepDeltaStepDetailsToolCallsCodeOutputImageObject_Image,
10290}
10291
10292#[derive(Clone, Debug, Default)]
10293#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10294pub struct RunStepDeltaStepDetailsToolCallsCodeOutputImageObject_Image {
10295    /// The [file](/docs/api-reference/files) ID of the image.
10296    pub r#file_id: String,
10297}
10298
10299/// Text output from the Code Interpreter tool call as part of a run step.
10300#[derive(Clone, Debug, Default)]
10301#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10302pub struct RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject {
10303    /// The index of the output in the outputs array.
10304    pub r#index: i64,
10305
10306    /// Always `logs`.
10307    pub r#type: String,
10308
10309    /// The text output from the Code Interpreter tool call.
10310    pub r#logs: String,
10311}
10312
10313#[derive(Clone, Debug)]
10314#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10315pub struct RunStepDeltaStepDetailsToolCallsFileSearchObject {
10316    /// The index of the tool call in the tool calls array.
10317    pub r#index: i64,
10318
10319    /// The ID of the tool call object.
10320    pub r#id: String,
10321
10322    /// The type of tool call.
10323    pub r#type: String,
10324
10325    /// For now, this is always going to be an empty object.
10326    pub r#file_search: RunStepDeltaStepDetailsToolCallsFileSearchObject_FileSearch,
10327}
10328
10329/// For now, this is always going to be an empty object.
10330#[derive(Clone, Debug, Default)]
10331#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10332pub struct RunStepDeltaStepDetailsToolCallsFileSearchObject_FileSearch;
10333
10334#[derive(Clone, Debug)]
10335#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10336pub struct RunStepDeltaStepDetailsToolCallsFunctionObject {
10337    /// The index of the tool call in the tool calls array.
10338    pub r#index: i64,
10339
10340    /// The ID of the tool call object.
10341    pub r#id: String,
10342
10343    /// The type of tool call.
10344    pub r#type: String,
10345
10346    pub r#function: RunStepDeltaStepDetailsToolCallsFunctionObject_Function,
10347}
10348
10349/// The definition of the function that was called.
10350#[derive(Clone, Debug, Default)]
10351#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10352pub struct RunStepDeltaStepDetailsToolCallsFunctionObject_Function {
10353    /// The name of the function.
10354    pub r#name: String,
10355
10356    /// The arguments passed to the function.
10357    pub r#arguments: String,
10358
10359    /// The output of the function.
10360    pub r#output: Option<String>,
10361}
10362
10363/// Details of the tool call.
10364#[derive(Clone, Debug)]
10365#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10366pub struct RunStepDeltaStepDetailsToolCallsObject {
10367    /// Always `tool_calls`.
10368    pub r#type: String,
10369
10370    /// An array of tool calls the run step was involved in.
10371    pub r#tool_calls: Vec<RunStepDeltaStepDetailsToolCallsObject_ToolCalls>,
10372}
10373
10374#[derive(Clone, Debug)]
10375#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10376pub enum RunStepDeltaStepDetailsToolCallsObject_ToolCalls {
10377    RunStepDeltaStepDetailsToolCallsCodeObject(RunStepDeltaStepDetailsToolCallsCodeObject),
10378
10379    RunStepDeltaStepDetailsToolCallsFileSearchObject(RunStepDeltaStepDetailsToolCallsFileSearchObject),
10380
10381    RunStepDeltaStepDetailsToolCallsFunctionObject(RunStepDeltaStepDetailsToolCallsFunctionObject),
10382}
10383
10384/// Details of the message creation by the run step.
10385#[derive(Clone, Debug)]
10386#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10387pub struct RunStepDetailsMessageCreationObject {
10388    /// Always `message_creation`.
10389    pub r#type: String,
10390
10391    pub r#message_creation: RunStepDetailsMessageCreationObject_MessageCreation,
10392}
10393
10394#[derive(Clone, Debug, Default)]
10395#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10396pub struct RunStepDetailsMessageCreationObject_MessageCreation {
10397    /// The ID of the message that was created by this run step.
10398    pub r#message_id: String,
10399}
10400
10401/// Details of the Code Interpreter tool call the run step was involved in.
10402#[derive(Clone, Debug)]
10403#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10404pub struct RunStepDetailsToolCallsCodeObject {
10405    /// The ID of the tool call.
10406    pub r#id: String,
10407
10408    /// The type of tool call.
10409    pub r#type: String,
10410
10411    pub r#code_interpreter: RunStepDetailsToolCallsCodeObject_CodeInterpreter,
10412}
10413
10414/// The Code Interpreter tool call definition.
10415#[derive(Clone, Debug)]
10416#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10417pub struct RunStepDetailsToolCallsCodeObject_CodeInterpreter {
10418    /// The input to the Code Interpreter tool call.
10419    pub r#input: String,
10420
10421    /// The outputs from the Code Interpreter tool call.
10422    pub r#outputs: Vec<RunStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs>,
10423}
10424
10425#[derive(Clone, Debug, Default)]
10426#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10427pub struct RunStepDetailsToolCallsCodeObject_CodeInterpreter_Outputs;
10428
10429#[derive(Clone, Debug)]
10430#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10431pub struct RunStepDetailsToolCallsCodeOutputImageObject {
10432    /// Always `image`.
10433    pub r#type: String,
10434
10435    pub r#image: RunStepDetailsToolCallsCodeOutputImageObject_Image,
10436}
10437
10438#[derive(Clone, Debug, Default)]
10439#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10440pub struct RunStepDetailsToolCallsCodeOutputImageObject_Image {
10441    /// The [file](/docs/api-reference/files) ID of the image.
10442    pub r#file_id: String,
10443}
10444
10445/// Text output from the Code Interpreter tool call as part of a run step.
10446#[derive(Clone, Debug, Default)]
10447#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10448pub struct RunStepDetailsToolCallsCodeOutputLogsObject {
10449    /// Always `logs`.
10450    pub r#type: String,
10451
10452    /// The text output from the Code Interpreter tool call.
10453    pub r#logs: String,
10454}
10455
10456#[derive(Clone, Debug)]
10457#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10458pub struct RunStepDetailsToolCallsFileSearchObject {
10459    /// The ID of the tool call object.
10460    pub r#id: String,
10461
10462    /// The type of tool call.
10463    pub r#type: String,
10464
10465    pub r#file_search: RunStepDetailsToolCallsFileSearchObject_FileSearch,
10466}
10467
10468/// For now, this is always going to be an empty object.
10469#[derive(Clone, Debug)]
10470#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10471pub struct RunStepDetailsToolCallsFileSearchObject_FileSearch {
10472    pub r#ranking_options: RunStepDetailsToolCallsFileSearchRankingOptionsObject,
10473
10474    /// The results of the file search.
10475    pub r#results: Vec<RunStepDetailsToolCallsFileSearchResultObject>,
10476}
10477
10478/// The ranking options for the file search.
10479#[derive(Clone, Debug)]
10480#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10481pub struct RunStepDetailsToolCallsFileSearchRankingOptionsObject {
10482    pub r#ranker: FileSearchRanker,
10483
10484    /// The score threshold for the file search.
10485    pub r#score_threshold: f64,
10486}
10487
10488/// A result instance of the file search.
10489#[derive(Clone, Debug)]
10490#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10491pub struct RunStepDetailsToolCallsFileSearchResultObject {
10492    /// The ID of the file that result was found in.
10493    pub r#file_id: String,
10494
10495    /// The name of the file that result was found in.
10496    pub r#file_name: String,
10497
10498    /// The score of the result.
10499    pub r#score: f64,
10500
10501    /// The content of the result that was found.
10502    pub r#content: Vec<RunStepDetailsToolCallsFileSearchResultObject_Content>,
10503}
10504
10505#[derive(Clone, Debug, Default)]
10506#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10507pub struct RunStepDetailsToolCallsFileSearchResultObject_Content {
10508    /// The type of the content.
10509    pub r#type: String,
10510
10511    /// The text content of the file.
10512    pub r#text: String,
10513}
10514
10515#[derive(Clone, Debug)]
10516#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10517pub struct RunStepDetailsToolCallsFunctionObject {
10518    /// The ID of the tool call object.
10519    pub r#id: String,
10520
10521    /// The type of tool call.
10522    pub r#type: String,
10523
10524    pub r#function: RunStepDetailsToolCallsFunctionObject_Function,
10525}
10526
10527/// The definition of the function that was called.
10528#[derive(Clone, Debug, Default)]
10529#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10530pub struct RunStepDetailsToolCallsFunctionObject_Function {
10531    /// The name of the function.
10532    pub r#name: String,
10533
10534    /// The arguments passed to the function.
10535    pub r#arguments: String,
10536
10537    /// The output of the function.
10538    pub r#output: Option<String>,
10539}
10540
10541/// Details of the tool call.
10542#[derive(Clone, Debug)]
10543#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10544pub struct RunStepDetailsToolCallsObject {
10545    /// Always `tool_calls`.
10546    pub r#type: String,
10547
10548    /// An array of tool calls the run step was involved in.
10549    pub r#tool_calls: Vec<RunStepDetailsToolCallsObject_ToolCalls>,
10550}
10551
10552#[derive(Clone, Debug)]
10553#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10554pub enum RunStepDetailsToolCallsObject_ToolCalls {
10555    RunStepDetailsToolCallsCodeObject(RunStepDetailsToolCallsCodeObject),
10556
10557    RunStepDetailsToolCallsFileSearchObject(RunStepDetailsToolCallsFileSearchObject),
10558
10559    RunStepDetailsToolCallsFunctionObject(RunStepDetailsToolCallsFunctionObject),
10560}
10561
10562/// Represents a step in execution of a run.
10563#[derive(Clone, Debug)]
10564#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10565pub struct RunStepObject {
10566    /// The identifier of the run step, which can be referenced in API
10567    /// endpoints.
10568    pub r#id: String,
10569
10570    /// The object type, which is always `thread.run.step`.
10571    pub r#object: String,
10572
10573    /// The Unix timestamp (in seconds) for when the run step was created.
10574    pub r#created_at: i64,
10575
10576    /// The ID of the [assistant](/docs/api-reference/assistants) associated
10577    /// with the run step.
10578    pub r#assistant_id: String,
10579
10580    /// The ID of the [thread](/docs/api-reference/threads) that was run.
10581    pub r#thread_id: String,
10582
10583    /// The ID of the [run](/docs/api-reference/runs) that this run step is a
10584    /// part of.
10585    pub r#run_id: String,
10586
10587    /// The type of run step, which can be either `message_creation` or
10588    /// `tool_calls`.
10589    pub r#type: String,
10590
10591    /// The status of the run step, which can be either `in_progress`,
10592    /// `cancelled`, `failed`, `completed`, or `expired`.
10593    pub r#status: String,
10594
10595    pub r#step_details: RunStepObject_StepDetails,
10596
10597    pub r#last_error: Option<RunStepObject_LastError>,
10598
10599    /// The Unix timestamp (in seconds) for when the run step expired.
10600    pub r#expired_at: Option<i64>,
10601
10602    /// The Unix timestamp (in seconds) for when the run step was cancelled.
10603    pub r#cancelled_at: Option<i64>,
10604
10605    /// The Unix timestamp (in seconds) for when the run step failed.
10606    pub r#failed_at: Option<i64>,
10607
10608    /// The Unix timestamp (in seconds) for when the run step completed.
10609    pub r#completed_at: Option<i64>,
10610
10611    pub r#metadata: Option<Metadata>,
10612
10613    pub r#usage: Option<RunStepCompletionUsage>,
10614}
10615
10616/// The last error associated with this run step.
10617#[derive(Clone, Debug, Default)]
10618#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10619pub struct RunStepObject_LastError {
10620    /// One of `server_error` or `rate_limit_exceeded`.
10621    pub r#code: String,
10622
10623    /// A human-readable description of the error.
10624    pub r#message: String,
10625}
10626
10627/// The details of the run step.
10628#[derive(Clone, Debug, Default)]
10629#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10630pub struct RunStepObject_StepDetails;
10631
10632include!("components/run_step_stream_event.rs");
10633
10634/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is
10635/// created.
10636#[derive(Clone, Debug)]
10637#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10638pub struct RunStepStreamEvent_Variant1 {
10639    pub r#event: String,
10640
10641    pub r#data: RunStepObject,
10642}
10643
10644/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to
10645/// an `in_progress` state.
10646#[derive(Clone, Debug)]
10647#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10648pub struct RunStepStreamEvent_Variant2 {
10649    pub r#event: String,
10650
10651    pub r#data: RunStepObject,
10652}
10653
10654/// Occurs when parts of a [run step](/docs/api-reference/run-steps/step-object)
10655/// are being streamed.
10656#[derive(Clone, Debug)]
10657#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10658pub struct RunStepStreamEvent_Variant3 {
10659    pub r#event: String,
10660
10661    pub r#data: RunStepDeltaObject,
10662}
10663
10664/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is
10665/// completed.
10666#[derive(Clone, Debug)]
10667#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10668pub struct RunStepStreamEvent_Variant4 {
10669    pub r#event: String,
10670
10671    pub r#data: RunStepObject,
10672}
10673
10674/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails.
10675#[derive(Clone, Debug)]
10676#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10677pub struct RunStepStreamEvent_Variant5 {
10678    pub r#event: String,
10679
10680    pub r#data: RunStepObject,
10681}
10682
10683/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) is
10684/// cancelled.
10685#[derive(Clone, Debug)]
10686#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10687pub struct RunStepStreamEvent_Variant6 {
10688    pub r#event: String,
10689
10690    pub r#data: RunStepObject,
10691}
10692
10693/// Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires.
10694#[derive(Clone, Debug)]
10695#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10696pub struct RunStepStreamEvent_Variant7 {
10697    pub r#event: String,
10698
10699    pub r#data: RunStepObject,
10700}
10701
10702include!("components/run_stream_event.rs");
10703
10704/// Occurs when a new [run](/docs/api-reference/runs/object) is created.
10705#[derive(Clone, Debug)]
10706#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10707pub struct RunStreamEvent_Variant1 {
10708    pub r#event: String,
10709
10710    pub r#data: RunObject,
10711}
10712
10713/// Occurs when a [run](/docs/api-reference/runs/object) expires.
10714#[derive(Clone, Debug)]
10715#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10716pub struct RunStreamEvent_Variant10 {
10717    pub r#event: String,
10718
10719    pub r#data: RunObject,
10720}
10721
10722/// Occurs when a [run](/docs/api-reference/runs/object) moves to a `queued`
10723/// status.
10724#[derive(Clone, Debug)]
10725#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10726pub struct RunStreamEvent_Variant2 {
10727    pub r#event: String,
10728
10729    pub r#data: RunObject,
10730}
10731
10732/// Occurs when a [run](/docs/api-reference/runs/object) moves to an
10733/// `in_progress` status.
10734#[derive(Clone, Debug)]
10735#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10736pub struct RunStreamEvent_Variant3 {
10737    pub r#event: String,
10738
10739    pub r#data: RunObject,
10740}
10741
10742/// Occurs when a [run](/docs/api-reference/runs/object) moves to a
10743/// `requires_action` status.
10744#[derive(Clone, Debug)]
10745#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10746pub struct RunStreamEvent_Variant4 {
10747    pub r#event: String,
10748
10749    pub r#data: RunObject,
10750}
10751
10752/// Occurs when a [run](/docs/api-reference/runs/object) is completed.
10753#[derive(Clone, Debug)]
10754#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10755pub struct RunStreamEvent_Variant5 {
10756    pub r#event: String,
10757
10758    pub r#data: RunObject,
10759}
10760
10761/// Occurs when a [run](/docs/api-reference/runs/object) ends with status
10762/// `incomplete`.
10763#[derive(Clone, Debug)]
10764#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10765pub struct RunStreamEvent_Variant6 {
10766    pub r#event: String,
10767
10768    pub r#data: RunObject,
10769}
10770
10771/// Occurs when a [run](/docs/api-reference/runs/object) fails.
10772#[derive(Clone, Debug)]
10773#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10774pub struct RunStreamEvent_Variant7 {
10775    pub r#event: String,
10776
10777    pub r#data: RunObject,
10778}
10779
10780/// Occurs when a [run](/docs/api-reference/runs/object) moves to a `cancelling`
10781/// status.
10782#[derive(Clone, Debug)]
10783#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10784pub struct RunStreamEvent_Variant8 {
10785    pub r#event: String,
10786
10787    pub r#data: RunObject,
10788}
10789
10790/// Occurs when a [run](/docs/api-reference/runs/object) is cancelled.
10791#[derive(Clone, Debug)]
10792#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10793pub struct RunStreamEvent_Variant9 {
10794    pub r#event: String,
10795
10796    pub r#data: RunObject,
10797}
10798
10799/// Tool call objects
10800#[derive(Clone, Debug)]
10801#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10802pub struct RunToolCallObject {
10803    /// The ID of the tool call.
10804    pub r#id: String,
10805
10806    /// The type of tool call the output is required for.
10807    pub r#type: String,
10808
10809    pub r#function: RunToolCallObject_Function,
10810}
10811
10812/// The function definition.
10813#[derive(Clone, Debug, Default)]
10814#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10815pub struct RunToolCallObject_Function {
10816    /// The name of the function.
10817    pub r#name: String,
10818
10819    /// The arguments that the model expects you to pass to the function.
10820    pub r#arguments: String,
10821}
10822
10823/// A screenshot action.
10824#[derive(Clone, Debug, Default)]
10825#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10826pub struct Screenshot {
10827    /// Specifies the event type.
10828    pub r#type: String,
10829}
10830
10831/// A scroll action.
10832#[derive(Clone, Debug, Default)]
10833#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10834pub struct Scroll {
10835    /// Specifies the event type.
10836    pub r#type: String,
10837
10838    /// The x-coordinate where the scroll occurred.
10839    pub r#x: i64,
10840
10841    /// The y-coordinate where the scroll occurred.
10842    pub r#y: i64,
10843
10844    /// The horizontal scroll distance.
10845    pub r#scroll_x: i64,
10846
10847    /// The vertical scroll distance.
10848    pub r#scroll_y: i64,
10849}
10850
10851/// Specifies the latency tier to use for processing the request.
10852#[derive(Clone, Debug)]
10853#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10854pub struct ServiceTier(pub String);
10855
10856#[derive(Clone, Debug, Default)]
10857#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10858pub struct StaticChunkingStrategy {
10859    /// The maximum number of tokens in each chunk.
10860    pub r#max_chunk_size_tokens: i64,
10861
10862    /// The number of tokens that overlap between chunks.
10863    pub r#chunk_overlap_tokens: i64,
10864}
10865
10866/// Customize your own chunking strategy by setting chunk size and chunk
10867/// overlap.
10868#[derive(Clone, Debug)]
10869#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10870pub struct StaticChunkingStrategyRequestParam {
10871    /// Always `static`.
10872    pub r#type: String,
10873
10874    pub r#static: StaticChunkingStrategy,
10875}
10876
10877#[derive(Clone, Debug)]
10878#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10879pub struct StaticChunkingStrategyResponseParam {
10880    /// Always `static`.
10881    pub r#type: String,
10882
10883    pub r#static: StaticChunkingStrategy,
10884}
10885
10886/// Not supported with latest reasoning models `o3` and `o4-mini`.
10887#[derive(Clone, Debug)]
10888#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10889pub enum StopConfiguration {
10890    Null,
10891
10892    String(String),
10893
10894    ArrayOfStrings(Vec<String>),
10895}
10896
10897#[derive(Clone, Debug)]
10898#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10899pub struct SubmitToolOutputsRunRequest {
10900    /// A list of tools for which the outputs are being submitted.
10901    pub r#tool_outputs: Vec<SubmitToolOutputsRunRequest_ToolOutputs>,
10902
10903    /// If `true`, returns a stream of events that happen during the Run as
10904    /// server-sent events, terminating when the Run enters a terminal state
10905    /// with a `data: [DONE]` message.
10906    pub r#stream: Option<bool>,
10907}
10908
10909#[derive(Clone, Debug, Default)]
10910#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10911pub struct SubmitToolOutputsRunRequest_ToolOutputs {
10912    /// The ID of the tool call in the `required_action` object within the run
10913    /// object the output is being submitted for.
10914    pub r#tool_call_id: String,
10915
10916    /// The output of the tool call to be submitted to continue the run.
10917    pub r#output: String,
10918}
10919
10920/// An object specifying the format that the model must output.
10921#[derive(Clone, Debug)]
10922#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10923pub enum TextResponseFormatConfiguration {
10924    ResponseFormatText(ResponseFormatText),
10925
10926    TextResponseFormatJsonSchema(TextResponseFormatJsonSchema),
10927
10928    ResponseFormatJsonObject(ResponseFormatJsonObject),
10929}
10930
10931/// JSON Schema response format.
10932#[derive(Clone, Debug)]
10933#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10934pub struct TextResponseFormatJsonSchema {
10935    /// The type of response format being defined.
10936    pub r#type: String,
10937
10938    /// A description of what the response format is for, used by the model to
10939    /// determine how to respond in the format.
10940    pub r#description: String,
10941
10942    /// The name of the response format.
10943    pub r#name: String,
10944
10945    pub r#schema: ResponseFormatJsonSchemaSchema,
10946
10947    /// Whether to enable strict schema adherence when generating the output.
10948    pub r#strict: Option<bool>,
10949}
10950
10951/// Represents a thread that contains [messages](/docs/api-reference/messages).
10952#[derive(Clone, Debug)]
10953#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10954pub struct ThreadObject {
10955    /// The identifier, which can be referenced in API endpoints.
10956    pub r#id: String,
10957
10958    /// The object type, which is always `thread`.
10959    pub r#object: String,
10960
10961    /// The Unix timestamp (in seconds) for when the thread was created.
10962    pub r#created_at: i64,
10963
10964    pub r#tool_resources: Option<ThreadObject_ToolResources>,
10965
10966    pub r#metadata: Option<Metadata>,
10967}
10968
10969/// A set of resources that are made available to the assistant's tools in this
10970/// thread.
10971#[derive(Clone, Debug)]
10972#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10973pub struct ThreadObject_ToolResources {
10974    pub r#code_interpreter: ThreadObject_ToolResources_CodeInterpreter,
10975
10976    pub r#file_search: ThreadObject_ToolResources_FileSearch,
10977}
10978
10979#[derive(Clone, Debug)]
10980#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10981pub struct ThreadObject_ToolResources_CodeInterpreter {
10982    /// A list of [file](/docs/api-reference/files) IDs made available to the
10983    /// `code_interpreter` tool.
10984    pub r#file_ids: Vec<String>,
10985}
10986
10987#[derive(Clone, Debug)]
10988#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10989pub struct ThreadObject_ToolResources_FileSearch {
10990    /// The [vector store](/docs/api-reference/vector-stores/object) attached to
10991    /// this thread.
10992    pub r#vector_store_ids: Vec<String>,
10993}
10994
10995include!("components/thread_stream_event.rs");
10996
10997#[derive(Clone, Debug)]
10998#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10999pub struct ToggleCertificatesRequest {
11000    pub r#certificate_ids: Vec<String>,
11001}
11002
11003#[derive(Clone, Debug)]
11004#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11005pub enum Tool {
11006    FileSearchTool(FileSearchTool),
11007
11008    FunctionTool(FunctionTool),
11009
11010    WebSearchPreviewTool(WebSearchPreviewTool),
11011
11012    ComputerUsePreviewTool(ComputerUsePreviewTool),
11013}
11014
11015/// Use this option to force the model to call a specific function.
11016#[derive(Clone, Debug, Default)]
11017#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11018pub struct ToolChoiceFunction {
11019    /// For function calling, the type is always `function`.
11020    pub r#type: String,
11021
11022    /// The name of the function to call.
11023    pub r#name: String,
11024}
11025
11026/// Controls which (if any) tool is called by the model.
11027#[derive(Clone, Debug)]
11028#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11029pub struct ToolChoiceOptions(pub String);
11030
11031/// Indicates that the model should use a built-in tool to generate a response.
11032#[derive(Clone, Debug, Default)]
11033#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11034pub struct ToolChoiceTypes {
11035    /// The type of hosted tool the model should to use.
11036    pub r#type: String,
11037}
11038
11039/// Emitted when there is an additional text delta.
11040#[derive(Clone, Debug)]
11041#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11042pub struct TranscriptTextDeltaEvent {
11043    /// The type of the event.
11044    pub r#type: String,
11045
11046    /// The text delta that was additionally transcribed.
11047    pub r#delta: String,
11048
11049    /// The log probabilities of the delta.
11050    pub r#logprobs: Vec<TranscriptTextDeltaEvent_Logprobs>,
11051}
11052
11053#[derive(Clone, Debug)]
11054#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11055pub struct TranscriptTextDeltaEvent_Logprobs {
11056    /// The token that was used to generate the log probability.
11057    pub r#token: String,
11058
11059    /// The log probability of the token.
11060    pub r#logprob: f64,
11061
11062    /// The bytes that were used to generate the log probability.
11063    pub r#bytes: Vec<i64>,
11064}
11065
11066/// Emitted when the transcription is complete.
11067#[derive(Clone, Debug)]
11068#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11069pub struct TranscriptTextDoneEvent {
11070    /// The type of the event.
11071    pub r#type: String,
11072
11073    /// The text that was transcribed.
11074    pub r#text: String,
11075
11076    /// The log probabilities of the individual tokens in the transcription.
11077    pub r#logprobs: Vec<TranscriptTextDoneEvent_Logprobs>,
11078}
11079
11080#[derive(Clone, Debug)]
11081#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11082pub struct TranscriptTextDoneEvent_Logprobs {
11083    /// The token that was used to generate the log probability.
11084    pub r#token: String,
11085
11086    /// The log probability of the token.
11087    pub r#logprob: f64,
11088
11089    /// The bytes that were used to generate the log probability.
11090    pub r#bytes: Vec<i64>,
11091}
11092
11093#[derive(Clone, Debug)]
11094#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11095pub struct TranscriptionInclude(pub String);
11096
11097#[derive(Clone, Debug)]
11098#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11099pub struct TranscriptionSegment {
11100    /// Unique identifier of the segment.
11101    pub r#id: i64,
11102
11103    /// Seek offset of the segment.
11104    pub r#seek: i64,
11105
11106    /// Start time of the segment in seconds.
11107    pub r#start: f64,
11108
11109    /// End time of the segment in seconds.
11110    pub r#end: f64,
11111
11112    /// Text content of the segment.
11113    pub r#text: String,
11114
11115    /// Array of token IDs for the text content.
11116    pub r#tokens: Vec<i64>,
11117
11118    /// Temperature parameter used for generating the segment.
11119    pub r#temperature: f64,
11120
11121    /// Average logprob of the segment.
11122    pub r#avg_logprob: f64,
11123
11124    /// Compression ratio of the segment.
11125    pub r#compression_ratio: f64,
11126
11127    /// Probability of no speech in the segment.
11128    pub r#no_speech_prob: f64,
11129}
11130
11131#[derive(Clone, Debug, Default)]
11132#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11133pub struct TranscriptionWord {
11134    /// The text content of the word.
11135    pub r#word: String,
11136
11137    /// Start time of the word in seconds.
11138    pub r#start: f64,
11139
11140    /// End time of the word in seconds.
11141    pub r#end: f64,
11142}
11143
11144/// Controls for how a thread will be truncated prior to the run.
11145#[derive(Clone, Debug, Default)]
11146#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11147pub struct TruncationObject {
11148    /// The truncation strategy to use for the thread.
11149    pub r#type: String,
11150
11151    /// The number of most recent messages from the thread when constructing the
11152    /// context for the run.
11153    pub r#last_messages: Option<i64>,
11154}
11155
11156/// An action to type in text.
11157#[derive(Clone, Debug, Default)]
11158#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11159pub struct Type {
11160    /// Specifies the event type.
11161    pub r#type: String,
11162
11163    /// The text to type.
11164    pub r#text: String,
11165}
11166
11167#[derive(Clone, Debug)]
11168#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11169pub struct UpdateVectorStoreFileAttributesRequest {
11170    pub r#attributes: Option<VectorStoreFileAttributes>,
11171}
11172
11173#[derive(Clone, Debug)]
11174#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11175pub struct UpdateVectorStoreRequest {
11176    /// The name of the vector store.
11177    pub r#name: Option<String>,
11178
11179    pub r#expires_after: UpdateVectorStoreRequest_ExpiresAfter,
11180
11181    pub r#metadata: Option<Metadata>,
11182}
11183
11184#[derive(Clone, Debug, Default)]
11185#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11186pub struct UpdateVectorStoreRequest_ExpiresAfter(pub (/*AllOf*/));
11187
11188/// The Upload object can accept byte chunks in the form of Parts.
11189#[derive(Clone, Debug)]
11190#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11191pub struct Upload {
11192    /// The Upload unique identifier, which can be referenced in API endpoints.
11193    pub r#id: String,
11194
11195    /// The Unix timestamp (in seconds) for when the Upload was created.
11196    pub r#created_at: i64,
11197
11198    /// The name of the file to be uploaded.
11199    pub r#filename: String,
11200
11201    /// The intended number of bytes to be uploaded.
11202    pub r#bytes: i64,
11203
11204    /// The intended purpose of the file.
11205    pub r#purpose: String,
11206
11207    /// The status of the Upload.
11208    pub r#status: String,
11209
11210    /// The Unix timestamp (in seconds) for when the Upload will expire.
11211    pub r#expires_at: i64,
11212
11213    /// The object type, which is always "upload".
11214    pub r#object: String,
11215
11216    pub r#file: Upload_File,
11217}
11218
11219#[derive(Clone, Debug, Default)]
11220#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11221pub struct UploadCertificateRequest {
11222    /// An optional name for the certificate
11223    pub r#name: String,
11224
11225    /// The certificate content in PEM format
11226    pub r#content: String,
11227}
11228
11229/// The upload Part represents a chunk of bytes we can add to an Upload object.
11230#[derive(Clone, Debug, Default)]
11231#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11232pub struct UploadPart {
11233    /// The upload Part unique identifier, which can be referenced in API
11234    /// endpoints.
11235    pub r#id: String,
11236
11237    /// The Unix timestamp (in seconds) for when the Part was created.
11238    pub r#created_at: i64,
11239
11240    /// The ID of the Upload object that this Part was added to.
11241    pub r#upload_id: String,
11242
11243    /// The object type, which is always `upload.part`.
11244    pub r#object: String,
11245}
11246
11247#[derive(Clone, Debug, Default)]
11248#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11249pub struct Upload_File(pub (/*AllOf*/));
11250
11251/// A citation for a web resource used to generate a model response.
11252#[derive(Clone, Debug, Default)]
11253#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11254pub struct UrlCitationBody {
11255    /// The type of the URL citation.
11256    pub r#type: String,
11257
11258    /// The URL of the web resource.
11259    pub r#url: String,
11260
11261    /// The index of the first character of the URL citation in the message.
11262    pub r#start_index: i64,
11263
11264    /// The index of the last character of the URL citation in the message.
11265    pub r#end_index: i64,
11266
11267    /// The title of the web resource.
11268    pub r#title: String,
11269}
11270
11271/// The aggregated audio speeches usage details of the specific time bucket.
11272#[derive(Clone, Debug, Default)]
11273#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11274pub struct UsageAudioSpeechesResult {
11275    pub r#object: String,
11276
11277    /// The number of characters processed.
11278    pub r#characters: i64,
11279
11280    /// The count of requests made to the model.
11281    pub r#num_model_requests: i64,
11282
11283    /// When `group_by=project_id`, this field provides the project ID of the
11284    /// grouped usage result.
11285    pub r#project_id: Option<String>,
11286
11287    /// When `group_by=user_id`, this field provides the user ID of the grouped
11288    /// usage result.
11289    pub r#user_id: Option<String>,
11290
11291    /// When `group_by=api_key_id`, this field provides the API key ID of the
11292    /// grouped usage result.
11293    pub r#api_key_id: Option<String>,
11294
11295    /// When `group_by=model`, this field provides the model name of the grouped
11296    /// usage result.
11297    pub r#model: Option<String>,
11298}
11299
11300/// The aggregated audio transcriptions usage details of the specific time
11301/// bucket.
11302#[derive(Clone, Debug, Default)]
11303#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11304pub struct UsageAudioTranscriptionsResult {
11305    pub r#object: String,
11306
11307    /// The number of seconds processed.
11308    pub r#seconds: i64,
11309
11310    /// The count of requests made to the model.
11311    pub r#num_model_requests: i64,
11312
11313    /// When `group_by=project_id`, this field provides the project ID of the
11314    /// grouped usage result.
11315    pub r#project_id: Option<String>,
11316
11317    /// When `group_by=user_id`, this field provides the user ID of the grouped
11318    /// usage result.
11319    pub r#user_id: Option<String>,
11320
11321    /// When `group_by=api_key_id`, this field provides the API key ID of the
11322    /// grouped usage result.
11323    pub r#api_key_id: Option<String>,
11324
11325    /// When `group_by=model`, this field provides the model name of the grouped
11326    /// usage result.
11327    pub r#model: Option<String>,
11328}
11329
11330/// The aggregated code interpreter sessions usage details of the specific time
11331/// bucket.
11332#[derive(Clone, Debug, Default)]
11333#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11334pub struct UsageCodeInterpreterSessionsResult {
11335    pub r#object: String,
11336
11337    /// The number of code interpreter sessions.
11338    pub r#num_sessions: i64,
11339
11340    /// When `group_by=project_id`, this field provides the project ID of the
11341    /// grouped usage result.
11342    pub r#project_id: Option<String>,
11343}
11344
11345/// The aggregated completions usage details of the specific time bucket.
11346#[derive(Clone, Debug, Default)]
11347#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11348pub struct UsageCompletionsResult {
11349    pub r#object: String,
11350
11351    /// The aggregated number of text input tokens used, including cached
11352    /// tokens.
11353    pub r#input_tokens: i64,
11354
11355    /// The aggregated number of text input tokens that has been cached from
11356    /// previous requests.
11357    pub r#input_cached_tokens: i64,
11358
11359    /// The aggregated number of text output tokens used.
11360    pub r#output_tokens: i64,
11361
11362    /// The aggregated number of audio input tokens used, including cached
11363    /// tokens.
11364    pub r#input_audio_tokens: i64,
11365
11366    /// The aggregated number of audio output tokens used.
11367    pub r#output_audio_tokens: i64,
11368
11369    /// The count of requests made to the model.
11370    pub r#num_model_requests: i64,
11371
11372    /// When `group_by=project_id`, this field provides the project ID of the
11373    /// grouped usage result.
11374    pub r#project_id: Option<String>,
11375
11376    /// When `group_by=user_id`, this field provides the user ID of the grouped
11377    /// usage result.
11378    pub r#user_id: Option<String>,
11379
11380    /// When `group_by=api_key_id`, this field provides the API key ID of the
11381    /// grouped usage result.
11382    pub r#api_key_id: Option<String>,
11383
11384    /// When `group_by=model`, this field provides the model name of the grouped
11385    /// usage result.
11386    pub r#model: Option<String>,
11387
11388    /// When `group_by=batch`, this field tells whether the grouped usage result
11389    /// is batch or not.
11390    pub r#batch: Option<bool>,
11391}
11392
11393/// The aggregated embeddings usage details of the specific time bucket.
11394#[derive(Clone, Debug, Default)]
11395#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11396pub struct UsageEmbeddingsResult {
11397    pub r#object: String,
11398
11399    /// The aggregated number of input tokens used.
11400    pub r#input_tokens: i64,
11401
11402    /// The count of requests made to the model.
11403    pub r#num_model_requests: i64,
11404
11405    /// When `group_by=project_id`, this field provides the project ID of the
11406    /// grouped usage result.
11407    pub r#project_id: Option<String>,
11408
11409    /// When `group_by=user_id`, this field provides the user ID of the grouped
11410    /// usage result.
11411    pub r#user_id: Option<String>,
11412
11413    /// When `group_by=api_key_id`, this field provides the API key ID of the
11414    /// grouped usage result.
11415    pub r#api_key_id: Option<String>,
11416
11417    /// When `group_by=model`, this field provides the model name of the grouped
11418    /// usage result.
11419    pub r#model: Option<String>,
11420}
11421
11422/// The aggregated images usage details of the specific time bucket.
11423#[derive(Clone, Debug, Default)]
11424#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11425pub struct UsageImagesResult {
11426    pub r#object: String,
11427
11428    /// The number of images processed.
11429    pub r#images: i64,
11430
11431    /// The count of requests made to the model.
11432    pub r#num_model_requests: i64,
11433
11434    /// When `group_by=source`, this field provides the source of the grouped
11435    /// usage result, possible values are `image.generation`, `image.edit`,
11436    /// `image.variation`.
11437    pub r#source: Option<String>,
11438
11439    /// When `group_by=size`, this field provides the image size of the grouped
11440    /// usage result.
11441    pub r#size: Option<String>,
11442
11443    /// When `group_by=project_id`, this field provides the project ID of the
11444    /// grouped usage result.
11445    pub r#project_id: Option<String>,
11446
11447    /// When `group_by=user_id`, this field provides the user ID of the grouped
11448    /// usage result.
11449    pub r#user_id: Option<String>,
11450
11451    /// When `group_by=api_key_id`, this field provides the API key ID of the
11452    /// grouped usage result.
11453    pub r#api_key_id: Option<String>,
11454
11455    /// When `group_by=model`, this field provides the model name of the grouped
11456    /// usage result.
11457    pub r#model: Option<String>,
11458}
11459
11460/// The aggregated moderations usage details of the specific time bucket.
11461#[derive(Clone, Debug, Default)]
11462#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11463pub struct UsageModerationsResult {
11464    pub r#object: String,
11465
11466    /// The aggregated number of input tokens used.
11467    pub r#input_tokens: i64,
11468
11469    /// The count of requests made to the model.
11470    pub r#num_model_requests: i64,
11471
11472    /// When `group_by=project_id`, this field provides the project ID of the
11473    /// grouped usage result.
11474    pub r#project_id: Option<String>,
11475
11476    /// When `group_by=user_id`, this field provides the user ID of the grouped
11477    /// usage result.
11478    pub r#user_id: Option<String>,
11479
11480    /// When `group_by=api_key_id`, this field provides the API key ID of the
11481    /// grouped usage result.
11482    pub r#api_key_id: Option<String>,
11483
11484    /// When `group_by=model`, this field provides the model name of the grouped
11485    /// usage result.
11486    pub r#model: Option<String>,
11487}
11488
11489#[derive(Clone, Debug)]
11490#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11491pub struct UsageResponse {
11492    pub r#object: String,
11493
11494    pub r#data: Vec<UsageTimeBucket>,
11495
11496    pub r#has_more: bool,
11497
11498    pub r#next_page: String,
11499}
11500
11501#[derive(Clone, Debug)]
11502#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11503pub struct UsageTimeBucket {
11504    pub r#object: String,
11505
11506    pub r#start_time: i64,
11507
11508    pub r#end_time: i64,
11509
11510    pub r#result: Vec<UsageTimeBucket_Result>,
11511}
11512
11513#[derive(Clone, Debug)]
11514#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11515pub enum UsageTimeBucket_Result {
11516    UsageCompletionsResult(UsageCompletionsResult),
11517
11518    UsageEmbeddingsResult(UsageEmbeddingsResult),
11519
11520    UsageModerationsResult(UsageModerationsResult),
11521
11522    UsageImagesResult(UsageImagesResult),
11523
11524    UsageAudioSpeechesResult(UsageAudioSpeechesResult),
11525
11526    UsageAudioTranscriptionsResult(UsageAudioTranscriptionsResult),
11527
11528    UsageVectorStoresResult(UsageVectorStoresResult),
11529
11530    UsageCodeInterpreterSessionsResult(UsageCodeInterpreterSessionsResult),
11531
11532    CostsResult(CostsResult),
11533}
11534
11535/// The aggregated vector stores usage details of the specific time bucket.
11536#[derive(Clone, Debug, Default)]
11537#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11538pub struct UsageVectorStoresResult {
11539    pub r#object: String,
11540
11541    /// The vector stores usage in bytes.
11542    pub r#usage_bytes: i64,
11543
11544    /// When `group_by=project_id`, this field provides the project ID of the
11545    /// grouped usage result.
11546    pub r#project_id: Option<String>,
11547}
11548
11549/// Represents an individual `user` within an organization.
11550#[derive(Clone, Debug, Default)]
11551#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11552pub struct User {
11553    /// The object type, which is always `organization.user`
11554    pub r#object: String,
11555
11556    /// The identifier, which can be referenced in API endpoints
11557    pub r#id: String,
11558
11559    /// The name of the user
11560    pub r#name: String,
11561
11562    /// The email address of the user
11563    pub r#email: String,
11564
11565    /// `owner` or `reader`
11566    pub r#role: String,
11567
11568    /// The Unix timestamp (in seconds) of when the user was added.
11569    pub r#added_at: i64,
11570}
11571
11572#[derive(Clone, Debug, Default)]
11573#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11574pub struct UserDeleteResponse {
11575    pub r#object: String,
11576
11577    pub r#id: String,
11578
11579    pub r#deleted: bool,
11580}
11581
11582#[derive(Clone, Debug)]
11583#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11584pub struct UserListResponse {
11585    pub r#object: String,
11586
11587    pub r#data: Vec<User>,
11588
11589    pub r#first_id: String,
11590
11591    pub r#last_id: String,
11592
11593    pub r#has_more: bool,
11594}
11595
11596#[derive(Clone, Debug, Default)]
11597#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11598pub struct UserRoleUpdateRequest {
11599    /// `owner` or `reader`
11600    pub r#role: String,
11601}
11602
11603/// The expiration policy for a vector store.
11604#[derive(Clone, Debug, Default)]
11605#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11606pub struct VectorStoreExpirationAfter {
11607    /// Anchor timestamp after which the expiration policy applies.
11608    pub r#anchor: String,
11609
11610    /// The number of days after the anchor time that the vector store will
11611    /// expire.
11612    pub r#days: i64,
11613}
11614
11615/// Set of 16 key-value pairs that can be attached to an object.
11616#[derive(Clone, Debug, Default)]
11617#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11618pub struct VectorStoreFileAttributes;
11619
11620/// A batch of files attached to a vector store.
11621#[derive(Clone, Debug)]
11622#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11623pub struct VectorStoreFileBatchObject {
11624    /// The identifier, which can be referenced in API endpoints.
11625    pub r#id: String,
11626
11627    /// The object type, which is always `vector_store.file_batch`.
11628    pub r#object: String,
11629
11630    /// The Unix timestamp (in seconds) for when the vector store files batch
11631    /// was created.
11632    pub r#created_at: i64,
11633
11634    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
11635    /// that the [File](/docs/api-reference/files) is attached to.
11636    pub r#vector_store_id: String,
11637
11638    /// The status of the vector store files batch, which can be either
11639    /// `in_progress`, `completed`, `cancelled` or `failed`.
11640    pub r#status: String,
11641
11642    pub r#file_counts: VectorStoreFileBatchObject_FileCounts,
11643}
11644
11645#[derive(Clone, Debug, Default)]
11646#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11647pub struct VectorStoreFileBatchObject_FileCounts {
11648    /// The number of files that are currently being processed.
11649    pub r#in_progress: i64,
11650
11651    /// The number of files that have been processed.
11652    pub r#completed: i64,
11653
11654    /// The number of files that have failed to process.
11655    pub r#failed: i64,
11656
11657    /// The number of files that where cancelled.
11658    pub r#cancelled: i64,
11659
11660    /// The total number of files.
11661    pub r#total: i64,
11662}
11663
11664/// Represents the parsed content of a vector store file.
11665#[derive(Clone, Debug)]
11666#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11667pub struct VectorStoreFileContentResponse {
11668    /// The object type, which is always `vector_store.file_content.page`
11669    pub r#object: String,
11670
11671    /// Parsed content of the file.
11672    pub r#data: Vec<VectorStoreFileContentResponse_Data>,
11673
11674    /// Indicates if there are more content pages to fetch.
11675    pub r#has_more: bool,
11676
11677    /// The token for the next page, if any.
11678    pub r#next_page: Option<String>,
11679}
11680
11681#[derive(Clone, Debug, Default)]
11682#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11683pub struct VectorStoreFileContentResponse_Data {
11684    /// The content type (currently only `"text"`)
11685    pub r#type: String,
11686
11687    /// The text content
11688    pub r#text: String,
11689}
11690
11691/// A list of files attached to a vector store.
11692#[derive(Clone, Debug)]
11693#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11694pub struct VectorStoreFileObject {
11695    /// The identifier, which can be referenced in API endpoints.
11696    pub r#id: String,
11697
11698    /// The object type, which is always `vector_store.file`.
11699    pub r#object: String,
11700
11701    /// The total vector store usage in bytes.
11702    pub r#usage_bytes: i64,
11703
11704    /// The Unix timestamp (in seconds) for when the vector store file was
11705    /// created.
11706    pub r#created_at: i64,
11707
11708    /// The ID of the [vector store](/docs/api-reference/vector-stores/object)
11709    /// that the [File](/docs/api-reference/files) is attached to.
11710    pub r#vector_store_id: String,
11711
11712    /// The status of the vector store file, which can be either `in_progress`,
11713    /// `completed`, `cancelled`, or `failed`.
11714    pub r#status: String,
11715
11716    pub r#last_error: Option<VectorStoreFileObject_LastError>,
11717
11718    pub r#chunking_strategy: VectorStoreFileObject_ChunkingStrategy,
11719
11720    pub r#attributes: Option<VectorStoreFileAttributes>,
11721}
11722
11723/// The strategy used to chunk the file.
11724#[derive(Clone, Debug, Default)]
11725#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11726pub struct VectorStoreFileObject_ChunkingStrategy;
11727
11728/// The last error associated with this vector store file.
11729#[derive(Clone, Debug, Default)]
11730#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11731pub struct VectorStoreFileObject_LastError {
11732    /// One of `server_error` or `rate_limit_exceeded`.
11733    pub r#code: String,
11734
11735    /// A human-readable description of the error.
11736    pub r#message: String,
11737}
11738
11739/// A vector store is a collection of processed files can be used by the
11740/// `file_search` tool.
11741#[derive(Clone, Debug)]
11742#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11743pub struct VectorStoreObject {
11744    /// The identifier, which can be referenced in API endpoints.
11745    pub r#id: String,
11746
11747    /// The object type, which is always `vector_store`.
11748    pub r#object: String,
11749
11750    /// The Unix timestamp (in seconds) for when the vector store was created.
11751    pub r#created_at: i64,
11752
11753    /// The name of the vector store.
11754    pub r#name: String,
11755
11756    /// The total number of bytes used by the files in the vector store.
11757    pub r#usage_bytes: i64,
11758
11759    pub r#file_counts: VectorStoreObject_FileCounts,
11760
11761    /// The status of the vector store, which can be either `expired`,
11762    /// `in_progress`, or `completed`.
11763    pub r#status: String,
11764
11765    pub r#expires_after: VectorStoreExpirationAfter,
11766
11767    /// The Unix timestamp (in seconds) for when the vector store will expire.
11768    pub r#expires_at: Option<i64>,
11769
11770    /// The Unix timestamp (in seconds) for when the vector store was last
11771    /// active.
11772    pub r#last_active_at: Option<i64>,
11773
11774    pub r#metadata: Option<Metadata>,
11775}
11776
11777#[derive(Clone, Debug, Default)]
11778#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11779pub struct VectorStoreObject_FileCounts {
11780    /// The number of files that are currently being processed.
11781    pub r#in_progress: i64,
11782
11783    /// The number of files that have been successfully processed.
11784    pub r#completed: i64,
11785
11786    /// The number of files that have failed to process.
11787    pub r#failed: i64,
11788
11789    /// The number of files that were cancelled.
11790    pub r#cancelled: i64,
11791
11792    /// The total number of files.
11793    pub r#total: i64,
11794}
11795
11796#[derive(Clone, Debug)]
11797#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11798pub struct VectorStoreSearchRequest {
11799    pub r#query: VectorStoreSearchRequest_Query,
11800
11801    /// Whether to rewrite the natural language query for vector search.
11802    pub r#rewrite_query: bool,
11803
11804    /// The maximum number of results to return.
11805    pub r#max_num_results: i64,
11806
11807    pub r#filters: VectorStoreSearchRequest_Filters,
11808
11809    pub r#ranking_options: VectorStoreSearchRequest_RankingOptions,
11810}
11811
11812/// A filter to apply based on file attributes.
11813#[derive(Clone, Debug)]
11814#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11815pub enum VectorStoreSearchRequest_Filters {
11816    ComparisonFilter(ComparisonFilter),
11817
11818    CompoundFilter(CompoundFilter),
11819}
11820
11821/// A query string for a search
11822#[derive(Clone, Debug)]
11823#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11824pub enum VectorStoreSearchRequest_Query {
11825    String(String),
11826
11827    ArrayOfStrings(Vec<String>),
11828}
11829
11830/// Ranking options for search.
11831#[derive(Clone, Debug, Default)]
11832#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11833pub struct VectorStoreSearchRequest_RankingOptions {
11834    pub r#ranker: String,
11835
11836    pub r#score_threshold: f64,
11837}
11838
11839#[derive(Clone, Debug, Default)]
11840#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11841pub struct VectorStoreSearchResultContentObject {
11842    /// The type of content.
11843    pub r#type: String,
11844
11845    /// The text content returned from search.
11846    pub r#text: String,
11847}
11848
11849#[derive(Clone, Debug)]
11850#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11851pub struct VectorStoreSearchResultItem {
11852    /// The ID of the vector store file.
11853    pub r#file_id: String,
11854
11855    /// The name of the vector store file.
11856    pub r#filename: String,
11857
11858    /// The similarity score for the result.
11859    pub r#score: f64,
11860
11861    pub r#attributes: Option<VectorStoreFileAttributes>,
11862
11863    /// Content chunks from the file.
11864    pub r#content: Vec<VectorStoreSearchResultContentObject>,
11865}
11866
11867#[derive(Clone, Debug)]
11868#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11869pub struct VectorStoreSearchResultsPage {
11870    /// The object type, which is always `vector_store.search_results.page`
11871    pub r#object: String,
11872
11873    pub r#search_query: Vec<String>,
11874
11875    /// The list of search result items.
11876    pub r#data: Vec<VectorStoreSearchResultItem>,
11877
11878    /// Indicates if there are more results to fetch.
11879    pub r#has_more: bool,
11880
11881    /// The token for the next page, if any.
11882    pub r#next_page: Option<String>,
11883}
11884
11885pub type VoiceIdsShared = String;
11886
11887/// A wait action.
11888#[derive(Clone, Debug, Default)]
11889#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11890pub struct Wait {
11891    /// Specifies the event type.
11892    pub r#type: String,
11893}
11894
11895/// High level guidance for the amount of context window space to use for the
11896/// search.
11897#[derive(Clone, Debug)]
11898#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11899pub struct WebSearchContextSize(pub String);
11900
11901/// Approximate location parameters for the search.
11902#[derive(Clone, Debug, Default)]
11903#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11904pub struct WebSearchLocation {
11905    /// The two-letter [ISO country
11906    /// code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g.
11907    pub r#country: String,
11908
11909    /// Free text input for the region of the user, e.g.
11910    pub r#region: String,
11911
11912    /// Free text input for the city of the user, e.g.
11913    pub r#city: String,
11914
11915    /// The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of
11916    /// the user, e.g.
11917    pub r#timezone: String,
11918}
11919
11920/// This tool searches the web for relevant results to use in a response.
11921#[derive(Clone, Debug)]
11922#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11923pub struct WebSearchPreviewTool {
11924    /// The type of the web search tool.
11925    pub r#type: String,
11926
11927    pub r#user_location: WebSearchPreviewTool_UserLocation,
11928
11929    /// High level guidance for the amount of context window space to use for
11930    /// the search.
11931    pub r#search_context_size: String,
11932}
11933
11934#[derive(Clone, Debug)]
11935#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11936pub enum WebSearchPreviewTool_UserLocation {
11937    /// The user's location.
11938    ApproximateLocation(ApproximateLocation),
11939
11940    Null(()),
11941}
11942
11943/// The results of a web search tool call.
11944#[derive(Clone, Debug, Default)]
11945#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11946pub struct WebSearchToolCall {
11947    /// The unique ID of the web search tool call.
11948    pub r#id: String,
11949
11950    /// The type of the web search tool call.
11951    pub r#type: String,
11952
11953    /// The status of the web search tool call.
11954    pub r#status: String,
11955}