@gpuai/sdk 0.5.0 → 0.5.2
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.
- package/.openapi-generator/FILES +6 -0
- package/README.md +7 -2
- package/dist/apis/InferenceApi.d.ts +60 -0
- package/dist/apis/InferenceApi.js +126 -1
- package/dist/esm/apis/InferenceApi.d.ts +60 -0
- package/dist/esm/apis/InferenceApi.js +125 -0
- package/dist/esm/models/DataRetention.d.ts +51 -0
- package/dist/esm/models/DataRetention.js +57 -0
- package/dist/esm/models/Model.d.ts +6 -0
- package/dist/esm/models/Model.js +2 -0
- package/dist/esm/models/OfferingAlternative.d.ts +68 -0
- package/dist/esm/models/OfferingAlternative.js +67 -0
- package/dist/esm/models/OperationError.d.ts +20 -1
- package/dist/esm/models/OperationError.js +7 -0
- package/dist/esm/models/Problem.d.ts +1 -0
- package/dist/esm/models/Problem.js +1 -0
- package/dist/esm/models/UpdateDataRetentionRequest.d.ts +32 -0
- package/dist/esm/models/UpdateDataRetentionRequest.js +43 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +3 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/DataRetention.d.ts +51 -0
- package/dist/models/DataRetention.js +65 -0
- package/dist/models/Model.d.ts +6 -0
- package/dist/models/Model.js +2 -0
- package/dist/models/OfferingAlternative.d.ts +68 -0
- package/dist/models/OfferingAlternative.js +74 -0
- package/dist/models/OperationError.d.ts +20 -1
- package/dist/models/OperationError.js +7 -0
- package/dist/models/Problem.d.ts +1 -0
- package/dist/models/Problem.js +1 -0
- package/dist/models/UpdateDataRetentionRequest.d.ts +32 -0
- package/dist/models/UpdateDataRetentionRequest.js +50 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/dist/runtime.js +1 -1
- package/docs/DataRetention.md +38 -0
- package/docs/FineTuningApi.md +2 -2
- package/docs/InferenceApi.md +163 -12
- package/docs/Model.md +2 -0
- package/docs/OfferingAlternative.md +47 -0
- package/docs/OperationError.md +6 -0
- package/docs/UpdateDataRetentionRequest.md +34 -0
- package/package.json +1 -1
- package/src/apis/InferenceApi.ts +162 -0
- package/src/models/DataRetention.ts +95 -0
- package/src/models/Model.ts +8 -0
- package/src/models/OfferingAlternative.ts +120 -0
- package/src/models/OperationError.ts +33 -1
- package/src/models/Problem.ts +1 -0
- package/src/models/UpdateDataRetentionRequest.ts +66 -0
- package/src/models/index.ts +3 -0
- package/src/runtime.ts +1 -1
package/src/apis/InferenceApi.ts
CHANGED
|
@@ -23,6 +23,11 @@ import {
|
|
|
23
23
|
ChatCompletionResponseFromJSON,
|
|
24
24
|
ChatCompletionResponseToJSON,
|
|
25
25
|
} from '../models/ChatCompletionResponse';
|
|
26
|
+
import {
|
|
27
|
+
type DataRetention,
|
|
28
|
+
DataRetentionFromJSON,
|
|
29
|
+
DataRetentionToJSON,
|
|
30
|
+
} from '../models/DataRetention';
|
|
26
31
|
import {
|
|
27
32
|
type EmbeddingsRequest,
|
|
28
33
|
EmbeddingsRequestFromJSON,
|
|
@@ -58,6 +63,16 @@ import {
|
|
|
58
63
|
OpenAIErrorEnvelopeFromJSON,
|
|
59
64
|
OpenAIErrorEnvelopeToJSON,
|
|
60
65
|
} from '../models/OpenAIErrorEnvelope';
|
|
66
|
+
import {
|
|
67
|
+
type Problem,
|
|
68
|
+
ProblemFromJSON,
|
|
69
|
+
ProblemToJSON,
|
|
70
|
+
} from '../models/Problem';
|
|
71
|
+
import {
|
|
72
|
+
type UpdateDataRetentionRequest,
|
|
73
|
+
UpdateDataRetentionRequestFromJSON,
|
|
74
|
+
UpdateDataRetentionRequestToJSON,
|
|
75
|
+
} from '../models/UpdateDataRetentionRequest';
|
|
61
76
|
import {
|
|
62
77
|
type VideoCreateRequest,
|
|
63
78
|
VideoCreateRequestFromJSON,
|
|
@@ -80,15 +95,18 @@ export interface CancelVideoRequest {
|
|
|
80
95
|
|
|
81
96
|
export interface CreateChatCompletionRequest {
|
|
82
97
|
chatCompletionRequest: ChatCompletionRequest;
|
|
98
|
+
xGPUAIZeroDataRetention?: CreateChatCompletionXGPUAIZeroDataRetentionEnum;
|
|
83
99
|
}
|
|
84
100
|
|
|
85
101
|
export interface CreateEmbeddingsRequest {
|
|
86
102
|
embeddingsRequest: EmbeddingsRequest;
|
|
103
|
+
xGPUAIZeroDataRetention?: CreateEmbeddingsXGPUAIZeroDataRetentionEnum;
|
|
87
104
|
}
|
|
88
105
|
|
|
89
106
|
export interface CreateImageRequest {
|
|
90
107
|
imagesGenerationsRequest: ImagesGenerationsRequest;
|
|
91
108
|
idempotencyKey?: string;
|
|
109
|
+
xGPUAIZeroDataRetention?: CreateImageXGPUAIZeroDataRetentionEnum;
|
|
92
110
|
}
|
|
93
111
|
|
|
94
112
|
export interface CreateVideoRequest {
|
|
@@ -117,6 +135,10 @@ export interface ListVideosRequest {
|
|
|
117
135
|
limit?: number;
|
|
118
136
|
}
|
|
119
137
|
|
|
138
|
+
export interface UpdateDataRetentionOperationRequest {
|
|
139
|
+
updateDataRetentionRequest: UpdateDataRetentionRequest;
|
|
140
|
+
}
|
|
141
|
+
|
|
120
142
|
/**
|
|
121
143
|
*
|
|
122
144
|
*/
|
|
@@ -192,6 +214,10 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
192
214
|
|
|
193
215
|
headerParameters['Content-Type'] = 'application/json';
|
|
194
216
|
|
|
217
|
+
if (requestParameters['xGPUAIZeroDataRetention'] != null) {
|
|
218
|
+
headerParameters['X-GPUAI-Zero-Data-Retention'] = String(requestParameters['xGPUAIZeroDataRetention']);
|
|
219
|
+
}
|
|
220
|
+
|
|
195
221
|
if (this.configuration && this.configuration.accessToken) {
|
|
196
222
|
const token = this.configuration.accessToken;
|
|
197
223
|
const tokenString = await token("bearerAuth", []);
|
|
@@ -247,6 +273,10 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
247
273
|
|
|
248
274
|
headerParameters['Content-Type'] = 'application/json';
|
|
249
275
|
|
|
276
|
+
if (requestParameters['xGPUAIZeroDataRetention'] != null) {
|
|
277
|
+
headerParameters['X-GPUAI-Zero-Data-Retention'] = String(requestParameters['xGPUAIZeroDataRetention']);
|
|
278
|
+
}
|
|
279
|
+
|
|
250
280
|
if (this.configuration && this.configuration.accessToken) {
|
|
251
281
|
const token = this.configuration.accessToken;
|
|
252
282
|
const tokenString = await token("bearerAuth", []);
|
|
@@ -308,6 +338,10 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
308
338
|
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
309
339
|
}
|
|
310
340
|
|
|
341
|
+
if (requestParameters['xGPUAIZeroDataRetention'] != null) {
|
|
342
|
+
headerParameters['X-GPUAI-Zero-Data-Retention'] = String(requestParameters['xGPUAIZeroDataRetention']);
|
|
343
|
+
}
|
|
344
|
+
|
|
311
345
|
if (this.configuration && this.configuration.accessToken) {
|
|
312
346
|
const token = this.configuration.accessToken;
|
|
313
347
|
const tokenString = await token("bearerAuth", []);
|
|
@@ -409,6 +443,53 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
409
443
|
return await response.value();
|
|
410
444
|
}
|
|
411
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Creates request options for getDataRetention without sending the request
|
|
448
|
+
*/
|
|
449
|
+
async getDataRetentionRequestOpts(): Promise<runtime.RequestOpts> {
|
|
450
|
+
const queryParameters: any = {};
|
|
451
|
+
|
|
452
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
453
|
+
|
|
454
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
455
|
+
const token = this.configuration.accessToken;
|
|
456
|
+
const tokenString = await token("bearerAuth", []);
|
|
457
|
+
|
|
458
|
+
if (tokenString) {
|
|
459
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
let urlPath = `/organization/data-retention`;
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
path: urlPath,
|
|
467
|
+
method: 'GET',
|
|
468
|
+
headers: headerParameters,
|
|
469
|
+
query: queryParameters,
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Returns whether zero data retention (ZDR) is on for the organization. When it is on, chat, embeddings and image requests route only to model hosts that keep no prompt or output content, a model without one returns 400 `zero_data_retention_unavailable`, and video generation is refused. Requires the `serverless:read` scope. The organization is taken from the authenticated API key.
|
|
475
|
+
* Get the org zero data retention setting
|
|
476
|
+
*/
|
|
477
|
+
async getDataRetentionRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataRetention>> {
|
|
478
|
+
const requestOptions = await this.getDataRetentionRequestOpts();
|
|
479
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
480
|
+
|
|
481
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DataRetentionFromJSON(jsonValue));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Returns whether zero data retention (ZDR) is on for the organization. When it is on, chat, embeddings and image requests route only to model hosts that keep no prompt or output content, a model without one returns 400 `zero_data_retention_unavailable`, and video generation is refused. Requires the `serverless:read` scope. The organization is taken from the authenticated API key.
|
|
486
|
+
* Get the org zero data retention setting
|
|
487
|
+
*/
|
|
488
|
+
async getDataRetention(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataRetention> {
|
|
489
|
+
const response = await this.getDataRetentionRaw(initOverrides);
|
|
490
|
+
return await response.value();
|
|
491
|
+
}
|
|
492
|
+
|
|
412
493
|
/**
|
|
413
494
|
* Creates request options for getModel without sending the request
|
|
414
495
|
*/
|
|
@@ -672,8 +753,89 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
672
753
|
return await response.value();
|
|
673
754
|
}
|
|
674
755
|
|
|
756
|
+
/**
|
|
757
|
+
* Creates request options for updateDataRetention without sending the request
|
|
758
|
+
*/
|
|
759
|
+
async updateDataRetentionRequestOpts(requestParameters: UpdateDataRetentionOperationRequest): Promise<runtime.RequestOpts> {
|
|
760
|
+
if (requestParameters['updateDataRetentionRequest'] == null) {
|
|
761
|
+
throw new runtime.RequiredError(
|
|
762
|
+
'updateDataRetentionRequest',
|
|
763
|
+
'Required parameter "updateDataRetentionRequest" was null or undefined when calling updateDataRetention().'
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
const queryParameters: any = {};
|
|
768
|
+
|
|
769
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
770
|
+
|
|
771
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
772
|
+
|
|
773
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
774
|
+
const token = this.configuration.accessToken;
|
|
775
|
+
const tokenString = await token("bearerAuth", []);
|
|
776
|
+
|
|
777
|
+
if (tokenString) {
|
|
778
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
let urlPath = `/organization/data-retention`;
|
|
783
|
+
|
|
784
|
+
return {
|
|
785
|
+
path: urlPath,
|
|
786
|
+
method: 'PUT',
|
|
787
|
+
headers: headerParameters,
|
|
788
|
+
query: queryParameters,
|
|
789
|
+
body: UpdateDataRetentionRequestToJSON(requestParameters['updateDataRetentionRequest']),
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Sets the organization\'s zero data retention (ZDR) setting. Takes effect from the next inference request. Requires the `serverless:write` scope AND org-admin privileges (a non-admin member gets 403). `zero_data_retention` is required (422 when missing).
|
|
795
|
+
* Turn zero data retention on or off for the org
|
|
796
|
+
*/
|
|
797
|
+
async updateDataRetentionRaw(requestParameters: UpdateDataRetentionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataRetention>> {
|
|
798
|
+
const requestOptions = await this.updateDataRetentionRequestOpts(requestParameters);
|
|
799
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
800
|
+
|
|
801
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DataRetentionFromJSON(jsonValue));
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Sets the organization\'s zero data retention (ZDR) setting. Takes effect from the next inference request. Requires the `serverless:write` scope AND org-admin privileges (a non-admin member gets 403). `zero_data_retention` is required (422 when missing).
|
|
806
|
+
* Turn zero data retention on or off for the org
|
|
807
|
+
*/
|
|
808
|
+
async updateDataRetention(requestParameters: UpdateDataRetentionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataRetention> {
|
|
809
|
+
const response = await this.updateDataRetentionRaw(requestParameters, initOverrides);
|
|
810
|
+
return await response.value();
|
|
811
|
+
}
|
|
812
|
+
|
|
675
813
|
}
|
|
676
814
|
|
|
815
|
+
/**
|
|
816
|
+
* @export
|
|
817
|
+
*/
|
|
818
|
+
export const CreateChatCompletionXGPUAIZeroDataRetentionEnum = {
|
|
819
|
+
True: 'true',
|
|
820
|
+
False: 'false'
|
|
821
|
+
} as const;
|
|
822
|
+
export type CreateChatCompletionXGPUAIZeroDataRetentionEnum = typeof CreateChatCompletionXGPUAIZeroDataRetentionEnum[keyof typeof CreateChatCompletionXGPUAIZeroDataRetentionEnum];
|
|
823
|
+
/**
|
|
824
|
+
* @export
|
|
825
|
+
*/
|
|
826
|
+
export const CreateEmbeddingsXGPUAIZeroDataRetentionEnum = {
|
|
827
|
+
True: 'true',
|
|
828
|
+
False: 'false'
|
|
829
|
+
} as const;
|
|
830
|
+
export type CreateEmbeddingsXGPUAIZeroDataRetentionEnum = typeof CreateEmbeddingsXGPUAIZeroDataRetentionEnum[keyof typeof CreateEmbeddingsXGPUAIZeroDataRetentionEnum];
|
|
831
|
+
/**
|
|
832
|
+
* @export
|
|
833
|
+
*/
|
|
834
|
+
export const CreateImageXGPUAIZeroDataRetentionEnum = {
|
|
835
|
+
True: 'true',
|
|
836
|
+
False: 'false'
|
|
837
|
+
} as const;
|
|
838
|
+
export type CreateImageXGPUAIZeroDataRetentionEnum = typeof CreateImageXGPUAIZeroDataRetentionEnum[keyof typeof CreateImageXGPUAIZeroDataRetentionEnum];
|
|
677
839
|
/**
|
|
678
840
|
* @export
|
|
679
841
|
*/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* GPU.ai Public Developer API
|
|
5
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@gpu.ai
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface DataRetention
|
|
20
|
+
*/
|
|
21
|
+
export interface DataRetention {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {DataRetentionObjectEnum}
|
|
25
|
+
* @memberof DataRetention
|
|
26
|
+
*/
|
|
27
|
+
object: DataRetentionObjectEnum;
|
|
28
|
+
/**
|
|
29
|
+
* True when the org's inference requests route only to zero-data-retention model hosts.
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
* @memberof DataRetention
|
|
32
|
+
*/
|
|
33
|
+
zeroDataRetention: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* When the setting last changed; absent if it never has.
|
|
36
|
+
* @type {Date}
|
|
37
|
+
* @memberof DataRetention
|
|
38
|
+
*/
|
|
39
|
+
updatedAt?: Date;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
export const DataRetentionObjectEnum = {
|
|
47
|
+
OrganizationDataRetention: 'organization.data_retention'
|
|
48
|
+
} as const;
|
|
49
|
+
export type DataRetentionObjectEnum = typeof DataRetentionObjectEnum[keyof typeof DataRetentionObjectEnum];
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Check if a given object implements the DataRetention interface.
|
|
54
|
+
*/
|
|
55
|
+
export function instanceOfDataRetention(value: object): value is DataRetention {
|
|
56
|
+
if (!('object' in value) || value['object'] === undefined) return false;
|
|
57
|
+
if (value['object'] !== 'organization.data_retention') return false;
|
|
58
|
+
|
|
59
|
+
if ((!('zeroDataRetention' in (value as Record<string, any>)) && !('zero_data_retention' in (value as Record<string, any>))) || ((value as Record<string, any>)['zeroDataRetention'] === undefined && (value as Record<string, any>)['zero_data_retention'] === undefined)) return false;
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function DataRetentionFromJSON(json: any): DataRetention {
|
|
64
|
+
return DataRetentionFromJSONTyped(json, false);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function DataRetentionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataRetention {
|
|
68
|
+
if (json == null) {
|
|
69
|
+
return json;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
|
|
73
|
+
'object': json['object'],
|
|
74
|
+
'zeroDataRetention': json['zero_data_retention'],
|
|
75
|
+
'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function DataRetentionToJSON(json: any): DataRetention {
|
|
80
|
+
return DataRetentionToJSONTyped(json, false);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function DataRetentionToJSONTyped(value?: DataRetention | null, ignoreDiscriminator: boolean = false): any {
|
|
84
|
+
if (value == null) {
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
|
|
90
|
+
'object': value['object'],
|
|
91
|
+
'zero_data_retention': value['zeroDataRetention'],
|
|
92
|
+
'updated_at': value['updatedAt'] == null ? value['updatedAt'] : value['updatedAt'].toISOString(),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
package/src/models/Model.ts
CHANGED
|
@@ -100,6 +100,12 @@ export interface Model {
|
|
|
100
100
|
* @memberof Model
|
|
101
101
|
*/
|
|
102
102
|
supportsStructuredOutputs?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* True when this model and tier can be served with zero data retention: at least one model host keeps no prompt or output content. Only these models are callable by an org with zero data retention on, or with the X-GPUAI-Zero-Data-Retention header. Always false for video.
|
|
105
|
+
* @type {boolean}
|
|
106
|
+
* @memberof Model
|
|
107
|
+
*/
|
|
108
|
+
zeroDataRetention?: boolean;
|
|
103
109
|
/**
|
|
104
110
|
* Typed parameter descriptors for media (image/video) models — name, type, enum/bounds/default. Playgrounds render input forms from these.
|
|
105
111
|
* @type {Array<ModelParametersInner>}
|
|
@@ -205,6 +211,7 @@ export function ModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): Mod
|
|
|
205
211
|
'supportedParameters': json['supported_parameters'] == null ? undefined : json['supported_parameters'],
|
|
206
212
|
'supportsTools': json['supports_tools'] == null ? undefined : json['supports_tools'],
|
|
207
213
|
'supportsStructuredOutputs': json['supports_structured_outputs'] == null ? undefined : json['supports_structured_outputs'],
|
|
214
|
+
'zeroDataRetention': json['zero_data_retention'] == null ? undefined : json['zero_data_retention'],
|
|
208
215
|
'parameters': json['parameters'] == null ? undefined : ((json['parameters'] as Array<any>).map(ModelParametersInnerFromJSON)),
|
|
209
216
|
'pricing': ModelPricingFromJSON(json['pricing']),
|
|
210
217
|
'aliases': json['aliases'] == null ? undefined : json['aliases'],
|
|
@@ -236,6 +243,7 @@ export function ModelToJSONTyped(value?: Model | null, ignoreDiscriminator: bool
|
|
|
236
243
|
'supported_parameters': value['supportedParameters'],
|
|
237
244
|
'supports_tools': value['supportsTools'],
|
|
238
245
|
'supports_structured_outputs': value['supportsStructuredOutputs'],
|
|
246
|
+
'zero_data_retention': value['zeroDataRetention'],
|
|
239
247
|
'parameters': value['parameters'] == null ? undefined : ((value['parameters'] as Array<any>).map(ModelParametersInnerToJSON)),
|
|
240
248
|
'pricing': ModelPricingToJSON(value['pricing']),
|
|
241
249
|
'aliases': value['aliases'],
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* GPU.ai Public Developer API
|
|
5
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@gpu.ai
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* A live catalog row a launch whose pinned offering was gone could take instead. Same fields and meaning as the matching GET /pricing row.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface OfferingAlternative
|
|
20
|
+
*/
|
|
21
|
+
export interface OfferingAlternative {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof OfferingAlternative
|
|
26
|
+
*/
|
|
27
|
+
offeringId: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof OfferingAlternative
|
|
32
|
+
*/
|
|
33
|
+
gpuType: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof OfferingAlternative
|
|
38
|
+
*/
|
|
39
|
+
gpuCount: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof OfferingAlternative
|
|
44
|
+
*/
|
|
45
|
+
region: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof OfferingAlternative
|
|
50
|
+
*/
|
|
51
|
+
tier: string;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof OfferingAlternative
|
|
56
|
+
*/
|
|
57
|
+
pricePerHour: number;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof OfferingAlternative
|
|
62
|
+
*/
|
|
63
|
+
available: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Check if a given object implements the OfferingAlternative interface.
|
|
68
|
+
*/
|
|
69
|
+
export function instanceOfOfferingAlternative(value: object): value is OfferingAlternative {
|
|
70
|
+
if ((!('offeringId' in (value as Record<string, any>)) && !('offering_id' in (value as Record<string, any>))) || ((value as Record<string, any>)['offeringId'] === undefined && (value as Record<string, any>)['offering_id'] === undefined)) return false;
|
|
71
|
+
if ((!('gpuType' in (value as Record<string, any>)) && !('gpu_type' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuType'] === undefined && (value as Record<string, any>)['gpu_type'] === undefined)) return false;
|
|
72
|
+
if ((!('gpuCount' in (value as Record<string, any>)) && !('gpu_count' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuCount'] === undefined && (value as Record<string, any>)['gpu_count'] === undefined)) return false;
|
|
73
|
+
if (!('region' in value) || value['region'] === undefined) return false;
|
|
74
|
+
if (!('tier' in value) || value['tier'] === undefined) return false;
|
|
75
|
+
if ((!('pricePerHour' in (value as Record<string, any>)) && !('price_per_hour' in (value as Record<string, any>))) || ((value as Record<string, any>)['pricePerHour'] === undefined && (value as Record<string, any>)['price_per_hour'] === undefined)) return false;
|
|
76
|
+
if (!('available' in value) || value['available'] === undefined) return false;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function OfferingAlternativeFromJSON(json: any): OfferingAlternative {
|
|
81
|
+
return OfferingAlternativeFromJSONTyped(json, false);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function OfferingAlternativeFromJSONTyped(json: any, ignoreDiscriminator: boolean): OfferingAlternative {
|
|
85
|
+
if (json == null) {
|
|
86
|
+
return json;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
|
|
90
|
+
'offeringId': json['offering_id'],
|
|
91
|
+
'gpuType': json['gpu_type'],
|
|
92
|
+
'gpuCount': json['gpu_count'],
|
|
93
|
+
'region': json['region'],
|
|
94
|
+
'tier': json['tier'],
|
|
95
|
+
'pricePerHour': json['price_per_hour'],
|
|
96
|
+
'available': json['available'],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function OfferingAlternativeToJSON(json: any): OfferingAlternative {
|
|
101
|
+
return OfferingAlternativeToJSONTyped(json, false);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function OfferingAlternativeToJSONTyped(value?: OfferingAlternative | null, ignoreDiscriminator: boolean = false): any {
|
|
105
|
+
if (value == null) {
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
|
|
111
|
+
'offering_id': value['offeringId'],
|
|
112
|
+
'gpu_type': value['gpuType'],
|
|
113
|
+
'gpu_count': value['gpuCount'],
|
|
114
|
+
'region': value['region'],
|
|
115
|
+
'tier': value['tier'],
|
|
116
|
+
'price_per_hour': value['pricePerHour'],
|
|
117
|
+
'available': value['available'],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { OfferingAlternative } from './OfferingAlternative';
|
|
17
|
+
import {
|
|
18
|
+
OfferingAlternativeFromJSON,
|
|
19
|
+
OfferingAlternativeFromJSONTyped,
|
|
20
|
+
OfferingAlternativeToJSON,
|
|
21
|
+
OfferingAlternativeToJSONTyped,
|
|
22
|
+
} from './OfferingAlternative';
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
*
|
|
18
26
|
* @export
|
|
@@ -20,7 +28,7 @@ import { mapValues } from '../runtime';
|
|
|
20
28
|
*/
|
|
21
29
|
export interface OperationError {
|
|
22
30
|
/**
|
|
23
|
-
*
|
|
31
|
+
* Stable machine-readable failure code (see Problem.code), for example operation_failed (retryable after a backoff), price_changed or offering_unavailable (not retryable as sent).
|
|
24
32
|
* @type {string}
|
|
25
33
|
* @memberof OperationError
|
|
26
34
|
*/
|
|
@@ -31,6 +39,24 @@ export interface OperationError {
|
|
|
31
39
|
* @memberof OperationError
|
|
32
40
|
*/
|
|
33
41
|
detail?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Present only when code is offering_unavailable: up to three live catalog rows of the same GPU type, count and tier, cheapest first. Pass one's offering_id as the new pin.
|
|
44
|
+
* @type {Array<OfferingAlternative>}
|
|
45
|
+
* @memberof OperationError
|
|
46
|
+
*/
|
|
47
|
+
alternatives?: Array<OfferingAlternative>;
|
|
48
|
+
/**
|
|
49
|
+
* Present only when code is price_changed: the live hourly price the launch found.
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof OperationError
|
|
52
|
+
*/
|
|
53
|
+
currentPricePerHour?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Present only when code is price_changed: the hourly price the launch was approved at (max_price_per_hour, or the viewed price). Relaunch with max_price_per_hour of at least current_price_per_hour to accept the new price.
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @memberof OperationError
|
|
58
|
+
*/
|
|
59
|
+
maxPricePerHour?: number;
|
|
34
60
|
}
|
|
35
61
|
|
|
36
62
|
/**
|
|
@@ -52,6 +78,9 @@ export function OperationErrorFromJSONTyped(json: any, ignoreDiscriminator: bool
|
|
|
52
78
|
|
|
53
79
|
'code': json['code'] == null ? undefined : json['code'],
|
|
54
80
|
'detail': json['detail'] == null ? undefined : json['detail'],
|
|
81
|
+
'alternatives': json['alternatives'] == null ? undefined : ((json['alternatives'] as Array<any>).map(OfferingAlternativeFromJSON)),
|
|
82
|
+
'currentPricePerHour': json['current_price_per_hour'] == null ? undefined : json['current_price_per_hour'],
|
|
83
|
+
'maxPricePerHour': json['max_price_per_hour'] == null ? undefined : json['max_price_per_hour'],
|
|
55
84
|
};
|
|
56
85
|
}
|
|
57
86
|
|
|
@@ -68,6 +97,9 @@ export function OperationErrorToJSONTyped(value?: OperationError | null, ignoreD
|
|
|
68
97
|
|
|
69
98
|
'code': value['code'],
|
|
70
99
|
'detail': value['detail'],
|
|
100
|
+
'alternatives': value['alternatives'] == null ? undefined : ((value['alternatives'] as Array<any>).map(OfferingAlternativeToJSON)),
|
|
101
|
+
'current_price_per_hour': value['currentPricePerHour'],
|
|
102
|
+
'max_price_per_hour': value['maxPricePerHour'],
|
|
71
103
|
};
|
|
72
104
|
}
|
|
73
105
|
|
package/src/models/Problem.ts
CHANGED
|
@@ -75,6 +75,7 @@ export const ProblemCodeEnum = {
|
|
|
75
75
|
ModelTooLarge: 'model_too_large',
|
|
76
76
|
GpuVramTooSmall: 'gpu_vram_too_small',
|
|
77
77
|
PriceChanged: 'price_changed',
|
|
78
|
+
OfferingUnavailable: 'offering_unavailable',
|
|
78
79
|
DedicatedIpLimit: 'dedicated_ip_limit',
|
|
79
80
|
DedicatedIpUnavailable: 'dedicated_ip_unavailable',
|
|
80
81
|
InsufficientBalance: 'insufficient_balance',
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* GPU.ai Public Developer API
|
|
5
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@gpu.ai
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface UpdateDataRetentionRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface UpdateDataRetentionRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
* @memberof UpdateDataRetentionRequest
|
|
26
|
+
*/
|
|
27
|
+
zeroDataRetention: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the UpdateDataRetentionRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfUpdateDataRetentionRequest(value: object): value is UpdateDataRetentionRequest {
|
|
34
|
+
if ((!('zeroDataRetention' in (value as Record<string, any>)) && !('zero_data_retention' in (value as Record<string, any>))) || ((value as Record<string, any>)['zeroDataRetention'] === undefined && (value as Record<string, any>)['zero_data_retention'] === undefined)) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function UpdateDataRetentionRequestFromJSON(json: any): UpdateDataRetentionRequest {
|
|
39
|
+
return UpdateDataRetentionRequestFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function UpdateDataRetentionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDataRetentionRequest {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'zeroDataRetention': json['zero_data_retention'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function UpdateDataRetentionRequestToJSON(json: any): UpdateDataRetentionRequest {
|
|
53
|
+
return UpdateDataRetentionRequestToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function UpdateDataRetentionRequestToJSONTyped(value?: UpdateDataRetentionRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'zero_data_retention': value['zeroDataRetention'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -37,6 +37,7 @@ export * from './CreateRegistryCredentialRequest';
|
|
|
37
37
|
export * from './CreateSshKeyRequest';
|
|
38
38
|
export * from './CreateWebhookEndpointRequest';
|
|
39
39
|
export * from './CryptoDeposit';
|
|
40
|
+
export * from './DataRetention';
|
|
40
41
|
export * from './DedicatedIPRequest';
|
|
41
42
|
export * from './Embedding';
|
|
42
43
|
export * from './EmbeddingsRequest';
|
|
@@ -90,6 +91,7 @@ export * from './ModelList';
|
|
|
90
91
|
export * from './ModelParametersInner';
|
|
91
92
|
export * from './ModelPricing';
|
|
92
93
|
export * from './ModelRate';
|
|
94
|
+
export * from './OfferingAlternative';
|
|
93
95
|
export * from './OpenAIErrorEnvelope';
|
|
94
96
|
export * from './OpenAIErrorEnvelopeError';
|
|
95
97
|
export * from './Operation';
|
|
@@ -111,6 +113,7 @@ export * from './TemplateEnvInner';
|
|
|
111
113
|
export * from './TemplateList';
|
|
112
114
|
export * from './TemplatePortsInner';
|
|
113
115
|
export * from './UpdateBillingDetailsRequest';
|
|
116
|
+
export * from './UpdateDataRetentionRequest';
|
|
114
117
|
export * from './UpdateInstanceRequest';
|
|
115
118
|
export * from './UpdateSpendingLimitRequest';
|
|
116
119
|
export * from './Usage';
|
package/src/runtime.ts
CHANGED
|
@@ -75,7 +75,7 @@ export class Configuration {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
get headers(): HTTPHeaders | undefined {
|
|
78
|
-
return { 'User-Agent': 'gpuai-sdk-ts/0.5.
|
|
78
|
+
return { 'User-Agent': 'gpuai-sdk-ts/0.5.2', ...this.configuration.headers };
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
get credentials(): RequestCredentials | undefined {
|