@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
package/.openapi-generator/FILES
CHANGED
|
@@ -11,8 +11,17 @@ docs/BillingApi.md
|
|
|
11
11
|
docs/BillingDetails.md
|
|
12
12
|
docs/ChatChoice.md
|
|
13
13
|
docs/ChatCompletionRequest.md
|
|
14
|
+
docs/ChatCompletionRequestToolChoice.md
|
|
14
15
|
docs/ChatCompletionResponse.md
|
|
16
|
+
docs/ChatJSONSchemaFormat.md
|
|
15
17
|
docs/ChatMessage.md
|
|
18
|
+
docs/ChatNamedToolChoice.md
|
|
19
|
+
docs/ChatNamedToolChoiceFunction.md
|
|
20
|
+
docs/ChatResponseFormat.md
|
|
21
|
+
docs/ChatTool.md
|
|
22
|
+
docs/ChatToolCall.md
|
|
23
|
+
docs/ChatToolCallFunction.md
|
|
24
|
+
docs/ChatToolFunction.md
|
|
16
25
|
docs/CommunityApi.md
|
|
17
26
|
docs/CommunityMachine.md
|
|
18
27
|
docs/CommunityMachineDelistResult.md
|
|
@@ -32,6 +41,7 @@ docs/CreateRegistryCredentialRequest.md
|
|
|
32
41
|
docs/CreateSshKeyRequest.md
|
|
33
42
|
docs/CreateWebhookEndpointRequest.md
|
|
34
43
|
docs/CryptoDeposit.md
|
|
44
|
+
docs/DedicatedIPRequest.md
|
|
35
45
|
docs/Embedding.md
|
|
36
46
|
docs/EmbeddingsRequest.md
|
|
37
47
|
docs/EmbeddingsRequestInput.md
|
|
@@ -74,6 +84,7 @@ docs/IncludeItem.md
|
|
|
74
84
|
docs/InferenceApi.md
|
|
75
85
|
docs/Instance.md
|
|
76
86
|
docs/InstanceConnection.md
|
|
87
|
+
docs/InstanceDedicatedIP.md
|
|
77
88
|
docs/InstanceGpuMemory.md
|
|
78
89
|
docs/InstancePage.md
|
|
79
90
|
docs/InstancesApi.md
|
|
@@ -91,6 +102,7 @@ docs/ModelList.md
|
|
|
91
102
|
docs/ModelParametersInner.md
|
|
92
103
|
docs/ModelPricing.md
|
|
93
104
|
docs/ModelRate.md
|
|
105
|
+
docs/OfferingAlternative.md
|
|
94
106
|
docs/OpenAIErrorEnvelope.md
|
|
95
107
|
docs/OpenAIErrorEnvelopeError.md
|
|
96
108
|
docs/Operation.md
|
|
@@ -165,8 +177,17 @@ src/models/Balance.ts
|
|
|
165
177
|
src/models/BillingDetails.ts
|
|
166
178
|
src/models/ChatChoice.ts
|
|
167
179
|
src/models/ChatCompletionRequest.ts
|
|
180
|
+
src/models/ChatCompletionRequestToolChoice.ts
|
|
168
181
|
src/models/ChatCompletionResponse.ts
|
|
182
|
+
src/models/ChatJSONSchemaFormat.ts
|
|
169
183
|
src/models/ChatMessage.ts
|
|
184
|
+
src/models/ChatNamedToolChoice.ts
|
|
185
|
+
src/models/ChatNamedToolChoiceFunction.ts
|
|
186
|
+
src/models/ChatResponseFormat.ts
|
|
187
|
+
src/models/ChatTool.ts
|
|
188
|
+
src/models/ChatToolCall.ts
|
|
189
|
+
src/models/ChatToolCallFunction.ts
|
|
190
|
+
src/models/ChatToolFunction.ts
|
|
170
191
|
src/models/CommunityMachine.ts
|
|
171
192
|
src/models/CommunityMachineDelistResult.ts
|
|
172
193
|
src/models/CommunityMachineRegistration.ts
|
|
@@ -185,6 +206,7 @@ src/models/CreateRegistryCredentialRequest.ts
|
|
|
185
206
|
src/models/CreateSshKeyRequest.ts
|
|
186
207
|
src/models/CreateWebhookEndpointRequest.ts
|
|
187
208
|
src/models/CryptoDeposit.ts
|
|
209
|
+
src/models/DedicatedIPRequest.ts
|
|
188
210
|
src/models/Embedding.ts
|
|
189
211
|
src/models/EmbeddingsRequest.ts
|
|
190
212
|
src/models/EmbeddingsRequestInput.ts
|
|
@@ -222,6 +244,7 @@ src/models/ImagesResponseUsage.ts
|
|
|
222
244
|
src/models/IncludeItem.ts
|
|
223
245
|
src/models/Instance.ts
|
|
224
246
|
src/models/InstanceConnection.ts
|
|
247
|
+
src/models/InstanceDedicatedIP.ts
|
|
225
248
|
src/models/InstanceGpuMemory.ts
|
|
226
249
|
src/models/InstancePage.ts
|
|
227
250
|
src/models/Invoice.ts
|
|
@@ -236,6 +259,7 @@ src/models/ModelList.ts
|
|
|
236
259
|
src/models/ModelParametersInner.ts
|
|
237
260
|
src/models/ModelPricing.ts
|
|
238
261
|
src/models/ModelRate.ts
|
|
262
|
+
src/models/OfferingAlternative.ts
|
|
239
263
|
src/models/OpenAIErrorEnvelope.ts
|
|
240
264
|
src/models/OpenAIErrorEnvelopeError.ts
|
|
241
265
|
src/models/Operation.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @gpuai/sdk@0.
|
|
1
|
+
# @gpuai/sdk@0.5.1
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the api.gpu.ai API.
|
|
4
4
|
|
|
@@ -149,8 +149,17 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
149
149
|
- [BillingDetails](docs/BillingDetails.md)
|
|
150
150
|
- [ChatChoice](docs/ChatChoice.md)
|
|
151
151
|
- [ChatCompletionRequest](docs/ChatCompletionRequest.md)
|
|
152
|
+
- [ChatCompletionRequestToolChoice](docs/ChatCompletionRequestToolChoice.md)
|
|
152
153
|
- [ChatCompletionResponse](docs/ChatCompletionResponse.md)
|
|
154
|
+
- [ChatJSONSchemaFormat](docs/ChatJSONSchemaFormat.md)
|
|
153
155
|
- [ChatMessage](docs/ChatMessage.md)
|
|
156
|
+
- [ChatNamedToolChoice](docs/ChatNamedToolChoice.md)
|
|
157
|
+
- [ChatNamedToolChoiceFunction](docs/ChatNamedToolChoiceFunction.md)
|
|
158
|
+
- [ChatResponseFormat](docs/ChatResponseFormat.md)
|
|
159
|
+
- [ChatTool](docs/ChatTool.md)
|
|
160
|
+
- [ChatToolCall](docs/ChatToolCall.md)
|
|
161
|
+
- [ChatToolCallFunction](docs/ChatToolCallFunction.md)
|
|
162
|
+
- [ChatToolFunction](docs/ChatToolFunction.md)
|
|
154
163
|
- [CommunityMachine](docs/CommunityMachine.md)
|
|
155
164
|
- [CommunityMachineDelistResult](docs/CommunityMachineDelistResult.md)
|
|
156
165
|
- [CommunityMachineRegistration](docs/CommunityMachineRegistration.md)
|
|
@@ -169,6 +178,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
169
178
|
- [CreateSshKeyRequest](docs/CreateSshKeyRequest.md)
|
|
170
179
|
- [CreateWebhookEndpointRequest](docs/CreateWebhookEndpointRequest.md)
|
|
171
180
|
- [CryptoDeposit](docs/CryptoDeposit.md)
|
|
181
|
+
- [DedicatedIPRequest](docs/DedicatedIPRequest.md)
|
|
172
182
|
- [Embedding](docs/Embedding.md)
|
|
173
183
|
- [EmbeddingsRequest](docs/EmbeddingsRequest.md)
|
|
174
184
|
- [EmbeddingsRequestInput](docs/EmbeddingsRequestInput.md)
|
|
@@ -206,6 +216,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
206
216
|
- [IncludeItem](docs/IncludeItem.md)
|
|
207
217
|
- [Instance](docs/Instance.md)
|
|
208
218
|
- [InstanceConnection](docs/InstanceConnection.md)
|
|
219
|
+
- [InstanceDedicatedIP](docs/InstanceDedicatedIP.md)
|
|
209
220
|
- [InstanceGpuMemory](docs/InstanceGpuMemory.md)
|
|
210
221
|
- [InstancePage](docs/InstancePage.md)
|
|
211
222
|
- [Invoice](docs/Invoice.md)
|
|
@@ -220,6 +231,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
220
231
|
- [ModelParametersInner](docs/ModelParametersInner.md)
|
|
221
232
|
- [ModelPricing](docs/ModelPricing.md)
|
|
222
233
|
- [ModelRate](docs/ModelRate.md)
|
|
234
|
+
- [OfferingAlternative](docs/OfferingAlternative.md)
|
|
223
235
|
- [OpenAIErrorEnvelope](docs/OpenAIErrorEnvelope.md)
|
|
224
236
|
- [OpenAIErrorEnvelopeError](docs/OpenAIErrorEnvelopeError.md)
|
|
225
237
|
- [Operation](docs/Operation.md)
|
|
@@ -274,7 +286,7 @@ and is automatically generated by the
|
|
|
274
286
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
275
287
|
|
|
276
288
|
- API version: `1.0.0`
|
|
277
|
-
- Package version: `0.
|
|
289
|
+
- Package version: `0.5.1`
|
|
278
290
|
- Generator version: `7.24.0`
|
|
279
291
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
280
292
|
|
|
@@ -50,10 +50,12 @@ export declare class InstancesApi extends runtime.BaseAPI {
|
|
|
50
50
|
*/
|
|
51
51
|
createInstanceRequestOpts(requestParameters: CreateInstanceOperationRequest): Promise<runtime.RequestOpts>;
|
|
52
52
|
/**
|
|
53
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
53
54
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
54
55
|
*/
|
|
55
56
|
createInstanceRaw(requestParameters: CreateInstanceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Operation>>;
|
|
56
57
|
/**
|
|
58
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
57
59
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
58
60
|
*/
|
|
59
61
|
createInstance(requestParameters: CreateInstanceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Operation>;
|
|
@@ -66,6 +66,7 @@ class InstancesApi extends runtime.BaseAPI {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
69
70
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
70
71
|
*/
|
|
71
72
|
createInstanceRaw(requestParameters, initOverrides) {
|
|
@@ -76,6 +77,7 @@ class InstancesApi extends runtime.BaseAPI {
|
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
79
|
/**
|
|
80
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
79
81
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
80
82
|
*/
|
|
81
83
|
createInstance(requestParameters, initOverrides) {
|
|
@@ -50,10 +50,12 @@ export declare class InstancesApi extends runtime.BaseAPI {
|
|
|
50
50
|
*/
|
|
51
51
|
createInstanceRequestOpts(requestParameters: CreateInstanceOperationRequest): Promise<runtime.RequestOpts>;
|
|
52
52
|
/**
|
|
53
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
53
54
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
54
55
|
*/
|
|
55
56
|
createInstanceRaw(requestParameters: CreateInstanceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Operation>>;
|
|
56
57
|
/**
|
|
58
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
57
59
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
58
60
|
*/
|
|
59
61
|
createInstance(requestParameters: CreateInstanceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Operation>;
|
|
@@ -63,6 +63,7 @@ export class InstancesApi extends runtime.BaseAPI {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
66
67
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
67
68
|
*/
|
|
68
69
|
createInstanceRaw(requestParameters, initOverrides) {
|
|
@@ -73,6 +74,7 @@ export class InstancesApi extends runtime.BaseAPI {
|
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
76
|
/**
|
|
77
|
+
* Running a one-off script or batch work? Submit it as a job instead (POST /jobs): the machine is started for it and shut down a few minutes after it finishes, so nothing bills after the work is done.
|
|
76
78
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
77
79
|
*/
|
|
78
80
|
createInstance(requestParameters, initOverrides) {
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { ChatCompletionRequestToolChoice } from './ChatCompletionRequestToolChoice';
|
|
12
13
|
import type { ChatMessage } from './ChatMessage';
|
|
13
14
|
import type { StreamOptions } from './StreamOptions';
|
|
15
|
+
import type { ChatTool } from './ChatTool';
|
|
16
|
+
import type { ChatResponseFormat } from './ChatResponseFormat';
|
|
14
17
|
/**
|
|
15
18
|
*
|
|
16
19
|
* @export
|
|
@@ -53,6 +56,30 @@ export interface ChatCompletionRequest {
|
|
|
53
56
|
* @memberof ChatCompletionRequest
|
|
54
57
|
*/
|
|
55
58
|
streamOptions?: StreamOptions;
|
|
59
|
+
/**
|
|
60
|
+
* Functions the model may call (OpenAI shape). Only models whose /v1/models entry has supports_tools: true accept it; any other model returns 400 unsupported_parameter (param "tools").
|
|
61
|
+
* @type {Array<ChatTool>}
|
|
62
|
+
* @memberof ChatCompletionRequest
|
|
63
|
+
*/
|
|
64
|
+
tools?: Array<ChatTool>;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @type {ChatCompletionRequestToolChoice}
|
|
68
|
+
* @memberof ChatCompletionRequest
|
|
69
|
+
*/
|
|
70
|
+
toolChoice?: ChatCompletionRequestToolChoice;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the model may call several tools in one turn. Passed through.
|
|
73
|
+
* @type {boolean}
|
|
74
|
+
* @memberof ChatCompletionRequest
|
|
75
|
+
*/
|
|
76
|
+
parallelToolCalls?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @type {ChatResponseFormat}
|
|
80
|
+
* @memberof ChatCompletionRequest
|
|
81
|
+
*/
|
|
82
|
+
responseFormat?: ChatResponseFormat;
|
|
56
83
|
}
|
|
57
84
|
/**
|
|
58
85
|
* Check if a given object implements the ChatCompletionRequest interface.
|
|
@@ -11,8 +11,11 @@
|
|
|
11
11
|
* https://openapi-generator.tech
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
|
+
import { ChatCompletionRequestToolChoiceFromJSON, ChatCompletionRequestToolChoiceToJSON, } from './ChatCompletionRequestToolChoice';
|
|
14
15
|
import { ChatMessageFromJSON, ChatMessageToJSON, } from './ChatMessage';
|
|
15
16
|
import { StreamOptionsFromJSON, StreamOptionsToJSON, } from './StreamOptions';
|
|
17
|
+
import { ChatToolFromJSON, ChatToolToJSON, } from './ChatTool';
|
|
18
|
+
import { ChatResponseFormatFromJSON, ChatResponseFormatToJSON, } from './ChatResponseFormat';
|
|
16
19
|
/**
|
|
17
20
|
* Check if a given object implements the ChatCompletionRequest interface.
|
|
18
21
|
*/
|
|
@@ -37,6 +40,10 @@ export function ChatCompletionRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
37
40
|
'maxTokens': json['max_tokens'] == null ? undefined : json['max_tokens'],
|
|
38
41
|
'stream': json['stream'] == null ? undefined : json['stream'],
|
|
39
42
|
'streamOptions': json['stream_options'] == null ? undefined : StreamOptionsFromJSON(json['stream_options']),
|
|
43
|
+
'tools': json['tools'] == null ? undefined : (json['tools'].map(ChatToolFromJSON)),
|
|
44
|
+
'toolChoice': json['tool_choice'] == null ? undefined : ChatCompletionRequestToolChoiceFromJSON(json['tool_choice']),
|
|
45
|
+
'parallelToolCalls': json['parallel_tool_calls'] == null ? undefined : json['parallel_tool_calls'],
|
|
46
|
+
'responseFormat': json['response_format'] == null ? undefined : ChatResponseFormatFromJSON(json['response_format']),
|
|
40
47
|
};
|
|
41
48
|
}
|
|
42
49
|
export function ChatCompletionRequestToJSON(json) {
|
|
@@ -53,5 +60,9 @@ export function ChatCompletionRequestToJSONTyped(value, ignoreDiscriminator = fa
|
|
|
53
60
|
'max_tokens': value['maxTokens'],
|
|
54
61
|
'stream': value['stream'],
|
|
55
62
|
'stream_options': StreamOptionsToJSON(value['streamOptions']),
|
|
63
|
+
'tools': value['tools'] == null ? undefined : (value['tools'].map(ChatToolToJSON)),
|
|
64
|
+
'tool_choice': ChatCompletionRequestToolChoiceToJSON(value['toolChoice']),
|
|
65
|
+
'parallel_tool_calls': value['parallelToolCalls'],
|
|
66
|
+
'response_format': ChatResponseFormatToJSON(value['responseFormat']),
|
|
56
67
|
};
|
|
57
68
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import type { ChatNamedToolChoice } from './ChatNamedToolChoice';
|
|
13
|
+
/**
|
|
14
|
+
* @type ChatCompletionRequestToolChoice
|
|
15
|
+
* "auto" (default), "none", "required", or a named function ({"type":"function","function":{"name":"..."}}) that must be defined in tools.
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export type ChatCompletionRequestToolChoice = ChatNamedToolChoice | string;
|
|
19
|
+
export declare function ChatCompletionRequestToolChoiceFromJSON(json: any): ChatCompletionRequestToolChoice;
|
|
20
|
+
export declare function ChatCompletionRequestToolChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatCompletionRequestToolChoice;
|
|
21
|
+
export declare function ChatCompletionRequestToolChoiceToJSON(json: any): any;
|
|
22
|
+
export declare function ChatCompletionRequestToolChoiceToJSONTyped(value?: ChatCompletionRequestToolChoice | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
import { instanceOfChatNamedToolChoice, ChatNamedToolChoiceFromJSONTyped, ChatNamedToolChoiceToJSON, } from './ChatNamedToolChoice';
|
|
15
|
+
export function ChatCompletionRequestToolChoiceFromJSON(json) {
|
|
16
|
+
return ChatCompletionRequestToolChoiceFromJSONTyped(json, false);
|
|
17
|
+
}
|
|
18
|
+
export function ChatCompletionRequestToolChoiceFromJSONTyped(json, ignoreDiscriminator) {
|
|
19
|
+
if (json == null) {
|
|
20
|
+
return json;
|
|
21
|
+
}
|
|
22
|
+
if (typeof json !== 'object') {
|
|
23
|
+
return json;
|
|
24
|
+
}
|
|
25
|
+
if (instanceOfChatNamedToolChoice(json)) {
|
|
26
|
+
return ChatNamedToolChoiceFromJSONTyped(json, true);
|
|
27
|
+
}
|
|
28
|
+
if (typeof json === 'string' && (json === 'none' || json === 'auto' || json === 'required')) {
|
|
29
|
+
return json;
|
|
30
|
+
}
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
export function ChatCompletionRequestToolChoiceToJSON(json) {
|
|
34
|
+
return ChatCompletionRequestToolChoiceToJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
export function ChatCompletionRequestToolChoiceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
37
|
+
if (value == null) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
if (typeof value !== 'object') {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
if (instanceOfChatNamedToolChoice(value)) {
|
|
44
|
+
return ChatNamedToolChoiceToJSON(value);
|
|
45
|
+
}
|
|
46
|
+
if (typeof value === 'string' && (value === 'none' || value === 'auto' || value === 'required')) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ChatJSONSchemaFormat
|
|
16
|
+
*/
|
|
17
|
+
export interface ChatJSONSchemaFormat {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof ChatJSONSchemaFormat
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof ChatJSONSchemaFormat
|
|
28
|
+
*/
|
|
29
|
+
description?: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {{ [key: string]: any; }}
|
|
33
|
+
* @memberof ChatJSONSchemaFormat
|
|
34
|
+
*/
|
|
35
|
+
schema: {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
* @memberof ChatJSONSchemaFormat
|
|
42
|
+
*/
|
|
43
|
+
strict?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if a given object implements the ChatJSONSchemaFormat interface.
|
|
47
|
+
*/
|
|
48
|
+
export declare function instanceOfChatJSONSchemaFormat(value: object): value is ChatJSONSchemaFormat;
|
|
49
|
+
export declare function ChatJSONSchemaFormatFromJSON(json: any): ChatJSONSchemaFormat;
|
|
50
|
+
export declare function ChatJSONSchemaFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatJSONSchemaFormat;
|
|
51
|
+
export declare function ChatJSONSchemaFormatToJSON(json: any): ChatJSONSchemaFormat;
|
|
52
|
+
export declare function ChatJSONSchemaFormatToJSONTyped(value?: ChatJSONSchemaFormat | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
* Check if a given object implements the ChatJSONSchemaFormat interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfChatJSONSchemaFormat(value) {
|
|
18
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
19
|
+
return false;
|
|
20
|
+
if (!('schema' in value) || value['schema'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
export function ChatJSONSchemaFormatFromJSON(json) {
|
|
25
|
+
return ChatJSONSchemaFormatFromJSONTyped(json, false);
|
|
26
|
+
}
|
|
27
|
+
export function ChatJSONSchemaFormatFromJSONTyped(json, ignoreDiscriminator) {
|
|
28
|
+
if (json == null) {
|
|
29
|
+
return json;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
'name': json['name'],
|
|
33
|
+
'description': json['description'] == null ? undefined : json['description'],
|
|
34
|
+
'schema': json['schema'],
|
|
35
|
+
'strict': json['strict'] == null ? undefined : json['strict'],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function ChatJSONSchemaFormatToJSON(json) {
|
|
39
|
+
return ChatJSONSchemaFormatToJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
export function ChatJSONSchemaFormatToJSONTyped(value, ignoreDiscriminator = false) {
|
|
42
|
+
if (value == null) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
'name': value['name'],
|
|
47
|
+
'description': value['description'],
|
|
48
|
+
'schema': value['schema'],
|
|
49
|
+
'strict': value['strict'],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { ChatToolCall } from './ChatToolCall';
|
|
12
13
|
/**
|
|
13
14
|
*
|
|
14
15
|
* @export
|
|
@@ -21,12 +22,30 @@ export interface ChatMessage {
|
|
|
21
22
|
* @memberof ChatMessage
|
|
22
23
|
*/
|
|
23
24
|
role: ChatMessageRoleEnum;
|
|
25
|
+
/**
|
|
26
|
+
* Message text. null on an assistant message that only calls tools. Requests may also send an array of content parts, passed through unchanged.
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof ChatMessage
|
|
29
|
+
*/
|
|
30
|
+
content?: string | null;
|
|
24
31
|
/**
|
|
25
32
|
*
|
|
26
33
|
* @type {string}
|
|
27
34
|
* @memberof ChatMessage
|
|
28
35
|
*/
|
|
29
|
-
|
|
36
|
+
name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Tool calls made by the assistant (assistant messages only).
|
|
39
|
+
* @type {Array<ChatToolCall>}
|
|
40
|
+
* @memberof ChatMessage
|
|
41
|
+
*/
|
|
42
|
+
toolCalls?: Array<ChatToolCall>;
|
|
43
|
+
/**
|
|
44
|
+
* The tool call this message answers (required on role "tool").
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @memberof ChatMessage
|
|
47
|
+
*/
|
|
48
|
+
toolCallId?: string;
|
|
30
49
|
}
|
|
31
50
|
/**
|
|
32
51
|
* @export
|
|
@@ -35,6 +54,7 @@ export declare const ChatMessageRoleEnum: {
|
|
|
35
54
|
readonly System: "system";
|
|
36
55
|
readonly User: "user";
|
|
37
56
|
readonly Assistant: "assistant";
|
|
57
|
+
readonly Tool: "tool";
|
|
38
58
|
};
|
|
39
59
|
export type ChatMessageRoleEnum = typeof ChatMessageRoleEnum[keyof typeof ChatMessageRoleEnum];
|
|
40
60
|
/**
|
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
* https://openapi-generator.tech
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
|
+
import { ChatToolCallFromJSON, ChatToolCallToJSON, } from './ChatToolCall';
|
|
14
15
|
/**
|
|
15
16
|
* @export
|
|
16
17
|
*/
|
|
17
18
|
export const ChatMessageRoleEnum = {
|
|
18
19
|
System: 'system',
|
|
19
20
|
User: 'user',
|
|
20
|
-
Assistant: 'assistant'
|
|
21
|
+
Assistant: 'assistant',
|
|
22
|
+
Tool: 'tool'
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* Check if a given object implements the ChatMessage interface.
|
|
@@ -25,8 +27,6 @@ export const ChatMessageRoleEnum = {
|
|
|
25
27
|
export function instanceOfChatMessage(value) {
|
|
26
28
|
if (!('role' in value) || value['role'] === undefined)
|
|
27
29
|
return false;
|
|
28
|
-
if (!('content' in value) || value['content'] === undefined)
|
|
29
|
-
return false;
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
32
|
export function ChatMessageFromJSON(json) {
|
|
@@ -38,7 +38,10 @@ export function ChatMessageFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
38
38
|
}
|
|
39
39
|
return {
|
|
40
40
|
'role': json['role'],
|
|
41
|
-
'content': json['content'],
|
|
41
|
+
'content': json['content'] === undefined ? undefined : json['content'] === null ? null : json['content'],
|
|
42
|
+
'name': json['name'] == null ? undefined : json['name'],
|
|
43
|
+
'toolCalls': json['tool_calls'] == null ? undefined : (json['tool_calls'].map(ChatToolCallFromJSON)),
|
|
44
|
+
'toolCallId': json['tool_call_id'] == null ? undefined : json['tool_call_id'],
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
47
|
export function ChatMessageToJSON(json) {
|
|
@@ -51,5 +54,8 @@ export function ChatMessageToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
51
54
|
return {
|
|
52
55
|
'role': value['role'],
|
|
53
56
|
'content': value['content'],
|
|
57
|
+
'name': value['name'],
|
|
58
|
+
'tool_calls': value['toolCalls'] == null ? undefined : (value['toolCalls'].map(ChatToolCallToJSON)),
|
|
59
|
+
'tool_call_id': value['toolCallId'],
|
|
54
60
|
};
|
|
55
61
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
import type { ChatNamedToolChoiceFunction } from './ChatNamedToolChoiceFunction';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ChatNamedToolChoice
|
|
17
|
+
*/
|
|
18
|
+
export interface ChatNamedToolChoice {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {ChatNamedToolChoiceTypeEnum}
|
|
22
|
+
* @memberof ChatNamedToolChoice
|
|
23
|
+
*/
|
|
24
|
+
type: ChatNamedToolChoiceTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {ChatNamedToolChoiceFunction}
|
|
28
|
+
* @memberof ChatNamedToolChoice
|
|
29
|
+
*/
|
|
30
|
+
_function: ChatNamedToolChoiceFunction;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const ChatNamedToolChoiceTypeEnum: {
|
|
36
|
+
readonly Function: "function";
|
|
37
|
+
};
|
|
38
|
+
export type ChatNamedToolChoiceTypeEnum = typeof ChatNamedToolChoiceTypeEnum[keyof typeof ChatNamedToolChoiceTypeEnum];
|
|
39
|
+
/**
|
|
40
|
+
* Check if a given object implements the ChatNamedToolChoice interface.
|
|
41
|
+
*/
|
|
42
|
+
export declare function instanceOfChatNamedToolChoice(value: object): value is ChatNamedToolChoice;
|
|
43
|
+
export declare function ChatNamedToolChoiceFromJSON(json: any): ChatNamedToolChoice;
|
|
44
|
+
export declare function ChatNamedToolChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatNamedToolChoice;
|
|
45
|
+
export declare function ChatNamedToolChoiceToJSON(json: any): ChatNamedToolChoice;
|
|
46
|
+
export declare function ChatNamedToolChoiceToJSONTyped(value?: ChatNamedToolChoice | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
import { ChatNamedToolChoiceFunctionFromJSON, ChatNamedToolChoiceFunctionToJSON, } from './ChatNamedToolChoiceFunction';
|
|
15
|
+
/**
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const ChatNamedToolChoiceTypeEnum = {
|
|
19
|
+
Function: 'function'
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the ChatNamedToolChoice interface.
|
|
23
|
+
*/
|
|
24
|
+
export function instanceOfChatNamedToolChoice(value) {
|
|
25
|
+
if (!('type' in value) || value['type'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (value['type'] !== 'function')
|
|
28
|
+
return false;
|
|
29
|
+
if ((!('_function' in value) && !('function' in value)) || (value['_function'] === undefined && value['function'] === undefined))
|
|
30
|
+
return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
export function ChatNamedToolChoiceFromJSON(json) {
|
|
34
|
+
return ChatNamedToolChoiceFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
export function ChatNamedToolChoiceFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
if (json == null) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'type': json['type'],
|
|
42
|
+
'_function': ChatNamedToolChoiceFunctionFromJSON(json['function']),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function ChatNamedToolChoiceToJSON(json) {
|
|
46
|
+
return ChatNamedToolChoiceToJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
export function ChatNamedToolChoiceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
49
|
+
if (value == null) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'type': value['type'],
|
|
54
|
+
'function': ChatNamedToolChoiceFunctionToJSON(value['_function']),
|
|
55
|
+
};
|
|
56
|
+
}
|