@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
|
@@ -57,6 +57,8 @@ function instanceOfFunctionVersion(value) {
|
|
|
57
57
|
return false;
|
|
58
58
|
if ((!('maxConcurrency' in value) && !('max_concurrency' in value)) || (value['maxConcurrency'] === undefined && value['max_concurrency'] === undefined))
|
|
59
59
|
return false;
|
|
60
|
+
if (!('secrets' in value) || value['secrets'] === undefined)
|
|
61
|
+
return false;
|
|
60
62
|
if ((!('createdAt' in value) && !('created_at' in value)) || (value['createdAt'] === undefined && value['created_at'] === undefined))
|
|
61
63
|
return false;
|
|
62
64
|
return true;
|
|
@@ -85,6 +87,7 @@ function FunctionVersionFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
85
87
|
'timeout': json['timeout'],
|
|
86
88
|
'idleTimeout': json['idle_timeout'],
|
|
87
89
|
'maxConcurrency': json['max_concurrency'],
|
|
90
|
+
'secrets': json['secrets'],
|
|
88
91
|
'createdAt': (new Date(json['created_at'])),
|
|
89
92
|
};
|
|
90
93
|
}
|
|
@@ -112,6 +115,7 @@ function FunctionVersionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
112
115
|
'timeout': value['timeout'],
|
|
113
116
|
'idle_timeout': value['idleTimeout'],
|
|
114
117
|
'max_concurrency': value['maxConcurrency'],
|
|
118
|
+
'secrets': value['secrets'],
|
|
115
119
|
'created_at': value['createdAt'].toISOString(),
|
|
116
120
|
};
|
|
117
121
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { InstanceConnection } from './InstanceConnection';
|
|
13
13
|
import type { InstanceGpuMemory } from './InstanceGpuMemory';
|
|
14
|
+
import type { InstanceDedicatedIP } from './InstanceDedicatedIP';
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
16
17
|
* @export
|
|
@@ -143,6 +144,12 @@ export interface Instance {
|
|
|
143
144
|
* @memberof Instance
|
|
144
145
|
*/
|
|
145
146
|
bootPhase?: InstanceBootPhaseEnum;
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* @type {InstanceDedicatedIP}
|
|
150
|
+
* @memberof Instance
|
|
151
|
+
*/
|
|
152
|
+
dedicatedIp?: InstanceDedicatedIP;
|
|
146
153
|
}
|
|
147
154
|
/**
|
|
148
155
|
* @export
|
package/dist/models/Instance.js
CHANGED
|
@@ -21,6 +21,7 @@ exports.InstanceToJSON = InstanceToJSON;
|
|
|
21
21
|
exports.InstanceToJSONTyped = InstanceToJSONTyped;
|
|
22
22
|
const InstanceConnection_1 = require("./InstanceConnection");
|
|
23
23
|
const InstanceGpuMemory_1 = require("./InstanceGpuMemory");
|
|
24
|
+
const InstanceDedicatedIP_1 = require("./InstanceDedicatedIP");
|
|
24
25
|
/**
|
|
25
26
|
* @export
|
|
26
27
|
*/
|
|
@@ -100,6 +101,7 @@ function InstanceFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
100
101
|
'lastReachableAt': json['last_reachable_at'] == null ? undefined : (new Date(json['last_reachable_at'])),
|
|
101
102
|
'unreachableSince': json['unreachable_since'] == null ? undefined : (new Date(json['unreachable_since'])),
|
|
102
103
|
'bootPhase': json['boot_phase'] == null ? undefined : json['boot_phase'],
|
|
104
|
+
'dedicatedIp': json['dedicated_ip'] == null ? undefined : (0, InstanceDedicatedIP_1.InstanceDedicatedIPFromJSON)(json['dedicated_ip']),
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
function InstanceToJSON(json) {
|
|
@@ -131,5 +133,6 @@ function InstanceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
131
133
|
'last_reachable_at': value['lastReachableAt'] == null ? value['lastReachableAt'] : value['lastReachableAt'].toISOString(),
|
|
132
134
|
'unreachable_since': value['unreachableSince'] == null ? value['unreachableSince'] : value['unreachableSince'].toISOString(),
|
|
133
135
|
'boot_phase': value['bootPhase'],
|
|
136
|
+
'dedicated_ip': (0, InstanceDedicatedIP_1.InstanceDedicatedIPToJSON)(value['dedicatedIp']),
|
|
134
137
|
};
|
|
135
138
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GPU.ai Public Developer API
|
|
3
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@gpu.ai
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 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.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface InstanceDedicatedIP
|
|
16
|
+
*/
|
|
17
|
+
export interface InstanceDedicatedIP {
|
|
18
|
+
/**
|
|
19
|
+
* The GPU.ai-owned public IPv4 address. Point your DNS A record here.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof InstanceDedicatedIP
|
|
22
|
+
*/
|
|
23
|
+
address: string;
|
|
24
|
+
/**
|
|
25
|
+
* Inbound TCP ports forwarded to the same port on the instance's loopback.
|
|
26
|
+
* @type {Array<number>}
|
|
27
|
+
* @memberof InstanceDedicatedIP
|
|
28
|
+
*/
|
|
29
|
+
ports: Array<number>;
|
|
30
|
+
/**
|
|
31
|
+
* 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.
|
|
32
|
+
* @type {InstanceDedicatedIPStatusEnum}
|
|
33
|
+
* @memberof InstanceDedicatedIP
|
|
34
|
+
*/
|
|
35
|
+
status: InstanceDedicatedIPStatusEnum;
|
|
36
|
+
/**
|
|
37
|
+
* Why forwarding is suspended, e.g. `transfer_cap`. Present only while suspended.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof InstanceDedicatedIP
|
|
40
|
+
*/
|
|
41
|
+
suspendReason?: string;
|
|
42
|
+
/**
|
|
43
|
+
* USD per hour charged while the address is attached, locked at launch.
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof InstanceDedicatedIP
|
|
46
|
+
*/
|
|
47
|
+
hourlyFee: number;
|
|
48
|
+
/**
|
|
49
|
+
* USD per GB of traffic through the address, both directions, locked at launch.
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof InstanceDedicatedIP
|
|
52
|
+
*/
|
|
53
|
+
transferPricePerGb: number;
|
|
54
|
+
/**
|
|
55
|
+
* GB transferred through the address so far, both directions.
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @memberof InstanceDedicatedIP
|
|
58
|
+
*/
|
|
59
|
+
transferGb: number;
|
|
60
|
+
/**
|
|
61
|
+
* Total charged for this address so far (hourly fee plus transfer), in USD.
|
|
62
|
+
* @type {number}
|
|
63
|
+
* @memberof InstanceDedicatedIP
|
|
64
|
+
*/
|
|
65
|
+
chargedUsd: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @export
|
|
69
|
+
*/
|
|
70
|
+
export declare const InstanceDedicatedIPStatusEnum: {
|
|
71
|
+
readonly Active: "active";
|
|
72
|
+
readonly Suspended: "suspended";
|
|
73
|
+
readonly Released: "released";
|
|
74
|
+
};
|
|
75
|
+
export type InstanceDedicatedIPStatusEnum = typeof InstanceDedicatedIPStatusEnum[keyof typeof InstanceDedicatedIPStatusEnum];
|
|
76
|
+
/**
|
|
77
|
+
* Check if a given object implements the InstanceDedicatedIP interface.
|
|
78
|
+
*/
|
|
79
|
+
export declare function instanceOfInstanceDedicatedIP(value: object): value is InstanceDedicatedIP;
|
|
80
|
+
export declare function InstanceDedicatedIPFromJSON(json: any): InstanceDedicatedIP;
|
|
81
|
+
export declare function InstanceDedicatedIPFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstanceDedicatedIP;
|
|
82
|
+
export declare function InstanceDedicatedIPToJSON(json: any): InstanceDedicatedIP;
|
|
83
|
+
export declare function InstanceDedicatedIPToJSONTyped(value?: InstanceDedicatedIP | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* GPU.ai Public Developer API
|
|
6
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@gpu.ai
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.InstanceDedicatedIPStatusEnum = void 0;
|
|
17
|
+
exports.instanceOfInstanceDedicatedIP = instanceOfInstanceDedicatedIP;
|
|
18
|
+
exports.InstanceDedicatedIPFromJSON = InstanceDedicatedIPFromJSON;
|
|
19
|
+
exports.InstanceDedicatedIPFromJSONTyped = InstanceDedicatedIPFromJSONTyped;
|
|
20
|
+
exports.InstanceDedicatedIPToJSON = InstanceDedicatedIPToJSON;
|
|
21
|
+
exports.InstanceDedicatedIPToJSONTyped = InstanceDedicatedIPToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.InstanceDedicatedIPStatusEnum = {
|
|
26
|
+
Active: 'active',
|
|
27
|
+
Suspended: 'suspended',
|
|
28
|
+
Released: 'released'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the InstanceDedicatedIP interface.
|
|
32
|
+
*/
|
|
33
|
+
function instanceOfInstanceDedicatedIP(value) {
|
|
34
|
+
if (!('address' in value) || value['address'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (!('ports' in value) || value['ports'] === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
if (!('status' in value) || value['status'] === undefined)
|
|
39
|
+
return false;
|
|
40
|
+
if ((!('hourlyFee' in value) && !('hourly_fee' in value)) || (value['hourlyFee'] === undefined && value['hourly_fee'] === undefined))
|
|
41
|
+
return false;
|
|
42
|
+
if ((!('transferPricePerGb' in value) && !('transfer_price_per_gb' in value)) || (value['transferPricePerGb'] === undefined && value['transfer_price_per_gb'] === undefined))
|
|
43
|
+
return false;
|
|
44
|
+
if ((!('transferGb' in value) && !('transfer_gb' in value)) || (value['transferGb'] === undefined && value['transfer_gb'] === undefined))
|
|
45
|
+
return false;
|
|
46
|
+
if ((!('chargedUsd' in value) && !('charged_usd' in value)) || (value['chargedUsd'] === undefined && value['charged_usd'] === undefined))
|
|
47
|
+
return false;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
function InstanceDedicatedIPFromJSON(json) {
|
|
51
|
+
return InstanceDedicatedIPFromJSONTyped(json, false);
|
|
52
|
+
}
|
|
53
|
+
function InstanceDedicatedIPFromJSONTyped(json, ignoreDiscriminator) {
|
|
54
|
+
if (json == null) {
|
|
55
|
+
return json;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
'address': json['address'],
|
|
59
|
+
'ports': json['ports'],
|
|
60
|
+
'status': json['status'],
|
|
61
|
+
'suspendReason': json['suspend_reason'] == null ? undefined : json['suspend_reason'],
|
|
62
|
+
'hourlyFee': json['hourly_fee'],
|
|
63
|
+
'transferPricePerGb': json['transfer_price_per_gb'],
|
|
64
|
+
'transferGb': json['transfer_gb'],
|
|
65
|
+
'chargedUsd': json['charged_usd'],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function InstanceDedicatedIPToJSON(json) {
|
|
69
|
+
return InstanceDedicatedIPToJSONTyped(json, false);
|
|
70
|
+
}
|
|
71
|
+
function InstanceDedicatedIPToJSONTyped(value, ignoreDiscriminator = false) {
|
|
72
|
+
if (value == null) {
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
'address': value['address'],
|
|
77
|
+
'ports': value['ports'],
|
|
78
|
+
'status': value['status'],
|
|
79
|
+
'suspend_reason': value['suspendReason'],
|
|
80
|
+
'hourly_fee': value['hourlyFee'],
|
|
81
|
+
'transfer_price_per_gb': value['transferPricePerGb'],
|
|
82
|
+
'transfer_gb': value['transferGb'],
|
|
83
|
+
'charged_usd': value['chargedUsd'],
|
|
84
|
+
};
|
|
85
|
+
}
|
package/dist/models/Model.d.ts
CHANGED
|
@@ -71,6 +71,18 @@ export interface Model {
|
|
|
71
71
|
* @memberof Model
|
|
72
72
|
*/
|
|
73
73
|
supportedParameters?: Array<string>;
|
|
74
|
+
/**
|
|
75
|
+
* Chat models only. True when POST /v1/chat/completions accepts tools / tool_choice / parallel_tool_calls for this model and tier.
|
|
76
|
+
* @type {boolean}
|
|
77
|
+
* @memberof Model
|
|
78
|
+
*/
|
|
79
|
+
supportsTools?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Chat models only. True when POST /v1/chat/completions accepts response_format json_object / json_schema for this model and tier.
|
|
82
|
+
* @type {boolean}
|
|
83
|
+
* @memberof Model
|
|
84
|
+
*/
|
|
85
|
+
supportsStructuredOutputs?: boolean;
|
|
74
86
|
/**
|
|
75
87
|
* Typed parameter descriptors for media (image/video) models — name, type, enum/bounds/default. Playgrounds render input forms from these.
|
|
76
88
|
* @type {Array<ModelParametersInner>}
|
package/dist/models/Model.js
CHANGED
|
@@ -81,6 +81,8 @@ function ModelFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
81
81
|
'category': json['category'] == null ? undefined : json['category'],
|
|
82
82
|
'contextLength': json['context_length'] == null ? undefined : json['context_length'],
|
|
83
83
|
'supportedParameters': json['supported_parameters'] == null ? undefined : json['supported_parameters'],
|
|
84
|
+
'supportsTools': json['supports_tools'] == null ? undefined : json['supports_tools'],
|
|
85
|
+
'supportsStructuredOutputs': json['supports_structured_outputs'] == null ? undefined : json['supports_structured_outputs'],
|
|
84
86
|
'parameters': json['parameters'] == null ? undefined : (json['parameters'].map(ModelParametersInner_1.ModelParametersInnerFromJSON)),
|
|
85
87
|
'pricing': (0, ModelPricing_1.ModelPricingFromJSON)(json['pricing']),
|
|
86
88
|
'aliases': json['aliases'] == null ? undefined : json['aliases'],
|
|
@@ -106,6 +108,8 @@ function ModelToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
106
108
|
'category': value['category'],
|
|
107
109
|
'context_length': value['contextLength'],
|
|
108
110
|
'supported_parameters': value['supportedParameters'],
|
|
111
|
+
'supports_tools': value['supportsTools'],
|
|
112
|
+
'supports_structured_outputs': value['supportsStructuredOutputs'],
|
|
109
113
|
'parameters': value['parameters'] == null ? undefined : (value['parameters'].map(ModelParametersInner_1.ModelParametersInnerToJSON)),
|
|
110
114
|
'pricing': (0, ModelPricing_1.ModelPricingToJSON)(value['pricing']),
|
|
111
115
|
'aliases': value['aliases'],
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GPU.ai Public Developer API
|
|
3
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@gpu.ai
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A live catalog row a launch whose pinned offering was gone could take instead. Same fields and meaning as the matching GET /pricing row.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface OfferingAlternative
|
|
16
|
+
*/
|
|
17
|
+
export interface OfferingAlternative {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof OfferingAlternative
|
|
22
|
+
*/
|
|
23
|
+
offeringId: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof OfferingAlternative
|
|
28
|
+
*/
|
|
29
|
+
gpuType: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof OfferingAlternative
|
|
34
|
+
*/
|
|
35
|
+
gpuCount: number;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof OfferingAlternative
|
|
40
|
+
*/
|
|
41
|
+
region: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof OfferingAlternative
|
|
46
|
+
*/
|
|
47
|
+
tier: string;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof OfferingAlternative
|
|
52
|
+
*/
|
|
53
|
+
pricePerHour: number;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @memberof OfferingAlternative
|
|
58
|
+
*/
|
|
59
|
+
available: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Check if a given object implements the OfferingAlternative interface.
|
|
63
|
+
*/
|
|
64
|
+
export declare function instanceOfOfferingAlternative(value: object): value is OfferingAlternative;
|
|
65
|
+
export declare function OfferingAlternativeFromJSON(json: any): OfferingAlternative;
|
|
66
|
+
export declare function OfferingAlternativeFromJSONTyped(json: any, ignoreDiscriminator: boolean): OfferingAlternative;
|
|
67
|
+
export declare function OfferingAlternativeToJSON(json: any): OfferingAlternative;
|
|
68
|
+
export declare function OfferingAlternativeToJSONTyped(value?: OfferingAlternative | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* GPU.ai Public Developer API
|
|
6
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@gpu.ai
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfOfferingAlternative = instanceOfOfferingAlternative;
|
|
17
|
+
exports.OfferingAlternativeFromJSON = OfferingAlternativeFromJSON;
|
|
18
|
+
exports.OfferingAlternativeFromJSONTyped = OfferingAlternativeFromJSONTyped;
|
|
19
|
+
exports.OfferingAlternativeToJSON = OfferingAlternativeToJSON;
|
|
20
|
+
exports.OfferingAlternativeToJSONTyped = OfferingAlternativeToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the OfferingAlternative interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfOfferingAlternative(value) {
|
|
25
|
+
if ((!('offeringId' in value) && !('offering_id' in value)) || (value['offeringId'] === undefined && value['offering_id'] === undefined))
|
|
26
|
+
return false;
|
|
27
|
+
if ((!('gpuType' in value) && !('gpu_type' in value)) || (value['gpuType'] === undefined && value['gpu_type'] === undefined))
|
|
28
|
+
return false;
|
|
29
|
+
if ((!('gpuCount' in value) && !('gpu_count' in value)) || (value['gpuCount'] === undefined && value['gpu_count'] === undefined))
|
|
30
|
+
return false;
|
|
31
|
+
if (!('region' in value) || value['region'] === undefined)
|
|
32
|
+
return false;
|
|
33
|
+
if (!('tier' in value) || value['tier'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if ((!('pricePerHour' in value) && !('price_per_hour' in value)) || (value['pricePerHour'] === undefined && value['price_per_hour'] === undefined))
|
|
36
|
+
return false;
|
|
37
|
+
if (!('available' in value) || value['available'] === undefined)
|
|
38
|
+
return false;
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
function OfferingAlternativeFromJSON(json) {
|
|
42
|
+
return OfferingAlternativeFromJSONTyped(json, false);
|
|
43
|
+
}
|
|
44
|
+
function OfferingAlternativeFromJSONTyped(json, ignoreDiscriminator) {
|
|
45
|
+
if (json == null) {
|
|
46
|
+
return json;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'offeringId': json['offering_id'],
|
|
50
|
+
'gpuType': json['gpu_type'],
|
|
51
|
+
'gpuCount': json['gpu_count'],
|
|
52
|
+
'region': json['region'],
|
|
53
|
+
'tier': json['tier'],
|
|
54
|
+
'pricePerHour': json['price_per_hour'],
|
|
55
|
+
'available': json['available'],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function OfferingAlternativeToJSON(json) {
|
|
59
|
+
return OfferingAlternativeToJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
function OfferingAlternativeToJSONTyped(value, ignoreDiscriminator = false) {
|
|
62
|
+
if (value == null) {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
'offering_id': value['offeringId'],
|
|
67
|
+
'gpu_type': value['gpuType'],
|
|
68
|
+
'gpu_count': value['gpuCount'],
|
|
69
|
+
'region': value['region'],
|
|
70
|
+
'tier': value['tier'],
|
|
71
|
+
'price_per_hour': value['pricePerHour'],
|
|
72
|
+
'available': value['available'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { OfferingAlternative } from './OfferingAlternative';
|
|
12
13
|
/**
|
|
13
14
|
*
|
|
14
15
|
* @export
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
*/
|
|
17
18
|
export interface OperationError {
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* 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).
|
|
20
21
|
* @type {string}
|
|
21
22
|
* @memberof OperationError
|
|
22
23
|
*/
|
|
@@ -27,6 +28,24 @@ export interface OperationError {
|
|
|
27
28
|
* @memberof OperationError
|
|
28
29
|
*/
|
|
29
30
|
detail?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 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.
|
|
33
|
+
* @type {Array<OfferingAlternative>}
|
|
34
|
+
* @memberof OperationError
|
|
35
|
+
*/
|
|
36
|
+
alternatives?: Array<OfferingAlternative>;
|
|
37
|
+
/**
|
|
38
|
+
* Present only when code is price_changed: the live hourly price the launch found.
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof OperationError
|
|
41
|
+
*/
|
|
42
|
+
currentPricePerHour?: number;
|
|
43
|
+
/**
|
|
44
|
+
* 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.
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof OperationError
|
|
47
|
+
*/
|
|
48
|
+
maxPricePerHour?: number;
|
|
30
49
|
}
|
|
31
50
|
/**
|
|
32
51
|
* Check if a given object implements the OperationError interface.
|
|
@@ -18,6 +18,7 @@ exports.OperationErrorFromJSON = OperationErrorFromJSON;
|
|
|
18
18
|
exports.OperationErrorFromJSONTyped = OperationErrorFromJSONTyped;
|
|
19
19
|
exports.OperationErrorToJSON = OperationErrorToJSON;
|
|
20
20
|
exports.OperationErrorToJSONTyped = OperationErrorToJSONTyped;
|
|
21
|
+
const OfferingAlternative_1 = require("./OfferingAlternative");
|
|
21
22
|
/**
|
|
22
23
|
* Check if a given object implements the OperationError interface.
|
|
23
24
|
*/
|
|
@@ -34,6 +35,9 @@ function OperationErrorFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
34
35
|
return {
|
|
35
36
|
'code': json['code'] == null ? undefined : json['code'],
|
|
36
37
|
'detail': json['detail'] == null ? undefined : json['detail'],
|
|
38
|
+
'alternatives': json['alternatives'] == null ? undefined : (json['alternatives'].map(OfferingAlternative_1.OfferingAlternativeFromJSON)),
|
|
39
|
+
'currentPricePerHour': json['current_price_per_hour'] == null ? undefined : json['current_price_per_hour'],
|
|
40
|
+
'maxPricePerHour': json['max_price_per_hour'] == null ? undefined : json['max_price_per_hour'],
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
43
|
function OperationErrorToJSON(json) {
|
|
@@ -46,5 +50,8 @@ function OperationErrorToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
46
50
|
return {
|
|
47
51
|
'code': value['code'],
|
|
48
52
|
'detail': value['detail'],
|
|
53
|
+
'alternatives': value['alternatives'] == null ? undefined : (value['alternatives'].map(OfferingAlternative_1.OfferingAlternativeToJSON)),
|
|
54
|
+
'current_price_per_hour': value['currentPricePerHour'],
|
|
55
|
+
'max_price_per_hour': value['maxPricePerHour'],
|
|
49
56
|
};
|
|
50
57
|
}
|
package/dist/models/Problem.d.ts
CHANGED
|
@@ -69,6 +69,9 @@ export declare const ProblemCodeEnum: {
|
|
|
69
69
|
readonly ModelTooLarge: "model_too_large";
|
|
70
70
|
readonly GpuVramTooSmall: "gpu_vram_too_small";
|
|
71
71
|
readonly PriceChanged: "price_changed";
|
|
72
|
+
readonly OfferingUnavailable: "offering_unavailable";
|
|
73
|
+
readonly DedicatedIpLimit: "dedicated_ip_limit";
|
|
74
|
+
readonly DedicatedIpUnavailable: "dedicated_ip_unavailable";
|
|
72
75
|
readonly InsufficientBalance: "insufficient_balance";
|
|
73
76
|
readonly QuotaExceeded: "quota_exceeded";
|
|
74
77
|
readonly RateLimited: "rate_limited";
|
package/dist/models/Problem.js
CHANGED
|
@@ -36,6 +36,9 @@ exports.ProblemCodeEnum = {
|
|
|
36
36
|
ModelTooLarge: 'model_too_large',
|
|
37
37
|
GpuVramTooSmall: 'gpu_vram_too_small',
|
|
38
38
|
PriceChanged: 'price_changed',
|
|
39
|
+
OfferingUnavailable: 'offering_unavailable',
|
|
40
|
+
DedicatedIpLimit: 'dedicated_ip_limit',
|
|
41
|
+
DedicatedIpUnavailable: 'dedicated_ip_unavailable',
|
|
39
42
|
InsufficientBalance: 'insufficient_balance',
|
|
40
43
|
QuotaExceeded: 'quota_exceeded',
|
|
41
44
|
RateLimited: 'rate_limited',
|
package/dist/models/index.d.ts
CHANGED
|
@@ -6,8 +6,17 @@ export * from './Balance';
|
|
|
6
6
|
export * from './BillingDetails';
|
|
7
7
|
export * from './ChatChoice';
|
|
8
8
|
export * from './ChatCompletionRequest';
|
|
9
|
+
export * from './ChatCompletionRequestToolChoice';
|
|
9
10
|
export * from './ChatCompletionResponse';
|
|
11
|
+
export * from './ChatJSONSchemaFormat';
|
|
10
12
|
export * from './ChatMessage';
|
|
13
|
+
export * from './ChatNamedToolChoice';
|
|
14
|
+
export * from './ChatNamedToolChoiceFunction';
|
|
15
|
+
export * from './ChatResponseFormat';
|
|
16
|
+
export * from './ChatTool';
|
|
17
|
+
export * from './ChatToolCall';
|
|
18
|
+
export * from './ChatToolCallFunction';
|
|
19
|
+
export * from './ChatToolFunction';
|
|
11
20
|
export * from './CommunityMachine';
|
|
12
21
|
export * from './CommunityMachineDelistResult';
|
|
13
22
|
export * from './CommunityMachineRegistration';
|
|
@@ -26,6 +35,7 @@ export * from './CreateRegistryCredentialRequest';
|
|
|
26
35
|
export * from './CreateSshKeyRequest';
|
|
27
36
|
export * from './CreateWebhookEndpointRequest';
|
|
28
37
|
export * from './CryptoDeposit';
|
|
38
|
+
export * from './DedicatedIPRequest';
|
|
29
39
|
export * from './Embedding';
|
|
30
40
|
export * from './EmbeddingsRequest';
|
|
31
41
|
export * from './EmbeddingsRequestInput';
|
|
@@ -63,6 +73,7 @@ export * from './ImagesResponseUsage';
|
|
|
63
73
|
export * from './IncludeItem';
|
|
64
74
|
export * from './Instance';
|
|
65
75
|
export * from './InstanceConnection';
|
|
76
|
+
export * from './InstanceDedicatedIP';
|
|
66
77
|
export * from './InstanceGpuMemory';
|
|
67
78
|
export * from './InstancePage';
|
|
68
79
|
export * from './Invoice';
|
|
@@ -77,6 +88,7 @@ export * from './ModelList';
|
|
|
77
88
|
export * from './ModelParametersInner';
|
|
78
89
|
export * from './ModelPricing';
|
|
79
90
|
export * from './ModelRate';
|
|
91
|
+
export * from './OfferingAlternative';
|
|
80
92
|
export * from './OpenAIErrorEnvelope';
|
|
81
93
|
export * from './OpenAIErrorEnvelopeError';
|
|
82
94
|
export * from './Operation';
|
package/dist/models/index.js
CHANGED
|
@@ -24,8 +24,17 @@ __exportStar(require("./Balance"), exports);
|
|
|
24
24
|
__exportStar(require("./BillingDetails"), exports);
|
|
25
25
|
__exportStar(require("./ChatChoice"), exports);
|
|
26
26
|
__exportStar(require("./ChatCompletionRequest"), exports);
|
|
27
|
+
__exportStar(require("./ChatCompletionRequestToolChoice"), exports);
|
|
27
28
|
__exportStar(require("./ChatCompletionResponse"), exports);
|
|
29
|
+
__exportStar(require("./ChatJSONSchemaFormat"), exports);
|
|
28
30
|
__exportStar(require("./ChatMessage"), exports);
|
|
31
|
+
__exportStar(require("./ChatNamedToolChoice"), exports);
|
|
32
|
+
__exportStar(require("./ChatNamedToolChoiceFunction"), exports);
|
|
33
|
+
__exportStar(require("./ChatResponseFormat"), exports);
|
|
34
|
+
__exportStar(require("./ChatTool"), exports);
|
|
35
|
+
__exportStar(require("./ChatToolCall"), exports);
|
|
36
|
+
__exportStar(require("./ChatToolCallFunction"), exports);
|
|
37
|
+
__exportStar(require("./ChatToolFunction"), exports);
|
|
29
38
|
__exportStar(require("./CommunityMachine"), exports);
|
|
30
39
|
__exportStar(require("./CommunityMachineDelistResult"), exports);
|
|
31
40
|
__exportStar(require("./CommunityMachineRegistration"), exports);
|
|
@@ -44,6 +53,7 @@ __exportStar(require("./CreateRegistryCredentialRequest"), exports);
|
|
|
44
53
|
__exportStar(require("./CreateSshKeyRequest"), exports);
|
|
45
54
|
__exportStar(require("./CreateWebhookEndpointRequest"), exports);
|
|
46
55
|
__exportStar(require("./CryptoDeposit"), exports);
|
|
56
|
+
__exportStar(require("./DedicatedIPRequest"), exports);
|
|
47
57
|
__exportStar(require("./Embedding"), exports);
|
|
48
58
|
__exportStar(require("./EmbeddingsRequest"), exports);
|
|
49
59
|
__exportStar(require("./EmbeddingsRequestInput"), exports);
|
|
@@ -81,6 +91,7 @@ __exportStar(require("./ImagesResponseUsage"), exports);
|
|
|
81
91
|
__exportStar(require("./IncludeItem"), exports);
|
|
82
92
|
__exportStar(require("./Instance"), exports);
|
|
83
93
|
__exportStar(require("./InstanceConnection"), exports);
|
|
94
|
+
__exportStar(require("./InstanceDedicatedIP"), exports);
|
|
84
95
|
__exportStar(require("./InstanceGpuMemory"), exports);
|
|
85
96
|
__exportStar(require("./InstancePage"), exports);
|
|
86
97
|
__exportStar(require("./Invoice"), exports);
|
|
@@ -95,6 +106,7 @@ __exportStar(require("./ModelList"), exports);
|
|
|
95
106
|
__exportStar(require("./ModelParametersInner"), exports);
|
|
96
107
|
__exportStar(require("./ModelPricing"), exports);
|
|
97
108
|
__exportStar(require("./ModelRate"), exports);
|
|
109
|
+
__exportStar(require("./OfferingAlternative"), exports);
|
|
98
110
|
__exportStar(require("./OpenAIErrorEnvelope"), exports);
|
|
99
111
|
__exportStar(require("./OpenAIErrorEnvelopeError"), exports);
|
|
100
112
|
__exportStar(require("./Operation"), exports);
|
package/dist/runtime.js
CHANGED
|
@@ -69,7 +69,7 @@ class Configuration {
|
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
71
71
|
get headers() {
|
|
72
|
-
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.
|
|
72
|
+
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.5.1' }, this.configuration.headers);
|
|
73
73
|
}
|
|
74
74
|
get credentials() {
|
|
75
75
|
return this.configuration.credentials;
|
|
@@ -12,6 +12,10 @@ Name | Type
|
|
|
12
12
|
`maxTokens` | number
|
|
13
13
|
`stream` | boolean
|
|
14
14
|
`streamOptions` | [StreamOptions](StreamOptions.md)
|
|
15
|
+
`tools` | [Array<ChatTool>](ChatTool.md)
|
|
16
|
+
`toolChoice` | [ChatCompletionRequestToolChoice](ChatCompletionRequestToolChoice.md)
|
|
17
|
+
`parallelToolCalls` | boolean
|
|
18
|
+
`responseFormat` | [ChatResponseFormat](ChatResponseFormat.md)
|
|
15
19
|
|
|
16
20
|
## Example
|
|
17
21
|
|
|
@@ -26,6 +30,10 @@ const example = {
|
|
|
26
30
|
"maxTokens": null,
|
|
27
31
|
"stream": null,
|
|
28
32
|
"streamOptions": null,
|
|
33
|
+
"tools": null,
|
|
34
|
+
"toolChoice": null,
|
|
35
|
+
"parallelToolCalls": null,
|
|
36
|
+
"responseFormat": null,
|
|
29
37
|
} satisfies ChatCompletionRequest
|
|
30
38
|
|
|
31
39
|
console.log(example)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatCompletionRequestToolChoice
|
|
3
|
+
|
|
4
|
+
\"auto\" (default), \"none\", \"required\", or a named function ({\"type\":\"function\",\"function\":{\"name\":\"...\"}}) that must be defined in tools.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`type` | string
|
|
11
|
+
`_function` | [ChatNamedToolChoiceFunction](ChatNamedToolChoiceFunction.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ChatCompletionRequestToolChoice } from '@gpuai/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"type": null,
|
|
21
|
+
"_function": null,
|
|
22
|
+
} satisfies ChatCompletionRequestToolChoice
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatCompletionRequestToolChoice
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|