@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,104 @@
|
|
|
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
|
+
import type { ChatToolCallFunction } from './ChatToolCallFunction';
|
|
17
|
+
import {
|
|
18
|
+
ChatToolCallFunctionFromJSON,
|
|
19
|
+
ChatToolCallFunctionFromJSONTyped,
|
|
20
|
+
ChatToolCallFunctionToJSON,
|
|
21
|
+
ChatToolCallFunctionToJSONTyped,
|
|
22
|
+
} from './ChatToolCallFunction';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface ChatToolCall
|
|
28
|
+
*/
|
|
29
|
+
export interface ChatToolCall {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof ChatToolCall
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {ChatToolCallTypeEnum}
|
|
39
|
+
* @memberof ChatToolCall
|
|
40
|
+
*/
|
|
41
|
+
type: ChatToolCallTypeEnum;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {ChatToolCallFunction}
|
|
45
|
+
* @memberof ChatToolCall
|
|
46
|
+
*/
|
|
47
|
+
_function: ChatToolCallFunction;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @export
|
|
53
|
+
*/
|
|
54
|
+
export const ChatToolCallTypeEnum = {
|
|
55
|
+
Function: 'function'
|
|
56
|
+
} as const;
|
|
57
|
+
export type ChatToolCallTypeEnum = typeof ChatToolCallTypeEnum[keyof typeof ChatToolCallTypeEnum];
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the ChatToolCall interface.
|
|
62
|
+
*/
|
|
63
|
+
export function instanceOfChatToolCall(value: object): value is ChatToolCall {
|
|
64
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
65
|
+
if (!('type' in value) || value['type'] === undefined) return false;
|
|
66
|
+
if (value['type'] !== 'function') return false;
|
|
67
|
+
|
|
68
|
+
if ((!('_function' in (value as Record<string, any>)) && !('function' in (value as Record<string, any>))) || ((value as Record<string, any>)['_function'] === undefined && (value as Record<string, any>)['function'] === undefined)) return false;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function ChatToolCallFromJSON(json: any): ChatToolCall {
|
|
73
|
+
return ChatToolCallFromJSONTyped(json, false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function ChatToolCallFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatToolCall {
|
|
77
|
+
if (json == null) {
|
|
78
|
+
return json;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
|
|
82
|
+
'id': json['id'],
|
|
83
|
+
'type': json['type'],
|
|
84
|
+
'_function': ChatToolCallFunctionFromJSON(json['function']),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function ChatToolCallToJSON(json: any): ChatToolCall {
|
|
89
|
+
return ChatToolCallToJSONTyped(json, false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function ChatToolCallToJSONTyped(value?: ChatToolCall | null, ignoreDiscriminator: boolean = false): any {
|
|
93
|
+
if (value == null) {
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
|
|
99
|
+
'id': value['id'],
|
|
100
|
+
'type': value['type'],
|
|
101
|
+
'function': ChatToolCallFunctionToJSON(value['_function']),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
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 ChatToolCallFunction
|
|
20
|
+
*/
|
|
21
|
+
export interface ChatToolCallFunction {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ChatToolCallFunction
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* JSON-encoded arguments object, as a string.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ChatToolCallFunction
|
|
32
|
+
*/
|
|
33
|
+
arguments: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the ChatToolCallFunction interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfChatToolCallFunction(value: object): value is ChatToolCallFunction {
|
|
40
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
41
|
+
if (!('arguments' in value) || value['arguments'] === undefined) return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function ChatToolCallFunctionFromJSON(json: any): ChatToolCallFunction {
|
|
46
|
+
return ChatToolCallFunctionFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function ChatToolCallFunctionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatToolCallFunction {
|
|
50
|
+
if (json == null) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
|
|
55
|
+
'name': json['name'],
|
|
56
|
+
'arguments': json['arguments'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ChatToolCallFunctionToJSON(json: any): ChatToolCallFunction {
|
|
61
|
+
return ChatToolCallFunctionToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function ChatToolCallFunctionToJSONTyped(value?: ChatToolCallFunction | null, ignoreDiscriminator: boolean = false): any {
|
|
65
|
+
if (value == null) {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
|
|
71
|
+
'name': value['name'],
|
|
72
|
+
'arguments': value['arguments'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
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 ChatToolFunction
|
|
20
|
+
*/
|
|
21
|
+
export interface ChatToolFunction {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ChatToolFunction
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ChatToolFunction
|
|
32
|
+
*/
|
|
33
|
+
description?: string;
|
|
34
|
+
/**
|
|
35
|
+
* JSON Schema for the function arguments.
|
|
36
|
+
* @type {{ [key: string]: any; }}
|
|
37
|
+
* @memberof ChatToolFunction
|
|
38
|
+
*/
|
|
39
|
+
parameters?: { [key: string]: any; };
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
* @memberof ChatToolFunction
|
|
44
|
+
*/
|
|
45
|
+
strict?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the ChatToolFunction interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfChatToolFunction(value: object): value is ChatToolFunction {
|
|
52
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function ChatToolFunctionFromJSON(json: any): ChatToolFunction {
|
|
57
|
+
return ChatToolFunctionFromJSONTyped(json, false);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ChatToolFunctionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatToolFunction {
|
|
61
|
+
if (json == null) {
|
|
62
|
+
return json;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
|
|
66
|
+
'name': json['name'],
|
|
67
|
+
'description': json['description'] == null ? undefined : json['description'],
|
|
68
|
+
'parameters': json['parameters'] == null ? undefined : json['parameters'],
|
|
69
|
+
'strict': json['strict'] == null ? undefined : json['strict'],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function ChatToolFunctionToJSON(json: any): ChatToolFunction {
|
|
74
|
+
return ChatToolFunctionToJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function ChatToolFunctionToJSONTyped(value?: ChatToolFunction | null, ignoreDiscriminator: boolean = false): any {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'name': value['name'],
|
|
85
|
+
'description': value['description'],
|
|
86
|
+
'parameters': value['parameters'],
|
|
87
|
+
'strict': value['strict'],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
@@ -103,6 +103,12 @@ export interface CreateFunctionVersionRequest {
|
|
|
103
103
|
* @memberof CreateFunctionVersionRequest
|
|
104
104
|
*/
|
|
105
105
|
maxConcurrency?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Names of organization secrets (POST /secrets) each run receives as environment variables of the same names, resolved per call so a rotated value reaches the next call. Values are never in a response or a log. Returns 422 `validation_failed` when a name does not exist or secrets are not enabled on this deployment.
|
|
108
|
+
* @type {Array<string>}
|
|
109
|
+
* @memberof CreateFunctionVersionRequest
|
|
110
|
+
*/
|
|
111
|
+
secrets?: Array<string>;
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
/**
|
|
@@ -142,6 +148,7 @@ export function CreateFunctionVersionRequestFromJSONTyped(json: any, ignoreDiscr
|
|
|
142
148
|
'timeout': json['timeout'],
|
|
143
149
|
'idleTimeout': json['idle_timeout'] == null ? undefined : json['idle_timeout'],
|
|
144
150
|
'maxConcurrency': json['max_concurrency'] == null ? undefined : json['max_concurrency'],
|
|
151
|
+
'secrets': json['secrets'] == null ? undefined : json['secrets'],
|
|
145
152
|
};
|
|
146
153
|
}
|
|
147
154
|
|
|
@@ -170,6 +177,7 @@ export function CreateFunctionVersionRequestToJSONTyped(value?: CreateFunctionVe
|
|
|
170
177
|
'timeout': value['timeout'],
|
|
171
178
|
'idle_timeout': value['idleTimeout'],
|
|
172
179
|
'max_concurrency': value['maxConcurrency'],
|
|
180
|
+
'secrets': value['secrets'],
|
|
173
181
|
};
|
|
174
182
|
}
|
|
175
183
|
|
|
@@ -20,6 +20,13 @@ import {
|
|
|
20
20
|
CreateInstanceRequestPortsInnerToJSON,
|
|
21
21
|
CreateInstanceRequestPortsInnerToJSONTyped,
|
|
22
22
|
} from './CreateInstanceRequestPortsInner';
|
|
23
|
+
import type { DedicatedIPRequest } from './DedicatedIPRequest';
|
|
24
|
+
import {
|
|
25
|
+
DedicatedIPRequestFromJSON,
|
|
26
|
+
DedicatedIPRequestFromJSONTyped,
|
|
27
|
+
DedicatedIPRequestToJSON,
|
|
28
|
+
DedicatedIPRequestToJSONTyped,
|
|
29
|
+
} from './DedicatedIPRequest';
|
|
23
30
|
|
|
24
31
|
/**
|
|
25
32
|
*
|
|
@@ -141,6 +148,18 @@ export interface CreateInstanceRequest {
|
|
|
141
148
|
* @memberof CreateInstanceRequest
|
|
142
149
|
*/
|
|
143
150
|
ports?: Array<CreateInstanceRequestPortsInner>;
|
|
151
|
+
/**
|
|
152
|
+
* Attach a dedicated public IPv4 address owned by GPU.ai. Its inbound TCP ports (80 and 443 unless `ports` says otherwise) forward, raw and without TLS termination, to the same ports on the instance's loopback, so your own certificates work. Billed hourly while attached plus per GB of transfer in both directions (see GET /dedicated-ip). on_demand tier only (422 `validation_failed` otherwise). Returns 409 `dedicated_ip_limit` when the organization already holds its limit, 503 `dedicated_ip_unavailable` when no address is free, 422 `validation_failed` for ports outside the allowed set, and 400 `validation_failed` on deployments where the add-on is not enabled. A launch whose address cannot be attached fails its operation with `dedicated_ip_unavailable`. The address is released when the instance terminates or fails.
|
|
153
|
+
* @type {DedicatedIPRequest}
|
|
154
|
+
* @memberof CreateInstanceRequest
|
|
155
|
+
*/
|
|
156
|
+
dedicatedIp?: DedicatedIPRequest;
|
|
157
|
+
/**
|
|
158
|
+
* Names of organization secrets (POST /secrets) to deliver to the machine at boot as environment variables of the same names. Values are never in a response or a log. Returns 422 `validation_failed` when a name does not exist or secrets are not enabled on this deployment.
|
|
159
|
+
* @type {Array<string>}
|
|
160
|
+
* @memberof CreateInstanceRequest
|
|
161
|
+
*/
|
|
162
|
+
secrets?: Array<string>;
|
|
144
163
|
}
|
|
145
164
|
|
|
146
165
|
|
|
@@ -193,6 +212,8 @@ export function CreateInstanceRequestFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
193
212
|
'entrypoint': json['entrypoint'] == null ? undefined : json['entrypoint'],
|
|
194
213
|
'cmd': json['cmd'] == null ? undefined : json['cmd'],
|
|
195
214
|
'ports': json['ports'] == null ? undefined : ((json['ports'] as Array<any>).map(CreateInstanceRequestPortsInnerFromJSON)),
|
|
215
|
+
'dedicatedIp': json['dedicated_ip'] == null ? undefined : DedicatedIPRequestFromJSON(json['dedicated_ip']),
|
|
216
|
+
'secrets': json['secrets'] == null ? undefined : json['secrets'],
|
|
196
217
|
};
|
|
197
218
|
}
|
|
198
219
|
|
|
@@ -226,6 +247,8 @@ export function CreateInstanceRequestToJSONTyped(value?: CreateInstanceRequest |
|
|
|
226
247
|
'entrypoint': value['entrypoint'],
|
|
227
248
|
'cmd': value['cmd'],
|
|
228
249
|
'ports': value['ports'] == null ? undefined : ((value['ports'] as Array<any>).map(CreateInstanceRequestPortsInnerToJSON)),
|
|
250
|
+
'dedicated_ip': DedicatedIPRequestToJSON(value['dedicatedIp']),
|
|
251
|
+
'secrets': value['secrets'],
|
|
229
252
|
};
|
|
230
253
|
}
|
|
231
254
|
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* Requests a dedicated public IPv4 address for the instance. Send an empty object for the default ports (80 and 443).
|
|
18
|
+
* @export
|
|
19
|
+
* @interface DedicatedIPRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface DedicatedIPRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Inbound TCP ports to forward. Each must be in the deployment's allowed set (see GET /dedicated-ip). Port 22 and the gateway's own ports are never allowed; SSH stays on the instance's SSH command. Omit for the defaults.
|
|
24
|
+
* @type {Array<number>}
|
|
25
|
+
* @memberof DedicatedIPRequest
|
|
26
|
+
*/
|
|
27
|
+
ports?: Array<number>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the DedicatedIPRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfDedicatedIPRequest(value: object): value is DedicatedIPRequest {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function DedicatedIPRequestFromJSON(json: any): DedicatedIPRequest {
|
|
38
|
+
return DedicatedIPRequestFromJSONTyped(json, false);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function DedicatedIPRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DedicatedIPRequest {
|
|
42
|
+
if (json == null) {
|
|
43
|
+
return json;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
|
|
47
|
+
'ports': json['ports'] == null ? undefined : json['ports'],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function DedicatedIPRequestToJSON(json: any): DedicatedIPRequest {
|
|
52
|
+
return DedicatedIPRequestToJSONTyped(json, false);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function DedicatedIPRequestToJSONTyped(value?: DedicatedIPRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
56
|
+
if (value == null) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
|
|
62
|
+
'ports': value['ports'],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
@@ -123,6 +123,12 @@ export interface FunctionVersion {
|
|
|
123
123
|
* @memberof FunctionVersion
|
|
124
124
|
*/
|
|
125
125
|
maxConcurrency: number;
|
|
126
|
+
/**
|
|
127
|
+
* Names of the organization secrets each run receives. Empty when none.
|
|
128
|
+
* @type {Array<string>}
|
|
129
|
+
* @memberof FunctionVersion
|
|
130
|
+
*/
|
|
131
|
+
secrets: Array<string>;
|
|
126
132
|
/**
|
|
127
133
|
*
|
|
128
134
|
* @type {Date}
|
|
@@ -159,6 +165,7 @@ export function instanceOfFunctionVersion(value: object): value is FunctionVersi
|
|
|
159
165
|
if (!('timeout' in value) || value['timeout'] === undefined) return false;
|
|
160
166
|
if ((!('idleTimeout' in (value as Record<string, any>)) && !('idle_timeout' in (value as Record<string, any>))) || ((value as Record<string, any>)['idleTimeout'] === undefined && (value as Record<string, any>)['idle_timeout'] === undefined)) return false;
|
|
161
167
|
if ((!('maxConcurrency' in (value as Record<string, any>)) && !('max_concurrency' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxConcurrency'] === undefined && (value as Record<string, any>)['max_concurrency'] === undefined)) return false;
|
|
168
|
+
if (!('secrets' in value) || value['secrets'] === undefined) return false;
|
|
162
169
|
if ((!('createdAt' in (value as Record<string, any>)) && !('created_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['createdAt'] === undefined && (value as Record<string, any>)['created_at'] === undefined)) return false;
|
|
163
170
|
return true;
|
|
164
171
|
}
|
|
@@ -189,6 +196,7 @@ export function FunctionVersionFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
189
196
|
'timeout': json['timeout'],
|
|
190
197
|
'idleTimeout': json['idle_timeout'],
|
|
191
198
|
'maxConcurrency': json['max_concurrency'],
|
|
199
|
+
'secrets': json['secrets'],
|
|
192
200
|
'createdAt': (new Date(json['created_at'])),
|
|
193
201
|
};
|
|
194
202
|
}
|
|
@@ -220,6 +228,7 @@ export function FunctionVersionToJSONTyped(value?: FunctionVersion | null, ignor
|
|
|
220
228
|
'timeout': value['timeout'],
|
|
221
229
|
'idle_timeout': value['idleTimeout'],
|
|
222
230
|
'max_concurrency': value['maxConcurrency'],
|
|
231
|
+
'secrets': value['secrets'],
|
|
223
232
|
'created_at': value['createdAt'].toISOString(),
|
|
224
233
|
};
|
|
225
234
|
}
|
package/src/models/Instance.ts
CHANGED
|
@@ -27,6 +27,13 @@ import {
|
|
|
27
27
|
InstanceGpuMemoryToJSON,
|
|
28
28
|
InstanceGpuMemoryToJSONTyped,
|
|
29
29
|
} from './InstanceGpuMemory';
|
|
30
|
+
import type { InstanceDedicatedIP } from './InstanceDedicatedIP';
|
|
31
|
+
import {
|
|
32
|
+
InstanceDedicatedIPFromJSON,
|
|
33
|
+
InstanceDedicatedIPFromJSONTyped,
|
|
34
|
+
InstanceDedicatedIPToJSON,
|
|
35
|
+
InstanceDedicatedIPToJSONTyped,
|
|
36
|
+
} from './InstanceDedicatedIP';
|
|
30
37
|
|
|
31
38
|
/**
|
|
32
39
|
*
|
|
@@ -160,6 +167,12 @@ export interface Instance {
|
|
|
160
167
|
* @memberof Instance
|
|
161
168
|
*/
|
|
162
169
|
bootPhase?: InstanceBootPhaseEnum;
|
|
170
|
+
/**
|
|
171
|
+
*
|
|
172
|
+
* @type {InstanceDedicatedIP}
|
|
173
|
+
* @memberof Instance
|
|
174
|
+
*/
|
|
175
|
+
dedicatedIp?: InstanceDedicatedIP;
|
|
163
176
|
}
|
|
164
177
|
|
|
165
178
|
|
|
@@ -244,6 +257,7 @@ export function InstanceFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
244
257
|
'lastReachableAt': json['last_reachable_at'] == null ? undefined : (new Date(json['last_reachable_at'])),
|
|
245
258
|
'unreachableSince': json['unreachable_since'] == null ? undefined : (new Date(json['unreachable_since'])),
|
|
246
259
|
'bootPhase': json['boot_phase'] == null ? undefined : json['boot_phase'],
|
|
260
|
+
'dedicatedIp': json['dedicated_ip'] == null ? undefined : InstanceDedicatedIPFromJSON(json['dedicated_ip']),
|
|
247
261
|
};
|
|
248
262
|
}
|
|
249
263
|
|
|
@@ -279,6 +293,7 @@ export function InstanceToJSONTyped(value?: Instance | null, ignoreDiscriminator
|
|
|
279
293
|
'last_reachable_at': value['lastReachableAt'] == null ? value['lastReachableAt'] : value['lastReachableAt'].toISOString(),
|
|
280
294
|
'unreachable_since': value['unreachableSince'] == null ? value['unreachableSince'] : value['unreachableSince'].toISOString(),
|
|
281
295
|
'boot_phase': value['bootPhase'],
|
|
296
|
+
'dedicated_ip': InstanceDedicatedIPToJSON(value['dedicatedIp']),
|
|
282
297
|
};
|
|
283
298
|
}
|
|
284
299
|
|
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
* The instance's dedicated public IPv4 add-on. Present only on instances launched with `dedicated_ip`, and only on deployments where the add-on is enabled.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface InstanceDedicatedIP
|
|
20
|
+
*/
|
|
21
|
+
export interface InstanceDedicatedIP {
|
|
22
|
+
/**
|
|
23
|
+
* The GPU.ai-owned public IPv4 address. Point your DNS A record here.
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof InstanceDedicatedIP
|
|
26
|
+
*/
|
|
27
|
+
address: string;
|
|
28
|
+
/**
|
|
29
|
+
* Inbound TCP ports forwarded to the same port on the instance's loopback.
|
|
30
|
+
* @type {Array<number>}
|
|
31
|
+
* @memberof InstanceDedicatedIP
|
|
32
|
+
*/
|
|
33
|
+
ports: Array<number>;
|
|
34
|
+
/**
|
|
35
|
+
* active means traffic is forwarded. suspended means forwarding has stopped (see suspend_reason), for example after the transfer cap was reached. released means the address was returned because the instance terminated or failed.
|
|
36
|
+
* @type {InstanceDedicatedIPStatusEnum}
|
|
37
|
+
* @memberof InstanceDedicatedIP
|
|
38
|
+
*/
|
|
39
|
+
status: InstanceDedicatedIPStatusEnum;
|
|
40
|
+
/**
|
|
41
|
+
* Why forwarding is suspended, e.g. `transfer_cap`. Present only while suspended.
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof InstanceDedicatedIP
|
|
44
|
+
*/
|
|
45
|
+
suspendReason?: string;
|
|
46
|
+
/**
|
|
47
|
+
* USD per hour charged while the address is attached, locked at launch.
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof InstanceDedicatedIP
|
|
50
|
+
*/
|
|
51
|
+
hourlyFee: number;
|
|
52
|
+
/**
|
|
53
|
+
* USD per GB of traffic through the address, both directions, locked at launch.
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof InstanceDedicatedIP
|
|
56
|
+
*/
|
|
57
|
+
transferPricePerGb: number;
|
|
58
|
+
/**
|
|
59
|
+
* GB transferred through the address so far, both directions.
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof InstanceDedicatedIP
|
|
62
|
+
*/
|
|
63
|
+
transferGb: number;
|
|
64
|
+
/**
|
|
65
|
+
* Total charged for this address so far (hourly fee plus transfer), in USD.
|
|
66
|
+
* @type {number}
|
|
67
|
+
* @memberof InstanceDedicatedIP
|
|
68
|
+
*/
|
|
69
|
+
chargedUsd: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @export
|
|
75
|
+
*/
|
|
76
|
+
export const InstanceDedicatedIPStatusEnum = {
|
|
77
|
+
Active: 'active',
|
|
78
|
+
Suspended: 'suspended',
|
|
79
|
+
Released: 'released'
|
|
80
|
+
} as const;
|
|
81
|
+
export type InstanceDedicatedIPStatusEnum = typeof InstanceDedicatedIPStatusEnum[keyof typeof InstanceDedicatedIPStatusEnum];
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Check if a given object implements the InstanceDedicatedIP interface.
|
|
86
|
+
*/
|
|
87
|
+
export function instanceOfInstanceDedicatedIP(value: object): value is InstanceDedicatedIP {
|
|
88
|
+
if (!('address' in value) || value['address'] === undefined) return false;
|
|
89
|
+
if (!('ports' in value) || value['ports'] === undefined) return false;
|
|
90
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
91
|
+
if ((!('hourlyFee' in (value as Record<string, any>)) && !('hourly_fee' in (value as Record<string, any>))) || ((value as Record<string, any>)['hourlyFee'] === undefined && (value as Record<string, any>)['hourly_fee'] === undefined)) return false;
|
|
92
|
+
if ((!('transferPricePerGb' in (value as Record<string, any>)) && !('transfer_price_per_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['transferPricePerGb'] === undefined && (value as Record<string, any>)['transfer_price_per_gb'] === undefined)) return false;
|
|
93
|
+
if ((!('transferGb' in (value as Record<string, any>)) && !('transfer_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['transferGb'] === undefined && (value as Record<string, any>)['transfer_gb'] === undefined)) return false;
|
|
94
|
+
if ((!('chargedUsd' in (value as Record<string, any>)) && !('charged_usd' in (value as Record<string, any>))) || ((value as Record<string, any>)['chargedUsd'] === undefined && (value as Record<string, any>)['charged_usd'] === undefined)) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function InstanceDedicatedIPFromJSON(json: any): InstanceDedicatedIP {
|
|
99
|
+
return InstanceDedicatedIPFromJSONTyped(json, false);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function InstanceDedicatedIPFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstanceDedicatedIP {
|
|
103
|
+
if (json == null) {
|
|
104
|
+
return json;
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
|
|
108
|
+
'address': json['address'],
|
|
109
|
+
'ports': json['ports'],
|
|
110
|
+
'status': json['status'],
|
|
111
|
+
'suspendReason': json['suspend_reason'] == null ? undefined : json['suspend_reason'],
|
|
112
|
+
'hourlyFee': json['hourly_fee'],
|
|
113
|
+
'transferPricePerGb': json['transfer_price_per_gb'],
|
|
114
|
+
'transferGb': json['transfer_gb'],
|
|
115
|
+
'chargedUsd': json['charged_usd'],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function InstanceDedicatedIPToJSON(json: any): InstanceDedicatedIP {
|
|
120
|
+
return InstanceDedicatedIPToJSONTyped(json, false);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function InstanceDedicatedIPToJSONTyped(value?: InstanceDedicatedIP | null, ignoreDiscriminator: boolean = false): any {
|
|
124
|
+
if (value == null) {
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
|
|
130
|
+
'address': value['address'],
|
|
131
|
+
'ports': value['ports'],
|
|
132
|
+
'status': value['status'],
|
|
133
|
+
'suspend_reason': value['suspendReason'],
|
|
134
|
+
'hourly_fee': value['hourlyFee'],
|
|
135
|
+
'transfer_price_per_gb': value['transferPricePerGb'],
|
|
136
|
+
'transfer_gb': value['transferGb'],
|
|
137
|
+
'charged_usd': value['chargedUsd'],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
package/src/models/Model.ts
CHANGED
|
@@ -88,6 +88,18 @@ export interface Model {
|
|
|
88
88
|
* @memberof Model
|
|
89
89
|
*/
|
|
90
90
|
supportedParameters?: Array<string>;
|
|
91
|
+
/**
|
|
92
|
+
* Chat models only. True when POST /v1/chat/completions accepts tools / tool_choice / parallel_tool_calls for this model and tier.
|
|
93
|
+
* @type {boolean}
|
|
94
|
+
* @memberof Model
|
|
95
|
+
*/
|
|
96
|
+
supportsTools?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Chat models only. True when POST /v1/chat/completions accepts response_format json_object / json_schema for this model and tier.
|
|
99
|
+
* @type {boolean}
|
|
100
|
+
* @memberof Model
|
|
101
|
+
*/
|
|
102
|
+
supportsStructuredOutputs?: boolean;
|
|
91
103
|
/**
|
|
92
104
|
* Typed parameter descriptors for media (image/video) models — name, type, enum/bounds/default. Playgrounds render input forms from these.
|
|
93
105
|
* @type {Array<ModelParametersInner>}
|
|
@@ -191,6 +203,8 @@ export function ModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): Mod
|
|
|
191
203
|
'category': json['category'] == null ? undefined : json['category'],
|
|
192
204
|
'contextLength': json['context_length'] == null ? undefined : json['context_length'],
|
|
193
205
|
'supportedParameters': json['supported_parameters'] == null ? undefined : json['supported_parameters'],
|
|
206
|
+
'supportsTools': json['supports_tools'] == null ? undefined : json['supports_tools'],
|
|
207
|
+
'supportsStructuredOutputs': json['supports_structured_outputs'] == null ? undefined : json['supports_structured_outputs'],
|
|
194
208
|
'parameters': json['parameters'] == null ? undefined : ((json['parameters'] as Array<any>).map(ModelParametersInnerFromJSON)),
|
|
195
209
|
'pricing': ModelPricingFromJSON(json['pricing']),
|
|
196
210
|
'aliases': json['aliases'] == null ? undefined : json['aliases'],
|
|
@@ -220,6 +234,8 @@ export function ModelToJSONTyped(value?: Model | null, ignoreDiscriminator: bool
|
|
|
220
234
|
'category': value['category'],
|
|
221
235
|
'context_length': value['contextLength'],
|
|
222
236
|
'supported_parameters': value['supportedParameters'],
|
|
237
|
+
'supports_tools': value['supportsTools'],
|
|
238
|
+
'supports_structured_outputs': value['supportsStructuredOutputs'],
|
|
223
239
|
'parameters': value['parameters'] == null ? undefined : ((value['parameters'] as Array<any>).map(ModelParametersInnerToJSON)),
|
|
224
240
|
'pricing': ModelPricingToJSON(value['pricing']),
|
|
225
241
|
'aliases': value['aliases'],
|