@mastra/openai 1.0.1-alpha.8 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1481 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- import { createClient, createConfig, type Options, formDataBodySerializer } from '@hey-api/client-fetch';
3
-
4
- import type {
5
- CreateChatCompletionData,
6
- CreateChatCompletionError,
7
- CreateChatCompletionResponse2,
8
- CreateCompletionData,
9
- CreateCompletionError,
10
- CreateCompletionResponse2,
11
- CreateImageData,
12
- CreateImageError,
13
- CreateImageResponse,
14
- CreateImageEditData,
15
- CreateImageEditError,
16
- CreateImageEditResponse,
17
- CreateImageVariationData,
18
- CreateImageVariationError,
19
- CreateImageVariationResponse,
20
- CreateEmbeddingData,
21
- CreateEmbeddingError,
22
- CreateEmbeddingResponse2,
23
- CreateSpeechData,
24
- CreateSpeechError,
25
- CreateSpeechResponse,
26
- CreateTranscriptionData,
27
- CreateTranscriptionError,
28
- CreateTranscriptionResponse,
29
- CreateTranslationData,
30
- CreateTranslationError,
31
- CreateTranslationResponse,
32
- ListFilesData,
33
- ListFilesError,
34
- ListFilesResponse2,
35
- CreateFileData,
36
- CreateFileError,
37
- CreateFileResponse,
38
- DeleteFileData,
39
- DeleteFileError,
40
- DeleteFileResponse2,
41
- RetrieveFileData,
42
- RetrieveFileError,
43
- RetrieveFileResponse,
44
- DownloadFileData,
45
- DownloadFileError,
46
- DownloadFileResponse,
47
- CreateUploadData,
48
- CreateUploadError,
49
- CreateUploadResponse,
50
- AddUploadPartData,
51
- AddUploadPartError,
52
- AddUploadPartResponse,
53
- CompleteUploadData,
54
- CompleteUploadError,
55
- CompleteUploadResponse,
56
- CancelUploadData,
57
- CancelUploadError,
58
- CancelUploadResponse,
59
- CreateFineTuningJobData,
60
- CreateFineTuningJobError,
61
- CreateFineTuningJobResponse,
62
- ListPaginatedFineTuningJobsData,
63
- ListPaginatedFineTuningJobsError,
64
- ListPaginatedFineTuningJobsResponse2,
65
- RetrieveFineTuningJobData,
66
- RetrieveFineTuningJobError,
67
- RetrieveFineTuningJobResponse,
68
- ListFineTuningEventsData,
69
- ListFineTuningEventsError,
70
- ListFineTuningEventsResponse,
71
- CancelFineTuningJobData,
72
- CancelFineTuningJobError,
73
- CancelFineTuningJobResponse,
74
- ListFineTuningJobCheckpointsData,
75
- ListFineTuningJobCheckpointsError,
76
- ListFineTuningJobCheckpointsResponse2,
77
- ListModelsError,
78
- ListModelsResponse2,
79
- RetrieveModelData,
80
- RetrieveModelError,
81
- RetrieveModelResponse,
82
- DeleteModelData,
83
- DeleteModelError,
84
- DeleteModelResponse2,
85
- CreateModerationData,
86
- CreateModerationError,
87
- CreateModerationResponse2,
88
- ListAssistantsData,
89
- ListAssistantsError,
90
- ListAssistantsResponse2,
91
- CreateAssistantData,
92
- CreateAssistantError,
93
- CreateAssistantResponse,
94
- GetAssistantData,
95
- GetAssistantError,
96
- GetAssistantResponse,
97
- ModifyAssistantData,
98
- ModifyAssistantError,
99
- ModifyAssistantResponse,
100
- DeleteAssistantData,
101
- DeleteAssistantError,
102
- DeleteAssistantResponse2,
103
- CreateThreadData,
104
- CreateThreadError,
105
- CreateThreadResponse,
106
- GetThreadData,
107
- GetThreadError,
108
- GetThreadResponse,
109
- ModifyThreadData,
110
- ModifyThreadError,
111
- ModifyThreadResponse,
112
- DeleteThreadData,
113
- DeleteThreadError,
114
- DeleteThreadResponse2,
115
- ListMessagesData,
116
- ListMessagesError,
117
- ListMessagesResponse2,
118
- CreateMessageData,
119
- CreateMessageError,
120
- CreateMessageResponse,
121
- GetMessageData,
122
- GetMessageError,
123
- GetMessageResponse,
124
- ModifyMessageData,
125
- ModifyMessageError,
126
- ModifyMessageResponse,
127
- DeleteMessageData,
128
- DeleteMessageError,
129
- DeleteMessageResponse2,
130
- CreateThreadAndRunData,
131
- CreateThreadAndRunError,
132
- CreateThreadAndRunResponse,
133
- ListRunsData,
134
- ListRunsError,
135
- ListRunsResponse2,
136
- CreateRunData,
137
- CreateRunError,
138
- CreateRunResponse,
139
- GetRunData,
140
- GetRunError,
141
- GetRunResponse,
142
- ModifyRunData,
143
- ModifyRunError,
144
- ModifyRunResponse,
145
- SubmitToolOuputsToRunData,
146
- SubmitToolOuputsToRunError,
147
- SubmitToolOuputsToRunResponse,
148
- CancelRunData,
149
- CancelRunError,
150
- CancelRunResponse,
151
- ListRunStepsData,
152
- ListRunStepsError,
153
- ListRunStepsResponse2,
154
- GetRunStepData,
155
- GetRunStepError,
156
- GetRunStepResponse,
157
- ListVectorStoresData,
158
- ListVectorStoresError,
159
- ListVectorStoresResponse2,
160
- CreateVectorStoreData,
161
- CreateVectorStoreError,
162
- CreateVectorStoreResponse,
163
- GetVectorStoreData,
164
- GetVectorStoreError,
165
- GetVectorStoreResponse,
166
- ModifyVectorStoreData,
167
- ModifyVectorStoreError,
168
- ModifyVectorStoreResponse,
169
- DeleteVectorStoreData,
170
- DeleteVectorStoreError,
171
- DeleteVectorStoreResponse2,
172
- ListVectorStoreFilesData,
173
- ListVectorStoreFilesError,
174
- ListVectorStoreFilesResponse2,
175
- CreateVectorStoreFileData,
176
- CreateVectorStoreFileError,
177
- CreateVectorStoreFileResponse,
178
- GetVectorStoreFileData,
179
- GetVectorStoreFileError,
180
- GetVectorStoreFileResponse,
181
- DeleteVectorStoreFileData,
182
- DeleteVectorStoreFileError,
183
- DeleteVectorStoreFileResponse2,
184
- CreateVectorStoreFileBatchData,
185
- CreateVectorStoreFileBatchError,
186
- CreateVectorStoreFileBatchResponse,
187
- GetVectorStoreFileBatchData,
188
- GetVectorStoreFileBatchError,
189
- GetVectorStoreFileBatchResponse,
190
- CancelVectorStoreFileBatchData,
191
- CancelVectorStoreFileBatchError,
192
- CancelVectorStoreFileBatchResponse,
193
- ListFilesInVectorStoreBatchData,
194
- ListFilesInVectorStoreBatchError,
195
- ListFilesInVectorStoreBatchResponse,
196
- CreateBatchData,
197
- CreateBatchError,
198
- CreateBatchResponse,
199
- ListBatchesData,
200
- ListBatchesError,
201
- ListBatchesResponse2,
202
- RetrieveBatchData,
203
- RetrieveBatchError,
204
- RetrieveBatchResponse,
205
- CancelBatchData,
206
- CancelBatchError,
207
- CancelBatchResponse,
208
- ListAuditLogsData,
209
- ListAuditLogsError,
210
- ListAuditLogsResponse2,
211
- ListInvitesData,
212
- ListInvitesError,
213
- ListInvitesResponse,
214
- InviteUserData,
215
- InviteUserError,
216
- InviteUserResponse,
217
- RetrieveInviteData,
218
- RetrieveInviteError,
219
- RetrieveInviteResponse,
220
- DeleteInviteData,
221
- DeleteInviteError,
222
- DeleteInviteResponse,
223
- ListUsersData,
224
- ListUsersError,
225
- ListUsersResponse,
226
- RetrieveUserData,
227
- RetrieveUserError,
228
- RetrieveUserResponse,
229
- ModifyUserData,
230
- ModifyUserError,
231
- ModifyUserResponse,
232
- DeleteUserData,
233
- DeleteUserError,
234
- DeleteUserResponse,
235
- ListProjectsData,
236
- ListProjectsError,
237
- ListProjectsResponse,
238
- CreateProjectData,
239
- CreateProjectError,
240
- CreateProjectResponse,
241
- RetrieveProjectData,
242
- RetrieveProjectError,
243
- RetrieveProjectResponse,
244
- ModifyProjectData,
245
- ModifyProjectError,
246
- ModifyProjectResponse,
247
- ArchiveProjectData,
248
- ArchiveProjectError,
249
- ArchiveProjectResponse,
250
- ListProjectUsersData,
251
- ListProjectUsersError,
252
- ListProjectUsersResponse,
253
- CreateProjectUserData,
254
- CreateProjectUserError,
255
- CreateProjectUserResponse,
256
- RetrieveProjectUserData,
257
- RetrieveProjectUserError,
258
- RetrieveProjectUserResponse,
259
- ModifyProjectUserData,
260
- ModifyProjectUserError,
261
- ModifyProjectUserResponse,
262
- DeleteProjectUserData,
263
- DeleteProjectUserError,
264
- DeleteProjectUserResponse,
265
- ListProjectServiceAccountsData,
266
- ListProjectServiceAccountsError,
267
- ListProjectServiceAccountsResponse,
268
- CreateProjectServiceAccountData,
269
- CreateProjectServiceAccountError,
270
- CreateProjectServiceAccountResponse,
271
- RetrieveProjectServiceAccountData,
272
- RetrieveProjectServiceAccountError,
273
- RetrieveProjectServiceAccountResponse,
274
- DeleteProjectServiceAccountData,
275
- DeleteProjectServiceAccountError,
276
- DeleteProjectServiceAccountResponse,
277
- ListProjectApiKeysData,
278
- ListProjectApiKeysError,
279
- ListProjectApiKeysResponse,
280
- RetrieveProjectApiKeyData,
281
- RetrieveProjectApiKeyError,
282
- RetrieveProjectApiKeyResponse,
283
- DeleteProjectApiKeyData,
284
- DeleteProjectApiKeyError,
285
- DeleteProjectApiKeyResponse,
286
- } from './types.gen';
287
-
288
- export const client = createClient(createConfig());
289
-
290
- /**
291
- * Creates a model response for the given chat conversation.
292
- */
293
- export const createChatCompletion = <ThrowOnError extends boolean = false>(
294
- options: Options<CreateChatCompletionData, ThrowOnError>,
295
- ) => {
296
- return (options?.client ?? client).post<CreateChatCompletionResponse2, CreateChatCompletionError, ThrowOnError>({
297
- ...options,
298
- url: '/chat/completions',
299
- });
300
- };
301
-
302
- /**
303
- * Creates a completion for the provided prompt and parameters.
304
- */
305
- export const createCompletion = <ThrowOnError extends boolean = false>(
306
- options: Options<CreateCompletionData, ThrowOnError>,
307
- ) => {
308
- return (options?.client ?? client).post<CreateCompletionResponse2, CreateCompletionError, ThrowOnError>({
309
- ...options,
310
- url: '/completions',
311
- });
312
- };
313
-
314
- /**
315
- * Creates an image given a prompt.
316
- */
317
- export const createImage = <ThrowOnError extends boolean = false>(options: Options<CreateImageData, ThrowOnError>) => {
318
- return (options?.client ?? client).post<CreateImageResponse, CreateImageError, ThrowOnError>({
319
- ...options,
320
- url: '/images/generations',
321
- });
322
- };
323
-
324
- /**
325
- * Creates an edited or extended image given an original image and a prompt.
326
- */
327
- export const createImageEdit = <ThrowOnError extends boolean = false>(
328
- options: Options<CreateImageEditData, ThrowOnError>,
329
- ) => {
330
- return (options?.client ?? client).post<CreateImageEditResponse, CreateImageEditError, ThrowOnError>({
331
- ...options,
332
- ...formDataBodySerializer,
333
- headers: {
334
- 'Content-Type': null,
335
- ...options?.headers,
336
- },
337
- url: '/images/edits',
338
- });
339
- };
340
-
341
- /**
342
- * Creates a variation of a given image.
343
- */
344
- export const createImageVariation = <ThrowOnError extends boolean = false>(
345
- options: Options<CreateImageVariationData, ThrowOnError>,
346
- ) => {
347
- return (options?.client ?? client).post<CreateImageVariationResponse, CreateImageVariationError, ThrowOnError>({
348
- ...options,
349
- ...formDataBodySerializer,
350
- headers: {
351
- 'Content-Type': null,
352
- ...options?.headers,
353
- },
354
- url: '/images/variations',
355
- });
356
- };
357
-
358
- /**
359
- * Creates an embedding vector representing the input text.
360
- */
361
- export const createEmbedding = <ThrowOnError extends boolean = false>(
362
- options: Options<CreateEmbeddingData, ThrowOnError>,
363
- ) => {
364
- return (options?.client ?? client).post<CreateEmbeddingResponse2, CreateEmbeddingError, ThrowOnError>({
365
- ...options,
366
- url: '/embeddings',
367
- });
368
- };
369
-
370
- /**
371
- * Generates audio from the input text.
372
- */
373
- export const createSpeech = <ThrowOnError extends boolean = false>(
374
- options: Options<CreateSpeechData, ThrowOnError>,
375
- ) => {
376
- return (options?.client ?? client).post<CreateSpeechResponse, CreateSpeechError, ThrowOnError>({
377
- ...options,
378
- url: '/audio/speech',
379
- });
380
- };
381
-
382
- /**
383
- * Transcribes audio into the input language.
384
- */
385
- export const createTranscription = <ThrowOnError extends boolean = false>(
386
- options: Options<CreateTranscriptionData, ThrowOnError>,
387
- ) => {
388
- return (options?.client ?? client).post<CreateTranscriptionResponse, CreateTranscriptionError, ThrowOnError>({
389
- ...options,
390
- ...formDataBodySerializer,
391
- headers: {
392
- 'Content-Type': null,
393
- ...options?.headers,
394
- },
395
- url: '/audio/transcriptions',
396
- });
397
- };
398
-
399
- /**
400
- * Translates audio into English.
401
- */
402
- export const createTranslation = <ThrowOnError extends boolean = false>(
403
- options: Options<CreateTranslationData, ThrowOnError>,
404
- ) => {
405
- return (options?.client ?? client).post<CreateTranslationResponse, CreateTranslationError, ThrowOnError>({
406
- ...options,
407
- ...formDataBodySerializer,
408
- headers: {
409
- 'Content-Type': null,
410
- ...options?.headers,
411
- },
412
- url: '/audio/translations',
413
- });
414
- };
415
-
416
- /**
417
- * Returns a list of files that belong to the user's organization.
418
- */
419
- export const listFiles = <ThrowOnError extends boolean = false>(options?: Options<ListFilesData, ThrowOnError>) => {
420
- return (options?.client ?? client).get<ListFilesResponse2, ListFilesError, ThrowOnError>({
421
- ...options,
422
- url: '/files',
423
- });
424
- };
425
-
426
- /**
427
- * Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 100 GB.
428
- *
429
- * The Assistants API supports files up to 2 million tokens and of specific file types. See the [Assistants Tools guide](/docs/assistants/tools) for details.
430
- *
431
- * The Fine-tuning API only supports `.jsonl` files. The input also has certain required formats for fine-tuning [chat](/docs/api-reference/fine-tuning/chat-input) or [completions](/docs/api-reference/fine-tuning/completions-input) models.
432
- *
433
- * The Batch API only supports `.jsonl` files up to 100 MB in size. The input also has a specific required [format](/docs/api-reference/batch/request-input).
434
- *
435
- * Please [contact us](https://help.openai.com/) if you need to increase these storage limits.
436
- *
437
- */
438
- export const createFile = <ThrowOnError extends boolean = false>(options: Options<CreateFileData, ThrowOnError>) => {
439
- return (options?.client ?? client).post<CreateFileResponse, CreateFileError, ThrowOnError>({
440
- ...options,
441
- ...formDataBodySerializer,
442
- headers: {
443
- 'Content-Type': null,
444
- ...options?.headers,
445
- },
446
- url: '/files',
447
- });
448
- };
449
-
450
- /**
451
- * Delete a file.
452
- */
453
- export const deleteFile = <ThrowOnError extends boolean = false>(options: Options<DeleteFileData, ThrowOnError>) => {
454
- return (options?.client ?? client).delete<DeleteFileResponse2, DeleteFileError, ThrowOnError>({
455
- ...options,
456
- url: '/files/{file_id}',
457
- });
458
- };
459
-
460
- /**
461
- * Returns information about a specific file.
462
- */
463
- export const retrieveFile = <ThrowOnError extends boolean = false>(
464
- options: Options<RetrieveFileData, ThrowOnError>,
465
- ) => {
466
- return (options?.client ?? client).get<RetrieveFileResponse, RetrieveFileError, ThrowOnError>({
467
- ...options,
468
- url: '/files/{file_id}',
469
- });
470
- };
471
-
472
- /**
473
- * Returns the contents of the specified file.
474
- */
475
- export const downloadFile = <ThrowOnError extends boolean = false>(
476
- options: Options<DownloadFileData, ThrowOnError>,
477
- ) => {
478
- return (options?.client ?? client).get<DownloadFileResponse, DownloadFileError, ThrowOnError>({
479
- ...options,
480
- url: '/files/{file_id}/content',
481
- });
482
- };
483
-
484
- /**
485
- * Creates an intermediate [Upload](/docs/api-reference/uploads/object) object that you can add [Parts](/docs/api-reference/uploads/part-object) to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it.
486
- *
487
- * Once you complete the Upload, we will create a [File](/docs/api-reference/files/object) object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object.
488
- *
489
- * For certain `purpose`s, the correct `mime_type` must be specified. Please refer to documentation for the supported MIME types for your use case:
490
- * - [Assistants](/docs/assistants/tools/file-search/supported-files)
491
- *
492
- * For guidance on the proper filename extensions for each purpose, please follow the documentation on [creating a File](/docs/api-reference/files/create).
493
- *
494
- */
495
- export const createUpload = <ThrowOnError extends boolean = false>(
496
- options: Options<CreateUploadData, ThrowOnError>,
497
- ) => {
498
- return (options?.client ?? client).post<CreateUploadResponse, CreateUploadError, ThrowOnError>({
499
- ...options,
500
- url: '/uploads',
501
- });
502
- };
503
-
504
- /**
505
- * Adds a [Part](/docs/api-reference/uploads/part-object) to an [Upload](/docs/api-reference/uploads/object) object. A Part represents a chunk of bytes from the file you are trying to upload.
506
- *
507
- * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB.
508
- *
509
- * It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](/docs/api-reference/uploads/complete).
510
- *
511
- */
512
- export const addUploadPart = <ThrowOnError extends boolean = false>(
513
- options: Options<AddUploadPartData, ThrowOnError>,
514
- ) => {
515
- return (options?.client ?? client).post<AddUploadPartResponse, AddUploadPartError, ThrowOnError>({
516
- ...options,
517
- ...formDataBodySerializer,
518
- headers: {
519
- 'Content-Type': null,
520
- ...options?.headers,
521
- },
522
- url: '/uploads/{upload_id}/parts',
523
- });
524
- };
525
-
526
- /**
527
- * Completes the [Upload](/docs/api-reference/uploads/object).
528
- *
529
- * Within the returned Upload object, there is a nested [File](/docs/api-reference/files/object) object that is ready to use in the rest of the platform.
530
- *
531
- * You can specify the order of the Parts by passing in an ordered list of the Part IDs.
532
- *
533
- * The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.
534
- *
535
- */
536
- export const completeUpload = <ThrowOnError extends boolean = false>(
537
- options: Options<CompleteUploadData, ThrowOnError>,
538
- ) => {
539
- return (options?.client ?? client).post<CompleteUploadResponse, CompleteUploadError, ThrowOnError>({
540
- ...options,
541
- url: '/uploads/{upload_id}/complete',
542
- });
543
- };
544
-
545
- /**
546
- * Cancels the Upload. No Parts may be added after an Upload is cancelled.
547
- *
548
- */
549
- export const cancelUpload = <ThrowOnError extends boolean = false>(
550
- options: Options<CancelUploadData, ThrowOnError>,
551
- ) => {
552
- return (options?.client ?? client).post<CancelUploadResponse, CancelUploadError, ThrowOnError>({
553
- ...options,
554
- url: '/uploads/{upload_id}/cancel',
555
- });
556
- };
557
-
558
- /**
559
- * Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
560
- *
561
- * Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
562
- *
563
- * [Learn more about fine-tuning](/docs/guides/fine-tuning)
564
- *
565
- */
566
- export const createFineTuningJob = <ThrowOnError extends boolean = false>(
567
- options: Options<CreateFineTuningJobData, ThrowOnError>,
568
- ) => {
569
- return (options?.client ?? client).post<CreateFineTuningJobResponse, CreateFineTuningJobError, ThrowOnError>({
570
- ...options,
571
- url: '/fine_tuning/jobs',
572
- });
573
- };
574
-
575
- /**
576
- * List your organization's fine-tuning jobs
577
- *
578
- */
579
- export const listPaginatedFineTuningJobs = <ThrowOnError extends boolean = false>(
580
- options?: Options<ListPaginatedFineTuningJobsData, ThrowOnError>,
581
- ) => {
582
- return (options?.client ?? client).get<
583
- ListPaginatedFineTuningJobsResponse2,
584
- ListPaginatedFineTuningJobsError,
585
- ThrowOnError
586
- >({
587
- ...options,
588
- url: '/fine_tuning/jobs',
589
- });
590
- };
591
-
592
- /**
593
- * Get info about a fine-tuning job.
594
- *
595
- * [Learn more about fine-tuning](/docs/guides/fine-tuning)
596
- *
597
- */
598
- export const retrieveFineTuningJob = <ThrowOnError extends boolean = false>(
599
- options: Options<RetrieveFineTuningJobData, ThrowOnError>,
600
- ) => {
601
- return (options?.client ?? client).get<RetrieveFineTuningJobResponse, RetrieveFineTuningJobError, ThrowOnError>({
602
- ...options,
603
- url: '/fine_tuning/jobs/{fine_tuning_job_id}',
604
- });
605
- };
606
-
607
- /**
608
- * Get status updates for a fine-tuning job.
609
- *
610
- */
611
- export const listFineTuningEvents = <ThrowOnError extends boolean = false>(
612
- options: Options<ListFineTuningEventsData, ThrowOnError>,
613
- ) => {
614
- return (options?.client ?? client).get<ListFineTuningEventsResponse, ListFineTuningEventsError, ThrowOnError>({
615
- ...options,
616
- url: '/fine_tuning/jobs/{fine_tuning_job_id}/events',
617
- });
618
- };
619
-
620
- /**
621
- * Immediately cancel a fine-tune job.
622
- *
623
- */
624
- export const cancelFineTuningJob = <ThrowOnError extends boolean = false>(
625
- options: Options<CancelFineTuningJobData, ThrowOnError>,
626
- ) => {
627
- return (options?.client ?? client).post<CancelFineTuningJobResponse, CancelFineTuningJobError, ThrowOnError>({
628
- ...options,
629
- url: '/fine_tuning/jobs/{fine_tuning_job_id}/cancel',
630
- });
631
- };
632
-
633
- /**
634
- * List checkpoints for a fine-tuning job.
635
- *
636
- */
637
- export const listFineTuningJobCheckpoints = <ThrowOnError extends boolean = false>(
638
- options: Options<ListFineTuningJobCheckpointsData, ThrowOnError>,
639
- ) => {
640
- return (options?.client ?? client).get<
641
- ListFineTuningJobCheckpointsResponse2,
642
- ListFineTuningJobCheckpointsError,
643
- ThrowOnError
644
- >({
645
- ...options,
646
- url: '/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints',
647
- });
648
- };
649
-
650
- /**
651
- * Lists the currently available models, and provides basic information about each one such as the owner and availability.
652
- */
653
- export const listModels = <ThrowOnError extends boolean = false>(options?: Options<unknown, ThrowOnError>) => {
654
- return (options?.client ?? client).get<ListModelsResponse2, ListModelsError, ThrowOnError>({
655
- ...options,
656
- url: '/models',
657
- });
658
- };
659
-
660
- /**
661
- * Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
662
- */
663
- export const retrieveModel = <ThrowOnError extends boolean = false>(
664
- options: Options<RetrieveModelData, ThrowOnError>,
665
- ) => {
666
- return (options?.client ?? client).get<RetrieveModelResponse, RetrieveModelError, ThrowOnError>({
667
- ...options,
668
- url: '/models/{model}',
669
- });
670
- };
671
-
672
- /**
673
- * Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
674
- */
675
- export const deleteModel = <ThrowOnError extends boolean = false>(options: Options<DeleteModelData, ThrowOnError>) => {
676
- return (options?.client ?? client).delete<DeleteModelResponse2, DeleteModelError, ThrowOnError>({
677
- ...options,
678
- url: '/models/{model}',
679
- });
680
- };
681
-
682
- /**
683
- * Classifies if text is potentially harmful.
684
- */
685
- export const createModeration = <ThrowOnError extends boolean = false>(
686
- options: Options<CreateModerationData, ThrowOnError>,
687
- ) => {
688
- return (options?.client ?? client).post<CreateModerationResponse2, CreateModerationError, ThrowOnError>({
689
- ...options,
690
- url: '/moderations',
691
- });
692
- };
693
-
694
- /**
695
- * Returns a list of assistants.
696
- */
697
- export const listAssistants = <ThrowOnError extends boolean = false>(
698
- options?: Options<ListAssistantsData, ThrowOnError>,
699
- ) => {
700
- return (options?.client ?? client).get<ListAssistantsResponse2, ListAssistantsError, ThrowOnError>({
701
- ...options,
702
- url: '/assistants',
703
- });
704
- };
705
-
706
- /**
707
- * Create an assistant with a model and instructions.
708
- */
709
- export const createAssistant = <ThrowOnError extends boolean = false>(
710
- options: Options<CreateAssistantData, ThrowOnError>,
711
- ) => {
712
- return (options?.client ?? client).post<CreateAssistantResponse, CreateAssistantError, ThrowOnError>({
713
- ...options,
714
- url: '/assistants',
715
- });
716
- };
717
-
718
- /**
719
- * Retrieves an assistant.
720
- */
721
- export const getAssistant = <ThrowOnError extends boolean = false>(
722
- options: Options<GetAssistantData, ThrowOnError>,
723
- ) => {
724
- return (options?.client ?? client).get<GetAssistantResponse, GetAssistantError, ThrowOnError>({
725
- ...options,
726
- url: '/assistants/{assistant_id}',
727
- });
728
- };
729
-
730
- /**
731
- * Modifies an assistant.
732
- */
733
- export const modifyAssistant = <ThrowOnError extends boolean = false>(
734
- options: Options<ModifyAssistantData, ThrowOnError>,
735
- ) => {
736
- return (options?.client ?? client).post<ModifyAssistantResponse, ModifyAssistantError, ThrowOnError>({
737
- ...options,
738
- url: '/assistants/{assistant_id}',
739
- });
740
- };
741
-
742
- /**
743
- * Delete an assistant.
744
- */
745
- export const deleteAssistant = <ThrowOnError extends boolean = false>(
746
- options: Options<DeleteAssistantData, ThrowOnError>,
747
- ) => {
748
- return (options?.client ?? client).delete<DeleteAssistantResponse2, DeleteAssistantError, ThrowOnError>({
749
- ...options,
750
- url: '/assistants/{assistant_id}',
751
- });
752
- };
753
-
754
- /**
755
- * Create a thread.
756
- */
757
- export const createThread = <ThrowOnError extends boolean = false>(
758
- options?: Options<CreateThreadData, ThrowOnError>,
759
- ) => {
760
- return (options?.client ?? client).post<CreateThreadResponse, CreateThreadError, ThrowOnError>({
761
- ...options,
762
- url: '/threads',
763
- });
764
- };
765
-
766
- /**
767
- * Retrieves a thread.
768
- */
769
- export const getThread = <ThrowOnError extends boolean = false>(options: Options<GetThreadData, ThrowOnError>) => {
770
- return (options?.client ?? client).get<GetThreadResponse, GetThreadError, ThrowOnError>({
771
- ...options,
772
- url: '/threads/{thread_id}',
773
- });
774
- };
775
-
776
- /**
777
- * Modifies a thread.
778
- */
779
- export const modifyThread = <ThrowOnError extends boolean = false>(
780
- options: Options<ModifyThreadData, ThrowOnError>,
781
- ) => {
782
- return (options?.client ?? client).post<ModifyThreadResponse, ModifyThreadError, ThrowOnError>({
783
- ...options,
784
- url: '/threads/{thread_id}',
785
- });
786
- };
787
-
788
- /**
789
- * Delete a thread.
790
- */
791
- export const deleteThread = <ThrowOnError extends boolean = false>(
792
- options: Options<DeleteThreadData, ThrowOnError>,
793
- ) => {
794
- return (options?.client ?? client).delete<DeleteThreadResponse2, DeleteThreadError, ThrowOnError>({
795
- ...options,
796
- url: '/threads/{thread_id}',
797
- });
798
- };
799
-
800
- /**
801
- * Returns a list of messages for a given thread.
802
- */
803
- export const listMessages = <ThrowOnError extends boolean = false>(
804
- options: Options<ListMessagesData, ThrowOnError>,
805
- ) => {
806
- return (options?.client ?? client).get<ListMessagesResponse2, ListMessagesError, ThrowOnError>({
807
- ...options,
808
- url: '/threads/{thread_id}/messages',
809
- });
810
- };
811
-
812
- /**
813
- * Create a message.
814
- */
815
- export const createMessage = <ThrowOnError extends boolean = false>(
816
- options: Options<CreateMessageData, ThrowOnError>,
817
- ) => {
818
- return (options?.client ?? client).post<CreateMessageResponse, CreateMessageError, ThrowOnError>({
819
- ...options,
820
- url: '/threads/{thread_id}/messages',
821
- });
822
- };
823
-
824
- /**
825
- * Retrieve a message.
826
- */
827
- export const getMessage = <ThrowOnError extends boolean = false>(options: Options<GetMessageData, ThrowOnError>) => {
828
- return (options?.client ?? client).get<GetMessageResponse, GetMessageError, ThrowOnError>({
829
- ...options,
830
- url: '/threads/{thread_id}/messages/{message_id}',
831
- });
832
- };
833
-
834
- /**
835
- * Modifies a message.
836
- */
837
- export const modifyMessage = <ThrowOnError extends boolean = false>(
838
- options: Options<ModifyMessageData, ThrowOnError>,
839
- ) => {
840
- return (options?.client ?? client).post<ModifyMessageResponse, ModifyMessageError, ThrowOnError>({
841
- ...options,
842
- url: '/threads/{thread_id}/messages/{message_id}',
843
- });
844
- };
845
-
846
- /**
847
- * Deletes a message.
848
- */
849
- export const deleteMessage = <ThrowOnError extends boolean = false>(
850
- options: Options<DeleteMessageData, ThrowOnError>,
851
- ) => {
852
- return (options?.client ?? client).delete<DeleteMessageResponse2, DeleteMessageError, ThrowOnError>({
853
- ...options,
854
- url: '/threads/{thread_id}/messages/{message_id}',
855
- });
856
- };
857
-
858
- /**
859
- * Create a thread and run it in one request.
860
- */
861
- export const createThreadAndRun = <ThrowOnError extends boolean = false>(
862
- options: Options<CreateThreadAndRunData, ThrowOnError>,
863
- ) => {
864
- return (options?.client ?? client).post<CreateThreadAndRunResponse, CreateThreadAndRunError, ThrowOnError>({
865
- ...options,
866
- url: '/threads/runs',
867
- });
868
- };
869
-
870
- /**
871
- * Returns a list of runs belonging to a thread.
872
- */
873
- export const listRuns = <ThrowOnError extends boolean = false>(options: Options<ListRunsData, ThrowOnError>) => {
874
- return (options?.client ?? client).get<ListRunsResponse2, ListRunsError, ThrowOnError>({
875
- ...options,
876
- url: '/threads/{thread_id}/runs',
877
- });
878
- };
879
-
880
- /**
881
- * Create a run.
882
- */
883
- export const createRun = <ThrowOnError extends boolean = false>(options: Options<CreateRunData, ThrowOnError>) => {
884
- return (options?.client ?? client).post<CreateRunResponse, CreateRunError, ThrowOnError>({
885
- ...options,
886
- url: '/threads/{thread_id}/runs',
887
- });
888
- };
889
-
890
- /**
891
- * Retrieves a run.
892
- */
893
- export const getRun = <ThrowOnError extends boolean = false>(options: Options<GetRunData, ThrowOnError>) => {
894
- return (options?.client ?? client).get<GetRunResponse, GetRunError, ThrowOnError>({
895
- ...options,
896
- url: '/threads/{thread_id}/runs/{run_id}',
897
- });
898
- };
899
-
900
- /**
901
- * Modifies a run.
902
- */
903
- export const modifyRun = <ThrowOnError extends boolean = false>(options: Options<ModifyRunData, ThrowOnError>) => {
904
- return (options?.client ?? client).post<ModifyRunResponse, ModifyRunError, ThrowOnError>({
905
- ...options,
906
- url: '/threads/{thread_id}/runs/{run_id}',
907
- });
908
- };
909
-
910
- /**
911
- * When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.
912
- *
913
- */
914
- export const submitToolOuputsToRun = <ThrowOnError extends boolean = false>(
915
- options: Options<SubmitToolOuputsToRunData, ThrowOnError>,
916
- ) => {
917
- return (options?.client ?? client).post<SubmitToolOuputsToRunResponse, SubmitToolOuputsToRunError, ThrowOnError>({
918
- ...options,
919
- url: '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs',
920
- });
921
- };
922
-
923
- /**
924
- * Cancels a run that is `in_progress`.
925
- */
926
- export const cancelRun = <ThrowOnError extends boolean = false>(options: Options<CancelRunData, ThrowOnError>) => {
927
- return (options?.client ?? client).post<CancelRunResponse, CancelRunError, ThrowOnError>({
928
- ...options,
929
- url: '/threads/{thread_id}/runs/{run_id}/cancel',
930
- });
931
- };
932
-
933
- /**
934
- * Returns a list of run steps belonging to a run.
935
- */
936
- export const listRunSteps = <ThrowOnError extends boolean = false>(
937
- options: Options<ListRunStepsData, ThrowOnError>,
938
- ) => {
939
- return (options?.client ?? client).get<ListRunStepsResponse2, ListRunStepsError, ThrowOnError>({
940
- ...options,
941
- url: '/threads/{thread_id}/runs/{run_id}/steps',
942
- });
943
- };
944
-
945
- /**
946
- * Retrieves a run step.
947
- */
948
- export const getRunStep = <ThrowOnError extends boolean = false>(options: Options<GetRunStepData, ThrowOnError>) => {
949
- return (options?.client ?? client).get<GetRunStepResponse, GetRunStepError, ThrowOnError>({
950
- ...options,
951
- url: '/threads/{thread_id}/runs/{run_id}/steps/{step_id}',
952
- });
953
- };
954
-
955
- /**
956
- * Returns a list of vector stores.
957
- */
958
- export const listVectorStores = <ThrowOnError extends boolean = false>(
959
- options?: Options<ListVectorStoresData, ThrowOnError>,
960
- ) => {
961
- return (options?.client ?? client).get<ListVectorStoresResponse2, ListVectorStoresError, ThrowOnError>({
962
- ...options,
963
- url: '/vector_stores',
964
- });
965
- };
966
-
967
- /**
968
- * Create a vector store.
969
- */
970
- export const createVectorStore = <ThrowOnError extends boolean = false>(
971
- options: Options<CreateVectorStoreData, ThrowOnError>,
972
- ) => {
973
- return (options?.client ?? client).post<CreateVectorStoreResponse, CreateVectorStoreError, ThrowOnError>({
974
- ...options,
975
- url: '/vector_stores',
976
- });
977
- };
978
-
979
- /**
980
- * Retrieves a vector store.
981
- */
982
- export const getVectorStore = <ThrowOnError extends boolean = false>(
983
- options: Options<GetVectorStoreData, ThrowOnError>,
984
- ) => {
985
- return (options?.client ?? client).get<GetVectorStoreResponse, GetVectorStoreError, ThrowOnError>({
986
- ...options,
987
- url: '/vector_stores/{vector_store_id}',
988
- });
989
- };
990
-
991
- /**
992
- * Modifies a vector store.
993
- */
994
- export const modifyVectorStore = <ThrowOnError extends boolean = false>(
995
- options: Options<ModifyVectorStoreData, ThrowOnError>,
996
- ) => {
997
- return (options?.client ?? client).post<ModifyVectorStoreResponse, ModifyVectorStoreError, ThrowOnError>({
998
- ...options,
999
- url: '/vector_stores/{vector_store_id}',
1000
- });
1001
- };
1002
-
1003
- /**
1004
- * Delete a vector store.
1005
- */
1006
- export const deleteVectorStore = <ThrowOnError extends boolean = false>(
1007
- options: Options<DeleteVectorStoreData, ThrowOnError>,
1008
- ) => {
1009
- return (options?.client ?? client).delete<DeleteVectorStoreResponse2, DeleteVectorStoreError, ThrowOnError>({
1010
- ...options,
1011
- url: '/vector_stores/{vector_store_id}',
1012
- });
1013
- };
1014
-
1015
- /**
1016
- * Returns a list of vector store files.
1017
- */
1018
- export const listVectorStoreFiles = <ThrowOnError extends boolean = false>(
1019
- options: Options<ListVectorStoreFilesData, ThrowOnError>,
1020
- ) => {
1021
- return (options?.client ?? client).get<ListVectorStoreFilesResponse2, ListVectorStoreFilesError, ThrowOnError>({
1022
- ...options,
1023
- url: '/vector_stores/{vector_store_id}/files',
1024
- });
1025
- };
1026
-
1027
- /**
1028
- * Create a vector store file by attaching a [File](/docs/api-reference/files) to a [vector store](/docs/api-reference/vector-stores/object).
1029
- */
1030
- export const createVectorStoreFile = <ThrowOnError extends boolean = false>(
1031
- options: Options<CreateVectorStoreFileData, ThrowOnError>,
1032
- ) => {
1033
- return (options?.client ?? client).post<CreateVectorStoreFileResponse, CreateVectorStoreFileError, ThrowOnError>({
1034
- ...options,
1035
- url: '/vector_stores/{vector_store_id}/files',
1036
- });
1037
- };
1038
-
1039
- /**
1040
- * Retrieves a vector store file.
1041
- */
1042
- export const getVectorStoreFile = <ThrowOnError extends boolean = false>(
1043
- options: Options<GetVectorStoreFileData, ThrowOnError>,
1044
- ) => {
1045
- return (options?.client ?? client).get<GetVectorStoreFileResponse, GetVectorStoreFileError, ThrowOnError>({
1046
- ...options,
1047
- url: '/vector_stores/{vector_store_id}/files/{file_id}',
1048
- });
1049
- };
1050
-
1051
- /**
1052
- * Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](/docs/api-reference/files/delete) endpoint.
1053
- */
1054
- export const deleteVectorStoreFile = <ThrowOnError extends boolean = false>(
1055
- options: Options<DeleteVectorStoreFileData, ThrowOnError>,
1056
- ) => {
1057
- return (options?.client ?? client).delete<DeleteVectorStoreFileResponse2, DeleteVectorStoreFileError, ThrowOnError>({
1058
- ...options,
1059
- url: '/vector_stores/{vector_store_id}/files/{file_id}',
1060
- });
1061
- };
1062
-
1063
- /**
1064
- * Create a vector store file batch.
1065
- */
1066
- export const createVectorStoreFileBatch = <ThrowOnError extends boolean = false>(
1067
- options: Options<CreateVectorStoreFileBatchData, ThrowOnError>,
1068
- ) => {
1069
- return (options?.client ?? client).post<
1070
- CreateVectorStoreFileBatchResponse,
1071
- CreateVectorStoreFileBatchError,
1072
- ThrowOnError
1073
- >({
1074
- ...options,
1075
- url: '/vector_stores/{vector_store_id}/file_batches',
1076
- });
1077
- };
1078
-
1079
- /**
1080
- * Retrieves a vector store file batch.
1081
- */
1082
- export const getVectorStoreFileBatch = <ThrowOnError extends boolean = false>(
1083
- options: Options<GetVectorStoreFileBatchData, ThrowOnError>,
1084
- ) => {
1085
- return (options?.client ?? client).get<GetVectorStoreFileBatchResponse, GetVectorStoreFileBatchError, ThrowOnError>({
1086
- ...options,
1087
- url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}',
1088
- });
1089
- };
1090
-
1091
- /**
1092
- * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.
1093
- */
1094
- export const cancelVectorStoreFileBatch = <ThrowOnError extends boolean = false>(
1095
- options: Options<CancelVectorStoreFileBatchData, ThrowOnError>,
1096
- ) => {
1097
- return (options?.client ?? client).post<
1098
- CancelVectorStoreFileBatchResponse,
1099
- CancelVectorStoreFileBatchError,
1100
- ThrowOnError
1101
- >({
1102
- ...options,
1103
- url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel',
1104
- });
1105
- };
1106
-
1107
- /**
1108
- * Returns a list of vector store files in a batch.
1109
- */
1110
- export const listFilesInVectorStoreBatch = <ThrowOnError extends boolean = false>(
1111
- options: Options<ListFilesInVectorStoreBatchData, ThrowOnError>,
1112
- ) => {
1113
- return (options?.client ?? client).get<
1114
- ListFilesInVectorStoreBatchResponse,
1115
- ListFilesInVectorStoreBatchError,
1116
- ThrowOnError
1117
- >({
1118
- ...options,
1119
- url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/files',
1120
- });
1121
- };
1122
-
1123
- /**
1124
- * Creates and executes a batch from an uploaded file of requests
1125
- */
1126
- export const createBatch = <ThrowOnError extends boolean = false>(options: Options<CreateBatchData, ThrowOnError>) => {
1127
- return (options?.client ?? client).post<CreateBatchResponse, CreateBatchError, ThrowOnError>({
1128
- ...options,
1129
- url: '/batches',
1130
- });
1131
- };
1132
-
1133
- /**
1134
- * List your organization's batches.
1135
- */
1136
- export const listBatches = <ThrowOnError extends boolean = false>(options?: Options<ListBatchesData, ThrowOnError>) => {
1137
- return (options?.client ?? client).get<ListBatchesResponse2, ListBatchesError, ThrowOnError>({
1138
- ...options,
1139
- url: '/batches',
1140
- });
1141
- };
1142
-
1143
- /**
1144
- * Retrieves a batch.
1145
- */
1146
- export const retrieveBatch = <ThrowOnError extends boolean = false>(
1147
- options: Options<RetrieveBatchData, ThrowOnError>,
1148
- ) => {
1149
- return (options?.client ?? client).get<RetrieveBatchResponse, RetrieveBatchError, ThrowOnError>({
1150
- ...options,
1151
- url: '/batches/{batch_id}',
1152
- });
1153
- };
1154
-
1155
- /**
1156
- * Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file.
1157
- */
1158
- export const cancelBatch = <ThrowOnError extends boolean = false>(options: Options<CancelBatchData, ThrowOnError>) => {
1159
- return (options?.client ?? client).post<CancelBatchResponse, CancelBatchError, ThrowOnError>({
1160
- ...options,
1161
- url: '/batches/{batch_id}/cancel',
1162
- });
1163
- };
1164
-
1165
- /**
1166
- * List user actions and configuration changes within this organization.
1167
- */
1168
- export const listAuditLogs = <ThrowOnError extends boolean = false>(
1169
- options?: Options<ListAuditLogsData, ThrowOnError>,
1170
- ) => {
1171
- return (options?.client ?? client).get<ListAuditLogsResponse2, ListAuditLogsError, ThrowOnError>({
1172
- ...options,
1173
- url: '/organization/audit_logs',
1174
- });
1175
- };
1176
-
1177
- /**
1178
- * Returns a list of invites in the organization.
1179
- */
1180
- export const listInvites = <ThrowOnError extends boolean = false>(options?: Options<ListInvitesData, ThrowOnError>) => {
1181
- return (options?.client ?? client).get<ListInvitesResponse, ListInvitesError, ThrowOnError>({
1182
- ...options,
1183
- url: '/organization/invites',
1184
- });
1185
- };
1186
-
1187
- /**
1188
- * Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.
1189
- */
1190
- export const inviteUser = <ThrowOnError extends boolean = false>(options: Options<InviteUserData, ThrowOnError>) => {
1191
- return (options?.client ?? client).post<InviteUserResponse, InviteUserError, ThrowOnError>({
1192
- ...options,
1193
- url: '/organization/invites',
1194
- });
1195
- };
1196
-
1197
- /**
1198
- * Retrieves an invite.
1199
- */
1200
- export const retrieveInvite = <ThrowOnError extends boolean = false>(
1201
- options: Options<RetrieveInviteData, ThrowOnError>,
1202
- ) => {
1203
- return (options?.client ?? client).get<RetrieveInviteResponse, RetrieveInviteError, ThrowOnError>({
1204
- ...options,
1205
- url: '/organization/invites/{invite_id}',
1206
- });
1207
- };
1208
-
1209
- /**
1210
- * Delete an invite. If the invite has already been accepted, it cannot be deleted.
1211
- */
1212
- export const deleteInvite = <ThrowOnError extends boolean = false>(
1213
- options: Options<DeleteInviteData, ThrowOnError>,
1214
- ) => {
1215
- return (options?.client ?? client).delete<DeleteInviteResponse, DeleteInviteError, ThrowOnError>({
1216
- ...options,
1217
- url: '/organization/invites/{invite_id}',
1218
- });
1219
- };
1220
-
1221
- /**
1222
- * Lists all of the users in the organization.
1223
- */
1224
- export const listUsers = <ThrowOnError extends boolean = false>(options?: Options<ListUsersData, ThrowOnError>) => {
1225
- return (options?.client ?? client).get<ListUsersResponse, ListUsersError, ThrowOnError>({
1226
- ...options,
1227
- url: '/organization/users',
1228
- });
1229
- };
1230
-
1231
- /**
1232
- * Retrieves a user by their identifier.
1233
- */
1234
- export const retrieveUser = <ThrowOnError extends boolean = false>(
1235
- options: Options<RetrieveUserData, ThrowOnError>,
1236
- ) => {
1237
- return (options?.client ?? client).get<RetrieveUserResponse, RetrieveUserError, ThrowOnError>({
1238
- ...options,
1239
- url: '/organization/users/{user_id}',
1240
- });
1241
- };
1242
-
1243
- /**
1244
- * Modifies a user's role in the organization.
1245
- */
1246
- export const modifyUser = <ThrowOnError extends boolean = false>(options: Options<ModifyUserData, ThrowOnError>) => {
1247
- return (options?.client ?? client).post<ModifyUserResponse, ModifyUserError, ThrowOnError>({
1248
- ...options,
1249
- url: '/organization/users/{user_id}',
1250
- });
1251
- };
1252
-
1253
- /**
1254
- * Deletes a user from the organization.
1255
- */
1256
- export const deleteUser = <ThrowOnError extends boolean = false>(options: Options<DeleteUserData, ThrowOnError>) => {
1257
- return (options?.client ?? client).delete<DeleteUserResponse, DeleteUserError, ThrowOnError>({
1258
- ...options,
1259
- url: '/organization/users/{user_id}',
1260
- });
1261
- };
1262
-
1263
- /**
1264
- * Returns a list of projects.
1265
- */
1266
- export const listProjects = <ThrowOnError extends boolean = false>(
1267
- options?: Options<ListProjectsData, ThrowOnError>,
1268
- ) => {
1269
- return (options?.client ?? client).get<ListProjectsResponse, ListProjectsError, ThrowOnError>({
1270
- ...options,
1271
- url: '/organization/projects',
1272
- });
1273
- };
1274
-
1275
- /**
1276
- * Create a new project in the organization. Projects can be created and archived, but cannot be deleted.
1277
- */
1278
- export const createProject = <ThrowOnError extends boolean = false>(
1279
- options: Options<CreateProjectData, ThrowOnError>,
1280
- ) => {
1281
- return (options?.client ?? client).post<CreateProjectResponse, CreateProjectError, ThrowOnError>({
1282
- ...options,
1283
- url: '/organization/projects',
1284
- });
1285
- };
1286
-
1287
- /**
1288
- * Retrieves a project.
1289
- */
1290
- export const retrieveProject = <ThrowOnError extends boolean = false>(
1291
- options: Options<RetrieveProjectData, ThrowOnError>,
1292
- ) => {
1293
- return (options?.client ?? client).get<RetrieveProjectResponse, RetrieveProjectError, ThrowOnError>({
1294
- ...options,
1295
- url: '/organization/projects/{project_id}',
1296
- });
1297
- };
1298
-
1299
- /**
1300
- * Modifies a project in the organization.
1301
- */
1302
- export const modifyProject = <ThrowOnError extends boolean = false>(
1303
- options: Options<ModifyProjectData, ThrowOnError>,
1304
- ) => {
1305
- return (options?.client ?? client).post<ModifyProjectResponse, ModifyProjectError, ThrowOnError>({
1306
- ...options,
1307
- url: '/organization/projects/{project_id}',
1308
- });
1309
- };
1310
-
1311
- /**
1312
- * Archives a project in the organization. Archived projects cannot be used or updated.
1313
- */
1314
- export const archiveProject = <ThrowOnError extends boolean = false>(
1315
- options: Options<ArchiveProjectData, ThrowOnError>,
1316
- ) => {
1317
- return (options?.client ?? client).post<ArchiveProjectResponse, ArchiveProjectError, ThrowOnError>({
1318
- ...options,
1319
- url: '/organization/projects/{project_id}/archive',
1320
- });
1321
- };
1322
-
1323
- /**
1324
- * Returns a list of users in the project.
1325
- */
1326
- export const listProjectUsers = <ThrowOnError extends boolean = false>(
1327
- options: Options<ListProjectUsersData, ThrowOnError>,
1328
- ) => {
1329
- return (options?.client ?? client).get<ListProjectUsersResponse, ListProjectUsersError, ThrowOnError>({
1330
- ...options,
1331
- url: '/organization/projects/{project_id}/users',
1332
- });
1333
- };
1334
-
1335
- /**
1336
- * Adds a user to the project. Users must already be members of the organization to be added to a project.
1337
- */
1338
- export const createProjectUser = <ThrowOnError extends boolean = false>(
1339
- options: Options<CreateProjectUserData, ThrowOnError>,
1340
- ) => {
1341
- return (options?.client ?? client).post<CreateProjectUserResponse, CreateProjectUserError, ThrowOnError>({
1342
- ...options,
1343
- url: '/organization/projects/{project_id}/users',
1344
- });
1345
- };
1346
-
1347
- /**
1348
- * Retrieves a user in the project.
1349
- */
1350
- export const retrieveProjectUser = <ThrowOnError extends boolean = false>(
1351
- options: Options<RetrieveProjectUserData, ThrowOnError>,
1352
- ) => {
1353
- return (options?.client ?? client).get<RetrieveProjectUserResponse, RetrieveProjectUserError, ThrowOnError>({
1354
- ...options,
1355
- url: '/organization/projects/{project_id}/users/{user_id}',
1356
- });
1357
- };
1358
-
1359
- /**
1360
- * Modifies a user's role in the project.
1361
- */
1362
- export const modifyProjectUser = <ThrowOnError extends boolean = false>(
1363
- options: Options<ModifyProjectUserData, ThrowOnError>,
1364
- ) => {
1365
- return (options?.client ?? client).post<ModifyProjectUserResponse, ModifyProjectUserError, ThrowOnError>({
1366
- ...options,
1367
- url: '/organization/projects/{project_id}/users/{user_id}',
1368
- });
1369
- };
1370
-
1371
- /**
1372
- * Deletes a user from the project.
1373
- */
1374
- export const deleteProjectUser = <ThrowOnError extends boolean = false>(
1375
- options: Options<DeleteProjectUserData, ThrowOnError>,
1376
- ) => {
1377
- return (options?.client ?? client).delete<DeleteProjectUserResponse, DeleteProjectUserError, ThrowOnError>({
1378
- ...options,
1379
- url: '/organization/projects/{project_id}/users/{user_id}',
1380
- });
1381
- };
1382
-
1383
- /**
1384
- * Returns a list of service accounts in the project.
1385
- */
1386
- export const listProjectServiceAccounts = <ThrowOnError extends boolean = false>(
1387
- options: Options<ListProjectServiceAccountsData, ThrowOnError>,
1388
- ) => {
1389
- return (options?.client ?? client).get<
1390
- ListProjectServiceAccountsResponse,
1391
- ListProjectServiceAccountsError,
1392
- ThrowOnError
1393
- >({
1394
- ...options,
1395
- url: '/organization/projects/{project_id}/service_accounts',
1396
- });
1397
- };
1398
-
1399
- /**
1400
- * Creates a new service account in the project. This also returns an unredacted API key for the service account.
1401
- */
1402
- export const createProjectServiceAccount = <ThrowOnError extends boolean = false>(
1403
- options: Options<CreateProjectServiceAccountData, ThrowOnError>,
1404
- ) => {
1405
- return (options?.client ?? client).post<
1406
- CreateProjectServiceAccountResponse,
1407
- CreateProjectServiceAccountError,
1408
- ThrowOnError
1409
- >({
1410
- ...options,
1411
- url: '/organization/projects/{project_id}/service_accounts',
1412
- });
1413
- };
1414
-
1415
- /**
1416
- * Retrieves a service account in the project.
1417
- */
1418
- export const retrieveProjectServiceAccount = <ThrowOnError extends boolean = false>(
1419
- options: Options<RetrieveProjectServiceAccountData, ThrowOnError>,
1420
- ) => {
1421
- return (options?.client ?? client).get<
1422
- RetrieveProjectServiceAccountResponse,
1423
- RetrieveProjectServiceAccountError,
1424
- ThrowOnError
1425
- >({
1426
- ...options,
1427
- url: '/organization/projects/{project_id}/service_accounts/{service_account_id}',
1428
- });
1429
- };
1430
-
1431
- /**
1432
- * Deletes a service account from the project.
1433
- */
1434
- export const deleteProjectServiceAccount = <ThrowOnError extends boolean = false>(
1435
- options: Options<DeleteProjectServiceAccountData, ThrowOnError>,
1436
- ) => {
1437
- return (options?.client ?? client).delete<
1438
- DeleteProjectServiceAccountResponse,
1439
- DeleteProjectServiceAccountError,
1440
- ThrowOnError
1441
- >({
1442
- ...options,
1443
- url: '/organization/projects/{project_id}/service_accounts/{service_account_id}',
1444
- });
1445
- };
1446
-
1447
- /**
1448
- * Returns a list of API keys in the project.
1449
- */
1450
- export const listProjectApiKeys = <ThrowOnError extends boolean = false>(
1451
- options: Options<ListProjectApiKeysData, ThrowOnError>,
1452
- ) => {
1453
- return (options?.client ?? client).get<ListProjectApiKeysResponse, ListProjectApiKeysError, ThrowOnError>({
1454
- ...options,
1455
- url: '/organization/projects/{project_id}/api_keys',
1456
- });
1457
- };
1458
-
1459
- /**
1460
- * Retrieves an API key in the project.
1461
- */
1462
- export const retrieveProjectApiKey = <ThrowOnError extends boolean = false>(
1463
- options: Options<RetrieveProjectApiKeyData, ThrowOnError>,
1464
- ) => {
1465
- return (options?.client ?? client).get<RetrieveProjectApiKeyResponse, RetrieveProjectApiKeyError, ThrowOnError>({
1466
- ...options,
1467
- url: '/organization/projects/{project_id}/api_keys/{key_id}',
1468
- });
1469
- };
1470
-
1471
- /**
1472
- * Deletes an API key from the project.
1473
- */
1474
- export const deleteProjectApiKey = <ThrowOnError extends boolean = false>(
1475
- options: Options<DeleteProjectApiKeyData, ThrowOnError>,
1476
- ) => {
1477
- return (options?.client ?? client).delete<DeleteProjectApiKeyResponse, DeleteProjectApiKeyError, ThrowOnError>({
1478
- ...options,
1479
- url: '/organization/projects/{project_id}/api_keys/{key_id}',
1480
- });
1481
- };