@gpuai/sdk 0.4.2 → 0.5.1
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 +24 -0
- package/README.md +14 -2
- package/dist/apis/InstancesApi.d.ts +2 -0
- package/dist/apis/InstancesApi.js +2 -0
- package/dist/esm/apis/InstancesApi.d.ts +2 -0
- package/dist/esm/apis/InstancesApi.js +2 -0
- package/dist/esm/models/ChatCompletionRequest.d.ts +27 -0
- package/dist/esm/models/ChatCompletionRequest.js +11 -0
- package/dist/esm/models/ChatCompletionRequestToolChoice.d.ts +22 -0
- package/dist/esm/models/ChatCompletionRequestToolChoice.js +50 -0
- package/dist/esm/models/ChatJSONSchemaFormat.d.ts +52 -0
- package/dist/esm/models/ChatJSONSchemaFormat.js +51 -0
- package/dist/esm/models/ChatMessage.d.ts +21 -1
- package/dist/esm/models/ChatMessage.js +10 -4
- package/dist/esm/models/ChatNamedToolChoice.d.ts +46 -0
- package/dist/esm/models/ChatNamedToolChoice.js +56 -0
- package/dist/esm/models/ChatNamedToolChoiceFunction.d.ts +32 -0
- package/dist/esm/models/ChatNamedToolChoiceFunction.js +43 -0
- package/dist/esm/models/ChatResponseFormat.d.ts +48 -0
- package/dist/esm/models/ChatResponseFormat.js +54 -0
- package/dist/esm/models/ChatTool.d.ts +46 -0
- package/dist/esm/models/ChatTool.js +56 -0
- package/dist/esm/models/ChatToolCall.d.ts +52 -0
- package/dist/esm/models/ChatToolCall.js +60 -0
- package/dist/esm/models/ChatToolCallFunction.d.ts +38 -0
- package/dist/esm/models/ChatToolCallFunction.js +47 -0
- package/dist/esm/models/ChatToolFunction.d.ts +52 -0
- package/dist/esm/models/ChatToolFunction.js +49 -0
- package/dist/esm/models/CreateFunctionVersionRequest.d.ts +6 -0
- package/dist/esm/models/CreateFunctionVersionRequest.js +2 -0
- package/dist/esm/models/CreateInstanceRequest.d.ts +13 -0
- package/dist/esm/models/CreateInstanceRequest.js +5 -0
- package/dist/esm/models/DedicatedIPRequest.d.ts +32 -0
- package/dist/esm/models/DedicatedIPRequest.js +41 -0
- package/dist/esm/models/FunctionVersion.d.ts +6 -0
- package/dist/esm/models/FunctionVersion.js +4 -0
- package/dist/esm/models/Instance.d.ts +7 -0
- package/dist/esm/models/Instance.js +3 -0
- package/dist/esm/models/InstanceDedicatedIP.d.ts +83 -0
- package/dist/esm/models/InstanceDedicatedIP.js +77 -0
- package/dist/esm/models/Model.d.ts +12 -0
- package/dist/esm/models/Model.js +4 -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 +3 -0
- package/dist/esm/models/Problem.js +3 -0
- package/dist/esm/models/index.d.ts +12 -0
- package/dist/esm/models/index.js +12 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/ChatCompletionRequest.d.ts +27 -0
- package/dist/models/ChatCompletionRequest.js +11 -0
- package/dist/models/ChatCompletionRequestToolChoice.d.ts +22 -0
- package/dist/models/ChatCompletionRequestToolChoice.js +56 -0
- package/dist/models/ChatJSONSchemaFormat.d.ts +52 -0
- package/dist/models/ChatJSONSchemaFormat.js +58 -0
- package/dist/models/ChatMessage.d.ts +21 -1
- package/dist/models/ChatMessage.js +10 -4
- package/dist/models/ChatNamedToolChoice.d.ts +46 -0
- package/dist/models/ChatNamedToolChoice.js +64 -0
- package/dist/models/ChatNamedToolChoiceFunction.d.ts +32 -0
- package/dist/models/ChatNamedToolChoiceFunction.js +50 -0
- package/dist/models/ChatResponseFormat.d.ts +48 -0
- package/dist/models/ChatResponseFormat.js +62 -0
- package/dist/models/ChatTool.d.ts +46 -0
- package/dist/models/ChatTool.js +64 -0
- package/dist/models/ChatToolCall.d.ts +52 -0
- package/dist/models/ChatToolCall.js +68 -0
- package/dist/models/ChatToolCallFunction.d.ts +38 -0
- package/dist/models/ChatToolCallFunction.js +54 -0
- package/dist/models/ChatToolFunction.d.ts +52 -0
- package/dist/models/ChatToolFunction.js +56 -0
- package/dist/models/CreateFunctionVersionRequest.d.ts +6 -0
- package/dist/models/CreateFunctionVersionRequest.js +2 -0
- package/dist/models/CreateInstanceRequest.d.ts +13 -0
- package/dist/models/CreateInstanceRequest.js +5 -0
- package/dist/models/DedicatedIPRequest.d.ts +32 -0
- package/dist/models/DedicatedIPRequest.js +48 -0
- package/dist/models/FunctionVersion.d.ts +6 -0
- package/dist/models/FunctionVersion.js +4 -0
- package/dist/models/Instance.d.ts +7 -0
- package/dist/models/Instance.js +3 -0
- package/dist/models/InstanceDedicatedIP.d.ts +83 -0
- package/dist/models/InstanceDedicatedIP.js +85 -0
- package/dist/models/Model.d.ts +12 -0
- package/dist/models/Model.js +4 -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 +3 -0
- package/dist/models/Problem.js +3 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.js +12 -0
- package/dist/runtime.js +1 -1
- package/docs/ChatCompletionRequest.md +8 -0
- package/docs/ChatCompletionRequestToolChoice.md +37 -0
- package/docs/ChatJSONSchemaFormat.md +40 -0
- package/docs/ChatMessage.md +6 -0
- package/docs/ChatNamedToolChoice.md +36 -0
- package/docs/ChatNamedToolChoiceFunction.md +34 -0
- package/docs/ChatResponseFormat.md +37 -0
- package/docs/ChatTool.md +36 -0
- package/docs/ChatToolCall.md +38 -0
- package/docs/ChatToolCallFunction.md +36 -0
- package/docs/ChatToolFunction.md +40 -0
- package/docs/CreateFunctionVersionRequest.md +2 -0
- package/docs/CreateInstanceRequest.md +4 -0
- package/docs/DedicatedIPRequest.md +35 -0
- package/docs/FunctionVersion.md +2 -0
- package/docs/Instance.md +2 -0
- package/docs/InstanceDedicatedIP.md +49 -0
- package/docs/InstancesApi.md +3 -1
- package/docs/Model.md +4 -0
- package/docs/OfferingAlternative.md +47 -0
- package/docs/OperationError.md +6 -0
- package/package.json +1 -1
- package/src/apis/InstancesApi.ts +2 -0
- package/src/models/ChatCompletionRequest.ts +53 -0
- package/src/models/ChatCompletionRequestToolChoice.ts +69 -0
- package/src/models/ChatJSONSchemaFormat.ts +91 -0
- package/src/models/ChatMessage.ts +36 -4
- package/src/models/ChatNamedToolChoice.ts +95 -0
- package/src/models/ChatNamedToolChoiceFunction.ts +66 -0
- package/src/models/ChatResponseFormat.ts +94 -0
- package/src/models/ChatTool.ts +95 -0
- package/src/models/ChatToolCall.ts +104 -0
- package/src/models/ChatToolCallFunction.ts +75 -0
- package/src/models/ChatToolFunction.ts +90 -0
- package/src/models/CreateFunctionVersionRequest.ts +8 -0
- package/src/models/CreateInstanceRequest.ts +23 -0
- package/src/models/DedicatedIPRequest.ts +65 -0
- package/src/models/FunctionVersion.ts +9 -0
- package/src/models/Instance.ts +15 -0
- package/src/models/InstanceDedicatedIP.ts +140 -0
- package/src/models/Model.ts +16 -0
- package/src/models/OfferingAlternative.ts +120 -0
- package/src/models/OperationError.ts +33 -1
- package/src/models/Problem.ts +3 -0
- package/src/models/index.ts +12 -0
- package/src/runtime.ts +1 -1
|
@@ -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,9 @@ 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',
|
|
79
|
+
DedicatedIpLimit: 'dedicated_ip_limit',
|
|
80
|
+
DedicatedIpUnavailable: 'dedicated_ip_unavailable',
|
|
78
81
|
InsufficientBalance: 'insufficient_balance',
|
|
79
82
|
QuotaExceeded: 'quota_exceeded',
|
|
80
83
|
RateLimited: 'rate_limited',
|
package/src/models/index.ts
CHANGED
|
@@ -8,8 +8,17 @@ export * from './Balance';
|
|
|
8
8
|
export * from './BillingDetails';
|
|
9
9
|
export * from './ChatChoice';
|
|
10
10
|
export * from './ChatCompletionRequest';
|
|
11
|
+
export * from './ChatCompletionRequestToolChoice';
|
|
11
12
|
export * from './ChatCompletionResponse';
|
|
13
|
+
export * from './ChatJSONSchemaFormat';
|
|
12
14
|
export * from './ChatMessage';
|
|
15
|
+
export * from './ChatNamedToolChoice';
|
|
16
|
+
export * from './ChatNamedToolChoiceFunction';
|
|
17
|
+
export * from './ChatResponseFormat';
|
|
18
|
+
export * from './ChatTool';
|
|
19
|
+
export * from './ChatToolCall';
|
|
20
|
+
export * from './ChatToolCallFunction';
|
|
21
|
+
export * from './ChatToolFunction';
|
|
13
22
|
export * from './CommunityMachine';
|
|
14
23
|
export * from './CommunityMachineDelistResult';
|
|
15
24
|
export * from './CommunityMachineRegistration';
|
|
@@ -28,6 +37,7 @@ export * from './CreateRegistryCredentialRequest';
|
|
|
28
37
|
export * from './CreateSshKeyRequest';
|
|
29
38
|
export * from './CreateWebhookEndpointRequest';
|
|
30
39
|
export * from './CryptoDeposit';
|
|
40
|
+
export * from './DedicatedIPRequest';
|
|
31
41
|
export * from './Embedding';
|
|
32
42
|
export * from './EmbeddingsRequest';
|
|
33
43
|
export * from './EmbeddingsRequestInput';
|
|
@@ -65,6 +75,7 @@ export * from './ImagesResponseUsage';
|
|
|
65
75
|
export * from './IncludeItem';
|
|
66
76
|
export * from './Instance';
|
|
67
77
|
export * from './InstanceConnection';
|
|
78
|
+
export * from './InstanceDedicatedIP';
|
|
68
79
|
export * from './InstanceGpuMemory';
|
|
69
80
|
export * from './InstancePage';
|
|
70
81
|
export * from './Invoice';
|
|
@@ -79,6 +90,7 @@ export * from './ModelList';
|
|
|
79
90
|
export * from './ModelParametersInner';
|
|
80
91
|
export * from './ModelPricing';
|
|
81
92
|
export * from './ModelRate';
|
|
93
|
+
export * from './OfferingAlternative';
|
|
82
94
|
export * from './OpenAIErrorEnvelope';
|
|
83
95
|
export * from './OpenAIErrorEnvelopeError';
|
|
84
96
|
export * from './Operation';
|
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.
|
|
78
|
+
return { 'User-Agent': 'gpuai-sdk-ts/0.5.1', ...this.configuration.headers };
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
get credentials(): RequestCredentials | undefined {
|