@bodhiapp/ts-client 0.1.3 → 0.1.5

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.
@@ -0,0 +1,1084 @@
1
+ export type AliasResponse = {
2
+ alias: string;
3
+ context_params: GptContextParams;
4
+ filename: string;
5
+ model_params: {};
6
+ repo: string;
7
+ request_params: OaiRequestParams;
8
+ snapshot: string;
9
+ source: string;
10
+ };
11
+ export type ApiToken = {
12
+ created_at: string;
13
+ id: string;
14
+ name: string;
15
+ status: TokenStatus;
16
+ token_hash: string;
17
+ token_id: string;
18
+ updated_at: string;
19
+ user_id: string;
20
+ };
21
+ export type ApiTokenResponse = {
22
+ /**
23
+ * Offline token that can be used as API Token
24
+ */
25
+ offline_token: string;
26
+ };
27
+ /**
28
+ * Application information and status
29
+ */
30
+ export type AppInfo = {
31
+ /**
32
+ * Current application status
33
+ */
34
+ status: AppStatus;
35
+ /**
36
+ * Application version
37
+ */
38
+ version: string;
39
+ };
40
+ export type AppStatus = 'setup' | 'ready' | 'resource-admin';
41
+ export type AuthCallbackRequest = {
42
+ /**
43
+ * OAuth authorization code from successful authentication
44
+ */
45
+ code?: string | null;
46
+ /**
47
+ * OAuth error code if authentication failed
48
+ */
49
+ error?: string | null;
50
+ /**
51
+ * OAuth error description if authentication failed
52
+ */
53
+ error_description?: string | null;
54
+ /**
55
+ * OAuth state parameter for CSRF protection
56
+ */
57
+ state?: string | null;
58
+ [key: string]: string | (string | null) | (string | null) | (string | null) | (string | null) | undefined;
59
+ };
60
+ export type ChatRequest = {
61
+ format?: string | null;
62
+ keep_alive?: null | Duration;
63
+ messages: Array<Message>;
64
+ model: string;
65
+ options?: null | Options;
66
+ stream?: boolean | null;
67
+ };
68
+ /**
69
+ * Request to create a new API token
70
+ */
71
+ export type CreateApiTokenRequest = {
72
+ /**
73
+ * Optional name for the API token
74
+ */
75
+ name?: string | null;
76
+ };
77
+ export type DownloadRequest = {
78
+ created_at: string;
79
+ error?: string | null;
80
+ filename: string;
81
+ id: string;
82
+ repo: string;
83
+ status: DownloadStatus;
84
+ updated_at: string;
85
+ };
86
+ export type DownloadStatus = 'pending' | 'completed' | 'error';
87
+ export type Duration = string;
88
+ export type ErrorBody = {
89
+ code?: string | null;
90
+ message: string;
91
+ param?: string | null;
92
+ type: string;
93
+ };
94
+ export type GptContextParams = {
95
+ n_ctx?: number | null;
96
+ n_keep?: number | null;
97
+ n_parallel?: number | null;
98
+ n_predict?: number | null;
99
+ n_seed?: number | null;
100
+ n_threads?: number | null;
101
+ };
102
+ export type ListModelResponseWrapper = {
103
+ data: Array<{
104
+ /**
105
+ * The Unix timestamp (in seconds) when the model was created.
106
+ */
107
+ created: number;
108
+ /**
109
+ * The model identifier, which can be referenced in the API endpoints.
110
+ */
111
+ id: string;
112
+ /**
113
+ * The object type, which is always "model".
114
+ */
115
+ object: string;
116
+ /**
117
+ * The organization that owns the model.
118
+ */
119
+ owned_by: string;
120
+ }>;
121
+ object: string;
122
+ };
123
+ export type LocalModelResponse = {
124
+ filename: string;
125
+ model_params: {};
126
+ repo: string;
127
+ size?: number | null;
128
+ snapshot: string;
129
+ };
130
+ export type Message = {
131
+ content: string;
132
+ images?: Array<string> | null;
133
+ role: string;
134
+ };
135
+ export type Model = {
136
+ details: ModelDetails;
137
+ digest: string;
138
+ model: string;
139
+ modified_at: number;
140
+ size: number;
141
+ };
142
+ export type ModelDetails = {
143
+ families?: Array<string> | null;
144
+ family: string;
145
+ format: string;
146
+ parameter_size: string;
147
+ parent_model?: string | null;
148
+ quantization_level: string;
149
+ };
150
+ export type ModelsResponse = {
151
+ models: Array<Model>;
152
+ };
153
+ /**
154
+ * Request to pull a model file from HuggingFace
155
+ */
156
+ export type NewDownloadRequest = {
157
+ /**
158
+ * Model file name to pull
159
+ */
160
+ filename: string;
161
+ /**
162
+ * HuggingFace repository name
163
+ */
164
+ repo: string;
165
+ };
166
+ export type OaiRequestParams = {
167
+ frequency_penalty?: number | null;
168
+ max_tokens?: number | null;
169
+ presence_penalty?: number | null;
170
+ seed?: number | null;
171
+ stop?: Array<string>;
172
+ temperature?: number | null;
173
+ top_p?: number | null;
174
+ user?: string | null;
175
+ };
176
+ export type OllamaError = {
177
+ error: string;
178
+ };
179
+ export type OpenAiApiError = {
180
+ error: ErrorBody;
181
+ };
182
+ export type Options = {
183
+ f16_kv?: boolean | null;
184
+ frequency_penalty?: number | null;
185
+ logits_all?: boolean | null;
186
+ low_vram?: boolean | null;
187
+ main_gpu?: number | null;
188
+ mirostat?: number | null;
189
+ mirostat_eta?: number | null;
190
+ mirostat_tau?: number | null;
191
+ num_batch?: number | null;
192
+ num_ctx?: number | null;
193
+ num_gpu?: number | null;
194
+ num_keep?: number | null;
195
+ num_predict?: number | null;
196
+ num_thread?: number | null;
197
+ numa?: boolean | null;
198
+ penalize_newline?: boolean | null;
199
+ presence_penalty?: number | null;
200
+ repeat_last_n?: number | null;
201
+ repeat_penalty?: number | null;
202
+ seed?: number | null;
203
+ stop?: Array<string> | null;
204
+ temperature?: number | null;
205
+ tfs_z?: number | null;
206
+ top_k?: number | null;
207
+ top_p?: number | null;
208
+ typical_p?: number | null;
209
+ use_mlock?: boolean | null;
210
+ use_mmap?: boolean | null;
211
+ vocab_only?: boolean | null;
212
+ };
213
+ export type PaginatedResponseAliasResponse = {
214
+ data: Array<{
215
+ alias: string;
216
+ context_params: GptContextParams;
217
+ filename: string;
218
+ model_params: {};
219
+ repo: string;
220
+ request_params: OaiRequestParams;
221
+ snapshot: string;
222
+ source: string;
223
+ }>;
224
+ page: number;
225
+ page_size: number;
226
+ total: number;
227
+ };
228
+ export type PaginatedResponseApiToken = {
229
+ data: Array<{
230
+ created_at: string;
231
+ id: string;
232
+ name: string;
233
+ status: TokenStatus;
234
+ token_hash: string;
235
+ token_id: string;
236
+ updated_at: string;
237
+ user_id: string;
238
+ }>;
239
+ page: number;
240
+ page_size: number;
241
+ total: number;
242
+ };
243
+ export type PaginatedResponseDownloadRequest = {
244
+ data: Array<{
245
+ created_at: string;
246
+ error?: string | null;
247
+ filename: string;
248
+ id: string;
249
+ repo: string;
250
+ status: DownloadStatus;
251
+ updated_at: string;
252
+ }>;
253
+ page: number;
254
+ page_size: number;
255
+ total: number;
256
+ };
257
+ export type PaginatedResponseLocalModelResponse = {
258
+ data: Array<{
259
+ filename: string;
260
+ model_params: {};
261
+ repo: string;
262
+ size?: number | null;
263
+ snapshot: string;
264
+ }>;
265
+ page: number;
266
+ page_size: number;
267
+ total: number;
268
+ };
269
+ /**
270
+ * Response to the ping endpoint
271
+ */
272
+ export type PingResponse = {
273
+ /**
274
+ * always returns "pong"
275
+ */
276
+ message: string;
277
+ };
278
+ export type RedirectResponse = {
279
+ /**
280
+ * The URL to redirect to for OAuth authentication
281
+ */
282
+ location: string;
283
+ };
284
+ export type Repo = {
285
+ name: string;
286
+ user: string;
287
+ };
288
+ export type SettingInfo = {
289
+ current_value: unknown;
290
+ default_value: unknown;
291
+ key: string;
292
+ metadata: SettingMetadata;
293
+ source: SettingSource;
294
+ };
295
+ export type SettingMetadata = {
296
+ type: 'string';
297
+ } | {
298
+ max: number;
299
+ min: number;
300
+ type: 'number';
301
+ } | {
302
+ type: 'boolean';
303
+ } | {
304
+ options: Array<string>;
305
+ type: 'option';
306
+ };
307
+ export type SettingSource = 'system' | 'command_line' | 'environment' | 'settings_file' | 'default';
308
+ /**
309
+ * Request to setup the application in authenticated mode
310
+ */
311
+ export type SetupRequest = {
312
+ [key: string]: unknown;
313
+ };
314
+ /**
315
+ * Response containing the updated application status after setup
316
+ */
317
+ export type SetupResponse = {
318
+ /**
319
+ * New application status after setup
320
+ * - resource-admin: When setup in authenticated mode
321
+ * - ready: When setup in non-authenticated mode
322
+ */
323
+ status: AppStatus;
324
+ };
325
+ export type ShowRequest = {
326
+ name: string;
327
+ };
328
+ export type ShowResponse = {
329
+ details: ModelDetails;
330
+ license: string;
331
+ model_info: {};
332
+ modelfile: string;
333
+ modified_at: number;
334
+ parameters: string;
335
+ template: string;
336
+ };
337
+ export type TokenStatus = 'active' | 'inactive';
338
+ /**
339
+ * Request to update an existing API token
340
+ */
341
+ export type UpdateApiTokenRequest = {
342
+ /**
343
+ * New name for the token
344
+ */
345
+ name: string;
346
+ /**
347
+ * New status for the token (active/inactive)
348
+ */
349
+ status: TokenStatus;
350
+ };
351
+ /**
352
+ * Request to update a setting value
353
+ */
354
+ export type UpdateSettingRequest = {
355
+ value: unknown;
356
+ };
357
+ /**
358
+ * Information about the currently logged in user
359
+ */
360
+ export type UserInfo = {
361
+ /**
362
+ * User's email address
363
+ */
364
+ email?: string | null;
365
+ /**
366
+ * If user is logged in
367
+ */
368
+ logged_in: boolean;
369
+ /**
370
+ * List of roles assigned to the user
371
+ */
372
+ roles: Array<string>;
373
+ };
374
+ export type ChatOllamaModelData = {
375
+ /**
376
+ * Chat request in Ollama format
377
+ */
378
+ body: ChatRequest;
379
+ path?: never;
380
+ query?: never;
381
+ url: '/api/chat';
382
+ };
383
+ export type ChatOllamaModelErrors = {
384
+ /**
385
+ * Invalid request
386
+ */
387
+ 400: OllamaError;
388
+ /**
389
+ * Model not found
390
+ */
391
+ 404: OllamaError;
392
+ /**
393
+ * Internal server error
394
+ */
395
+ 500: OllamaError;
396
+ };
397
+ export type ChatOllamaModelError = ChatOllamaModelErrors[keyof ChatOllamaModelErrors];
398
+ export type ChatOllamaModelResponses = {
399
+ /**
400
+ * Chat response
401
+ */
402
+ 200: unknown;
403
+ };
404
+ export type ShowOllamaModelData = {
405
+ /**
406
+ * Model name to get details for
407
+ */
408
+ body: ShowRequest;
409
+ path?: never;
410
+ query?: never;
411
+ url: '/api/show';
412
+ };
413
+ export type ShowOllamaModelErrors = {
414
+ /**
415
+ * Model not found
416
+ */
417
+ 404: OllamaError;
418
+ /**
419
+ * Internal server error
420
+ */
421
+ 500: OllamaError;
422
+ };
423
+ export type ShowOllamaModelError = ShowOllamaModelErrors[keyof ShowOllamaModelErrors];
424
+ export type ShowOllamaModelResponses = {
425
+ /**
426
+ * Model details
427
+ */
428
+ 200: ShowResponse;
429
+ };
430
+ export type ShowOllamaModelResponse = ShowOllamaModelResponses[keyof ShowOllamaModelResponses];
431
+ export type ListOllamaModelsData = {
432
+ body?: never;
433
+ path?: never;
434
+ query?: never;
435
+ url: '/api/tags';
436
+ };
437
+ export type ListOllamaModelsErrors = {
438
+ /**
439
+ * Internal server error
440
+ */
441
+ 500: OllamaError;
442
+ };
443
+ export type ListOllamaModelsError = ListOllamaModelsErrors[keyof ListOllamaModelsErrors];
444
+ export type ListOllamaModelsResponses = {
445
+ /**
446
+ * List of available models
447
+ */
448
+ 200: ModelsResponse;
449
+ };
450
+ export type ListOllamaModelsResponse = ListOllamaModelsResponses[keyof ListOllamaModelsResponses];
451
+ export type CompleteOAuthFlowData = {
452
+ body: AuthCallbackRequest;
453
+ path?: never;
454
+ query?: never;
455
+ url: '/bodhi/v1/auth/callback';
456
+ };
457
+ export type CompleteOAuthFlowErrors = {
458
+ /**
459
+ * OAuth error or invalid request
460
+ */
461
+ 422: OpenAiApiError;
462
+ /**
463
+ * Internal server error
464
+ */
465
+ 500: OpenAiApiError;
466
+ };
467
+ export type CompleteOAuthFlowError = CompleteOAuthFlowErrors[keyof CompleteOAuthFlowErrors];
468
+ export type CompleteOAuthFlowResponses = {
469
+ /**
470
+ * OAuth flow completed successfully, return redirect URL
471
+ */
472
+ 200: RedirectResponse;
473
+ };
474
+ export type CompleteOAuthFlowResponse = CompleteOAuthFlowResponses[keyof CompleteOAuthFlowResponses];
475
+ export type InitiateOAuthFlowData = {
476
+ body: unknown;
477
+ path?: never;
478
+ query?: never;
479
+ url: '/bodhi/v1/auth/initiate';
480
+ };
481
+ export type InitiateOAuthFlowErrors = {
482
+ /**
483
+ * Internal server error
484
+ */
485
+ 500: OpenAiApiError;
486
+ };
487
+ export type InitiateOAuthFlowError = InitiateOAuthFlowErrors[keyof InitiateOAuthFlowErrors];
488
+ export type InitiateOAuthFlowResponses = {
489
+ /**
490
+ * User already authenticated, return home page URL
491
+ */
492
+ 200: RedirectResponse;
493
+ /**
494
+ * User not authenticated, return OAuth authorization URL
495
+ */
496
+ 201: RedirectResponse;
497
+ };
498
+ export type InitiateOAuthFlowResponse = InitiateOAuthFlowResponses[keyof InitiateOAuthFlowResponses];
499
+ export type GetAppInfoData = {
500
+ body?: never;
501
+ path?: never;
502
+ query?: never;
503
+ url: '/bodhi/v1/info';
504
+ };
505
+ export type GetAppInfoErrors = {
506
+ /**
507
+ * Internal server error
508
+ */
509
+ 500: OpenAiApiError;
510
+ };
511
+ export type GetAppInfoError = GetAppInfoErrors[keyof GetAppInfoErrors];
512
+ export type GetAppInfoResponses = {
513
+ /**
514
+ * Returns the status information about the Application
515
+ */
516
+ 200: AppInfo;
517
+ };
518
+ export type GetAppInfoResponse = GetAppInfoResponses[keyof GetAppInfoResponses];
519
+ export type LogoutUserData = {
520
+ body?: never;
521
+ path?: never;
522
+ query?: never;
523
+ url: '/bodhi/v1/logout';
524
+ };
525
+ export type LogoutUserErrors = {
526
+ /**
527
+ * Session deletion failed
528
+ */
529
+ 500: OpenAiApiError;
530
+ };
531
+ export type LogoutUserError = LogoutUserErrors[keyof LogoutUserErrors];
532
+ export type LogoutUserResponses = {
533
+ /**
534
+ * Logout successful, return redirect URL
535
+ */
536
+ 200: RedirectResponse;
537
+ };
538
+ export type LogoutUserResponse = LogoutUserResponses[keyof LogoutUserResponses];
539
+ export type ListModelFilesData = {
540
+ body?: never;
541
+ path?: never;
542
+ query?: {
543
+ /**
544
+ * Page number (1-based)
545
+ */
546
+ page?: number;
547
+ /**
548
+ * Number of items per page (max 100)
549
+ */
550
+ page_size?: number;
551
+ /**
552
+ * Field to sort by (repo, filename, size, updated_at, snapshot)
553
+ */
554
+ sort?: string | null;
555
+ /**
556
+ * Sort order (asc or desc)
557
+ */
558
+ sort_order?: string;
559
+ };
560
+ url: '/bodhi/v1/modelfiles';
561
+ };
562
+ export type ListModelFilesErrors = {
563
+ /**
564
+ * Internal server error
565
+ */
566
+ 500: OpenAiApiError;
567
+ };
568
+ export type ListModelFilesError = ListModelFilesErrors[keyof ListModelFilesErrors];
569
+ export type ListModelFilesResponses = {
570
+ /**
571
+ * List of supported model files from local HuggingFace cache folder
572
+ */
573
+ 200: PaginatedResponseLocalModelResponse;
574
+ };
575
+ export type ListModelFilesResponse = ListModelFilesResponses[keyof ListModelFilesResponses];
576
+ export type ListDownloadsData = {
577
+ body?: never;
578
+ path?: never;
579
+ query?: {
580
+ /**
581
+ * Page number (1-based)
582
+ */
583
+ page?: number;
584
+ /**
585
+ * Number of items per page (max 100)
586
+ */
587
+ page_size?: number;
588
+ /**
589
+ * Field to sort by (repo, filename, size, updated_at, snapshot)
590
+ */
591
+ sort?: string | null;
592
+ /**
593
+ * Sort order (asc or desc)
594
+ */
595
+ sort_order?: string;
596
+ };
597
+ url: '/bodhi/v1/modelfiles/pull';
598
+ };
599
+ export type ListDownloadsErrors = {
600
+ /**
601
+ * Internal server error
602
+ */
603
+ 500: OpenAiApiError;
604
+ };
605
+ export type ListDownloadsError = ListDownloadsErrors[keyof ListDownloadsErrors];
606
+ export type ListDownloadsResponses = {
607
+ /**
608
+ * List of download requests
609
+ */
610
+ 200: PaginatedResponseDownloadRequest;
611
+ };
612
+ export type ListDownloadsResponse = ListDownloadsResponses[keyof ListDownloadsResponses];
613
+ export type PullModelFileData = {
614
+ /**
615
+ * Model file download request
616
+ */
617
+ body: NewDownloadRequest;
618
+ path?: never;
619
+ query?: never;
620
+ url: '/bodhi/v1/modelfiles/pull';
621
+ };
622
+ export type PullModelFileErrors = {
623
+ /**
624
+ * File already exists or invalid input
625
+ */
626
+ 400: OpenAiApiError;
627
+ /**
628
+ * Internal server error
629
+ */
630
+ 500: OpenAiApiError;
631
+ };
632
+ export type PullModelFileError = PullModelFileErrors[keyof PullModelFileErrors];
633
+ export type PullModelFileResponses = {
634
+ /**
635
+ * Existing download request found
636
+ */
637
+ 200: DownloadRequest;
638
+ /**
639
+ * Download request created
640
+ */
641
+ 201: DownloadRequest;
642
+ };
643
+ export type PullModelFileResponse = PullModelFileResponses[keyof PullModelFileResponses];
644
+ export type PullModelByAliasData = {
645
+ body?: never;
646
+ path: {
647
+ /**
648
+ * Available model aliases:
649
+ * - llama3:instruct - Meta Llama 3 8B Instruct
650
+ * - llama3:70b-instruct - Meta Llama 3 70B Instruct
651
+ * - llama2:chat - Llama 2 7B Chat
652
+ * - llama2:13b-chat - Llama 2 13B Chat
653
+ * - llama2:70b-chat - Llama 2 70B Chat
654
+ * - phi3:mini - Phi 3 Mini
655
+ * - mistral:instruct - Mistral 7B Instruct
656
+ * - mixtral:instruct - Mixtral 8x7B Instruct
657
+ * - gemma:instruct - Gemma 7B Instruct
658
+ * - gemma:7b-instruct-v1.1-q8_0 - Gemma 1.1 7B Instruct
659
+ */
660
+ alias: string;
661
+ };
662
+ query?: never;
663
+ url: '/bodhi/v1/modelfiles/pull/{alias}';
664
+ };
665
+ export type PullModelByAliasErrors = {
666
+ /**
667
+ * File already exists
668
+ */
669
+ 400: OpenAiApiError;
670
+ /**
671
+ * Alias not found
672
+ */
673
+ 404: OpenAiApiError;
674
+ /**
675
+ * Internal server error
676
+ */
677
+ 500: OpenAiApiError;
678
+ };
679
+ export type PullModelByAliasError = PullModelByAliasErrors[keyof PullModelByAliasErrors];
680
+ export type PullModelByAliasResponses = {
681
+ /**
682
+ * Existing download request found
683
+ */
684
+ 200: DownloadRequest;
685
+ /**
686
+ * Download request created
687
+ */
688
+ 201: DownloadRequest;
689
+ };
690
+ export type PullModelByAliasResponse = PullModelByAliasResponses[keyof PullModelByAliasResponses];
691
+ export type GetDownloadStatusData = {
692
+ body?: never;
693
+ path: {
694
+ /**
695
+ * Download request identifier
696
+ */
697
+ id: string;
698
+ };
699
+ query?: never;
700
+ url: '/bodhi/v1/modelfiles/pull/{id}';
701
+ };
702
+ export type GetDownloadStatusErrors = {
703
+ /**
704
+ * Download request not found
705
+ */
706
+ 404: OpenAiApiError;
707
+ /**
708
+ * Internal server error
709
+ */
710
+ 500: OpenAiApiError;
711
+ };
712
+ export type GetDownloadStatusError = GetDownloadStatusErrors[keyof GetDownloadStatusErrors];
713
+ export type GetDownloadStatusResponses = {
714
+ /**
715
+ * Download request found
716
+ */
717
+ 200: DownloadRequest;
718
+ };
719
+ export type GetDownloadStatusResponse = GetDownloadStatusResponses[keyof GetDownloadStatusResponses];
720
+ export type ListModelAliasesData = {
721
+ body?: never;
722
+ path?: never;
723
+ query?: {
724
+ /**
725
+ * Page number (1-based)
726
+ */
727
+ page?: number;
728
+ /**
729
+ * Number of items per page (max 100)
730
+ */
731
+ page_size?: number;
732
+ /**
733
+ * Field to sort by (repo, filename, size, updated_at, snapshot)
734
+ */
735
+ sort?: string | null;
736
+ /**
737
+ * Sort order (asc or desc)
738
+ */
739
+ sort_order?: string;
740
+ };
741
+ url: '/bodhi/v1/models';
742
+ };
743
+ export type ListModelAliasesErrors = {
744
+ /**
745
+ * Internal server error
746
+ */
747
+ 500: OpenAiApiError;
748
+ };
749
+ export type ListModelAliasesError = ListModelAliasesErrors[keyof ListModelAliasesErrors];
750
+ export type ListModelAliasesResponses = {
751
+ /**
752
+ * List of configured model aliases
753
+ */
754
+ 200: PaginatedResponseAliasResponse;
755
+ };
756
+ export type ListModelAliasesResponse = ListModelAliasesResponses[keyof ListModelAliasesResponses];
757
+ export type GetAliasData = {
758
+ body?: never;
759
+ path: {
760
+ /**
761
+ * Alias identifier for the model
762
+ */
763
+ alias: string;
764
+ };
765
+ query?: never;
766
+ url: '/bodhi/v1/models/{alias}';
767
+ };
768
+ export type GetAliasErrors = {
769
+ /**
770
+ * Alias not found
771
+ */
772
+ 404: OpenAiApiError;
773
+ /**
774
+ * Internal server error
775
+ */
776
+ 500: OpenAiApiError;
777
+ };
778
+ export type GetAliasError = GetAliasErrors[keyof GetAliasErrors];
779
+ export type GetAliasResponses = {
780
+ /**
781
+ * Model alias details
782
+ */
783
+ 200: AliasResponse;
784
+ };
785
+ export type GetAliasResponse = GetAliasResponses[keyof GetAliasResponses];
786
+ export type ListSettingsData = {
787
+ body?: never;
788
+ path?: never;
789
+ query?: never;
790
+ url: '/bodhi/v1/settings';
791
+ };
792
+ export type ListSettingsErrors = {
793
+ /**
794
+ * Unauthorized - User is not an admin
795
+ */
796
+ 401: OpenAiApiError;
797
+ /**
798
+ * Internal server error
799
+ */
800
+ 500: OpenAiApiError;
801
+ };
802
+ export type ListSettingsError = ListSettingsErrors[keyof ListSettingsErrors];
803
+ export type ListSettingsResponses = {
804
+ /**
805
+ * List of application settings
806
+ */
807
+ 200: Array<SettingInfo>;
808
+ };
809
+ export type ListSettingsResponse = ListSettingsResponses[keyof ListSettingsResponses];
810
+ export type DeleteSettingData = {
811
+ body?: never;
812
+ path: {
813
+ /**
814
+ * Setting key to reset
815
+ */
816
+ key: string;
817
+ };
818
+ query?: never;
819
+ url: '/bodhi/v1/settings/{key}';
820
+ };
821
+ export type DeleteSettingErrors = {
822
+ /**
823
+ * Setting not found
824
+ */
825
+ 404: OpenAiApiError;
826
+ };
827
+ export type DeleteSettingError = DeleteSettingErrors[keyof DeleteSettingErrors];
828
+ export type DeleteSettingResponses = {
829
+ /**
830
+ * Setting reset to default successfully
831
+ */
832
+ 200: SettingInfo;
833
+ };
834
+ export type DeleteSettingResponse = DeleteSettingResponses[keyof DeleteSettingResponses];
835
+ export type UpdateSettingData = {
836
+ /**
837
+ * Request to update a setting value
838
+ */
839
+ body: {
840
+ value: unknown;
841
+ };
842
+ path: {
843
+ /**
844
+ * Setting key to update
845
+ */
846
+ key: string;
847
+ };
848
+ query?: never;
849
+ url: '/bodhi/v1/settings/{key}';
850
+ };
851
+ export type UpdateSettingErrors = {
852
+ /**
853
+ * Invalid setting or value
854
+ */
855
+ 400: OpenAiApiError;
856
+ /**
857
+ * Setting not found
858
+ */
859
+ 404: OpenAiApiError;
860
+ };
861
+ export type UpdateSettingError = UpdateSettingErrors[keyof UpdateSettingErrors];
862
+ export type UpdateSettingResponses = {
863
+ /**
864
+ * Setting updated successfully
865
+ */
866
+ 200: SettingInfo;
867
+ };
868
+ export type UpdateSettingResponse = UpdateSettingResponses[keyof UpdateSettingResponses];
869
+ export type SetupAppData = {
870
+ body: SetupRequest;
871
+ path?: never;
872
+ query?: never;
873
+ url: '/bodhi/v1/setup';
874
+ };
875
+ export type SetupAppErrors = {
876
+ /**
877
+ * Application is already setup
878
+ */
879
+ 400: OpenAiApiError;
880
+ /**
881
+ * Internal server error
882
+ */
883
+ 500: OpenAiApiError;
884
+ };
885
+ export type SetupAppError = SetupAppErrors[keyof SetupAppErrors];
886
+ export type SetupAppResponses = {
887
+ /**
888
+ * Application setup successful
889
+ */
890
+ 200: SetupResponse;
891
+ };
892
+ export type SetupAppResponse = SetupAppResponses[keyof SetupAppResponses];
893
+ export type ListApiTokensData = {
894
+ body?: never;
895
+ path?: never;
896
+ query?: {
897
+ /**
898
+ * Page number (1-based)
899
+ */
900
+ page?: number;
901
+ /**
902
+ * Number of items per page (max 100)
903
+ */
904
+ page_size?: number;
905
+ /**
906
+ * Field to sort by (repo, filename, size, updated_at, snapshot)
907
+ */
908
+ sort?: string | null;
909
+ /**
910
+ * Sort order (asc or desc)
911
+ */
912
+ sort_order?: string;
913
+ };
914
+ url: '/bodhi/v1/tokens';
915
+ };
916
+ export type ListApiTokensErrors = {
917
+ /**
918
+ * Unauthorized - Token missing or invalid
919
+ */
920
+ 401: OpenAiApiError;
921
+ /**
922
+ * Internal server error
923
+ */
924
+ 500: OpenAiApiError;
925
+ };
926
+ export type ListApiTokensError = ListApiTokensErrors[keyof ListApiTokensErrors];
927
+ export type ListApiTokensResponses = {
928
+ /**
929
+ * List of API tokens
930
+ */
931
+ 200: PaginatedResponseApiToken;
932
+ };
933
+ export type ListApiTokensResponse = ListApiTokensResponses[keyof ListApiTokensResponses];
934
+ export type CreateApiTokenData = {
935
+ body: CreateApiTokenRequest;
936
+ path?: never;
937
+ query?: never;
938
+ url: '/bodhi/v1/tokens';
939
+ };
940
+ export type CreateApiTokenErrors = {
941
+ /**
942
+ * Invalid request
943
+ */
944
+ 400: OpenAiApiError;
945
+ /**
946
+ * Internal server error
947
+ */
948
+ 500: OpenAiApiError;
949
+ };
950
+ export type CreateApiTokenError = CreateApiTokenErrors[keyof CreateApiTokenErrors];
951
+ export type CreateApiTokenResponses = {
952
+ /**
953
+ * API token created successfully
954
+ */
955
+ 201: ApiTokenResponse;
956
+ };
957
+ export type CreateApiTokenResponse = CreateApiTokenResponses[keyof CreateApiTokenResponses];
958
+ export type UpdateApiTokenData = {
959
+ /**
960
+ * Token update request
961
+ */
962
+ body: UpdateApiTokenRequest;
963
+ path: {
964
+ /**
965
+ * Token identifier
966
+ */
967
+ id: string;
968
+ };
969
+ query?: never;
970
+ url: '/bodhi/v1/tokens/{id}';
971
+ };
972
+ export type UpdateApiTokenErrors = {
973
+ /**
974
+ * Unauthorized - Token missing or invalid
975
+ */
976
+ 401: OpenAiApiError;
977
+ /**
978
+ * Token not found
979
+ */
980
+ 404: OpenAiApiError;
981
+ /**
982
+ * Internal server error
983
+ */
984
+ 500: OpenAiApiError;
985
+ };
986
+ export type UpdateApiTokenError = UpdateApiTokenErrors[keyof UpdateApiTokenErrors];
987
+ export type UpdateApiTokenResponses = {
988
+ /**
989
+ * Token updated successfully
990
+ */
991
+ 200: ApiToken;
992
+ };
993
+ export type UpdateApiTokenResponse = UpdateApiTokenResponses[keyof UpdateApiTokenResponses];
994
+ export type GetCurrentUserData = {
995
+ body?: never;
996
+ path?: never;
997
+ query?: never;
998
+ url: '/bodhi/v1/user';
999
+ };
1000
+ export type GetCurrentUserErrors = {
1001
+ /**
1002
+ * Error in extracting user info from token
1003
+ */
1004
+ 500: OpenAiApiError;
1005
+ };
1006
+ export type GetCurrentUserError = GetCurrentUserErrors[keyof GetCurrentUserErrors];
1007
+ export type GetCurrentUserResponses = {
1008
+ /**
1009
+ * Returns current user information
1010
+ */
1011
+ 200: UserInfo;
1012
+ };
1013
+ export type GetCurrentUserResponse = GetCurrentUserResponses[keyof GetCurrentUserResponses];
1014
+ export type PingServerData = {
1015
+ body?: never;
1016
+ path?: never;
1017
+ query?: never;
1018
+ url: '/ping';
1019
+ };
1020
+ export type PingServerResponses = {
1021
+ /**
1022
+ * Server is healthy
1023
+ */
1024
+ 200: PingResponse;
1025
+ };
1026
+ export type PingServerResponse = PingServerResponses[keyof PingServerResponses];
1027
+ export type CreateChatCompletionData = {
1028
+ body: unknown;
1029
+ path?: never;
1030
+ query?: never;
1031
+ url: '/v1/chat/completions';
1032
+ };
1033
+ export type CreateChatCompletionErrors = {
1034
+ /**
1035
+ * Invalid request parameters
1036
+ */
1037
+ 400: OpenAiApiError;
1038
+ /**
1039
+ * Invalid authentication
1040
+ */
1041
+ 401: OpenAiApiError;
1042
+ /**
1043
+ * Internal server error
1044
+ */
1045
+ 500: OpenAiApiError;
1046
+ };
1047
+ export type CreateChatCompletionError = CreateChatCompletionErrors[keyof CreateChatCompletionErrors];
1048
+ export type CreateChatCompletionResponses = {
1049
+ /**
1050
+ * Chat completion response
1051
+ */
1052
+ 200: unknown;
1053
+ /**
1054
+ * Chat completion stream, the status is 200, using 201 to avoid OpenAPI format limitation.
1055
+ */
1056
+ 201: unknown;
1057
+ };
1058
+ export type ListModelsData = {
1059
+ body?: never;
1060
+ path?: never;
1061
+ query?: never;
1062
+ url: '/v1/models';
1063
+ };
1064
+ export type ListModelsErrors = {
1065
+ /**
1066
+ * Invalid authentication
1067
+ */
1068
+ 401: OpenAiApiError;
1069
+ /**
1070
+ * Internal server error
1071
+ */
1072
+ 500: OpenAiApiError;
1073
+ };
1074
+ export type ListModelsError = ListModelsErrors[keyof ListModelsErrors];
1075
+ export type ListModelsResponses = {
1076
+ /**
1077
+ * List of available models
1078
+ */
1079
+ 200: ListModelResponseWrapper;
1080
+ };
1081
+ export type ListModelsResponse = ListModelsResponses[keyof ListModelsResponses];
1082
+ export type ClientOptions = {
1083
+ baseUrl: 'http://localhost:1135' | (string & {});
1084
+ };