@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/dist/esm/runtime.js
CHANGED
|
@@ -61,7 +61,7 @@ export class Configuration {
|
|
|
61
61
|
return undefined;
|
|
62
62
|
}
|
|
63
63
|
get headers() {
|
|
64
|
-
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.
|
|
64
|
+
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.5.1' }, this.configuration.headers);
|
|
65
65
|
}
|
|
66
66
|
get credentials() {
|
|
67
67
|
return this.configuration.credentials;
|
|
@@ -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.
|
|
@@ -18,8 +18,11 @@ exports.ChatCompletionRequestFromJSON = ChatCompletionRequestFromJSON;
|
|
|
18
18
|
exports.ChatCompletionRequestFromJSONTyped = ChatCompletionRequestFromJSONTyped;
|
|
19
19
|
exports.ChatCompletionRequestToJSON = ChatCompletionRequestToJSON;
|
|
20
20
|
exports.ChatCompletionRequestToJSONTyped = ChatCompletionRequestToJSONTyped;
|
|
21
|
+
const ChatCompletionRequestToolChoice_1 = require("./ChatCompletionRequestToolChoice");
|
|
21
22
|
const ChatMessage_1 = require("./ChatMessage");
|
|
22
23
|
const StreamOptions_1 = require("./StreamOptions");
|
|
24
|
+
const ChatTool_1 = require("./ChatTool");
|
|
25
|
+
const ChatResponseFormat_1 = require("./ChatResponseFormat");
|
|
23
26
|
/**
|
|
24
27
|
* Check if a given object implements the ChatCompletionRequest interface.
|
|
25
28
|
*/
|
|
@@ -44,6 +47,10 @@ function ChatCompletionRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
47
|
'maxTokens': json['max_tokens'] == null ? undefined : json['max_tokens'],
|
|
45
48
|
'stream': json['stream'] == null ? undefined : json['stream'],
|
|
46
49
|
'streamOptions': json['stream_options'] == null ? undefined : (0, StreamOptions_1.StreamOptionsFromJSON)(json['stream_options']),
|
|
50
|
+
'tools': json['tools'] == null ? undefined : (json['tools'].map(ChatTool_1.ChatToolFromJSON)),
|
|
51
|
+
'toolChoice': json['tool_choice'] == null ? undefined : (0, ChatCompletionRequestToolChoice_1.ChatCompletionRequestToolChoiceFromJSON)(json['tool_choice']),
|
|
52
|
+
'parallelToolCalls': json['parallel_tool_calls'] == null ? undefined : json['parallel_tool_calls'],
|
|
53
|
+
'responseFormat': json['response_format'] == null ? undefined : (0, ChatResponseFormat_1.ChatResponseFormatFromJSON)(json['response_format']),
|
|
47
54
|
};
|
|
48
55
|
}
|
|
49
56
|
function ChatCompletionRequestToJSON(json) {
|
|
@@ -60,5 +67,9 @@ function ChatCompletionRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
60
67
|
'max_tokens': value['maxTokens'],
|
|
61
68
|
'stream': value['stream'],
|
|
62
69
|
'stream_options': (0, StreamOptions_1.StreamOptionsToJSON)(value['streamOptions']),
|
|
70
|
+
'tools': value['tools'] == null ? undefined : (value['tools'].map(ChatTool_1.ChatToolToJSON)),
|
|
71
|
+
'tool_choice': (0, ChatCompletionRequestToolChoice_1.ChatCompletionRequestToolChoiceToJSON)(value['toolChoice']),
|
|
72
|
+
'parallel_tool_calls': value['parallelToolCalls'],
|
|
73
|
+
'response_format': (0, ChatResponseFormat_1.ChatResponseFormatToJSON)(value['responseFormat']),
|
|
63
74
|
};
|
|
64
75
|
}
|
|
@@ -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,56 @@
|
|
|
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.ChatCompletionRequestToolChoiceFromJSON = ChatCompletionRequestToolChoiceFromJSON;
|
|
17
|
+
exports.ChatCompletionRequestToolChoiceFromJSONTyped = ChatCompletionRequestToolChoiceFromJSONTyped;
|
|
18
|
+
exports.ChatCompletionRequestToolChoiceToJSON = ChatCompletionRequestToolChoiceToJSON;
|
|
19
|
+
exports.ChatCompletionRequestToolChoiceToJSONTyped = ChatCompletionRequestToolChoiceToJSONTyped;
|
|
20
|
+
const ChatNamedToolChoice_1 = require("./ChatNamedToolChoice");
|
|
21
|
+
function ChatCompletionRequestToolChoiceFromJSON(json) {
|
|
22
|
+
return ChatCompletionRequestToolChoiceFromJSONTyped(json, false);
|
|
23
|
+
}
|
|
24
|
+
function ChatCompletionRequestToolChoiceFromJSONTyped(json, ignoreDiscriminator) {
|
|
25
|
+
if (json == null) {
|
|
26
|
+
return json;
|
|
27
|
+
}
|
|
28
|
+
if (typeof json !== 'object') {
|
|
29
|
+
return json;
|
|
30
|
+
}
|
|
31
|
+
if ((0, ChatNamedToolChoice_1.instanceOfChatNamedToolChoice)(json)) {
|
|
32
|
+
return (0, ChatNamedToolChoice_1.ChatNamedToolChoiceFromJSONTyped)(json, true);
|
|
33
|
+
}
|
|
34
|
+
if (typeof json === 'string' && (json === 'none' || json === 'auto' || json === 'required')) {
|
|
35
|
+
return json;
|
|
36
|
+
}
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
function ChatCompletionRequestToolChoiceToJSON(json) {
|
|
40
|
+
return ChatCompletionRequestToolChoiceToJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
function ChatCompletionRequestToolChoiceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
43
|
+
if (value == null) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
if (typeof value !== 'object') {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
if ((0, ChatNamedToolChoice_1.instanceOfChatNamedToolChoice)(value)) {
|
|
50
|
+
return (0, ChatNamedToolChoice_1.ChatNamedToolChoiceToJSON)(value);
|
|
51
|
+
}
|
|
52
|
+
if (typeof value === 'string' && (value === 'none' || value === 'auto' || value === 'required')) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
@@ -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,58 @@
|
|
|
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.instanceOfChatJSONSchemaFormat = instanceOfChatJSONSchemaFormat;
|
|
17
|
+
exports.ChatJSONSchemaFormatFromJSON = ChatJSONSchemaFormatFromJSON;
|
|
18
|
+
exports.ChatJSONSchemaFormatFromJSONTyped = ChatJSONSchemaFormatFromJSONTyped;
|
|
19
|
+
exports.ChatJSONSchemaFormatToJSON = ChatJSONSchemaFormatToJSON;
|
|
20
|
+
exports.ChatJSONSchemaFormatToJSONTyped = ChatJSONSchemaFormatToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the ChatJSONSchemaFormat interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfChatJSONSchemaFormat(value) {
|
|
25
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('schema' in value) || value['schema'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function ChatJSONSchemaFormatFromJSON(json) {
|
|
32
|
+
return ChatJSONSchemaFormatFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
function ChatJSONSchemaFormatFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'name': json['name'],
|
|
40
|
+
'description': json['description'] == null ? undefined : json['description'],
|
|
41
|
+
'schema': json['schema'],
|
|
42
|
+
'strict': json['strict'] == null ? undefined : json['strict'],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function ChatJSONSchemaFormatToJSON(json) {
|
|
46
|
+
return ChatJSONSchemaFormatToJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
function ChatJSONSchemaFormatToJSONTyped(value, ignoreDiscriminator = false) {
|
|
49
|
+
if (value == null) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'name': value['name'],
|
|
54
|
+
'description': value['description'],
|
|
55
|
+
'schema': value['schema'],
|
|
56
|
+
'strict': value['strict'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -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
|
/**
|
|
@@ -19,13 +19,15 @@ exports.ChatMessageFromJSON = ChatMessageFromJSON;
|
|
|
19
19
|
exports.ChatMessageFromJSONTyped = ChatMessageFromJSONTyped;
|
|
20
20
|
exports.ChatMessageToJSON = ChatMessageToJSON;
|
|
21
21
|
exports.ChatMessageToJSONTyped = ChatMessageToJSONTyped;
|
|
22
|
+
const ChatToolCall_1 = require("./ChatToolCall");
|
|
22
23
|
/**
|
|
23
24
|
* @export
|
|
24
25
|
*/
|
|
25
26
|
exports.ChatMessageRoleEnum = {
|
|
26
27
|
System: 'system',
|
|
27
28
|
User: 'user',
|
|
28
|
-
Assistant: 'assistant'
|
|
29
|
+
Assistant: 'assistant',
|
|
30
|
+
Tool: 'tool'
|
|
29
31
|
};
|
|
30
32
|
/**
|
|
31
33
|
* Check if a given object implements the ChatMessage interface.
|
|
@@ -33,8 +35,6 @@ exports.ChatMessageRoleEnum = {
|
|
|
33
35
|
function instanceOfChatMessage(value) {
|
|
34
36
|
if (!('role' in value) || value['role'] === undefined)
|
|
35
37
|
return false;
|
|
36
|
-
if (!('content' in value) || value['content'] === undefined)
|
|
37
|
-
return false;
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
40
|
function ChatMessageFromJSON(json) {
|
|
@@ -46,7 +46,10 @@ function ChatMessageFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
46
46
|
}
|
|
47
47
|
return {
|
|
48
48
|
'role': json['role'],
|
|
49
|
-
'content': json['content'],
|
|
49
|
+
'content': json['content'] === undefined ? undefined : json['content'] === null ? null : json['content'],
|
|
50
|
+
'name': json['name'] == null ? undefined : json['name'],
|
|
51
|
+
'toolCalls': json['tool_calls'] == null ? undefined : (json['tool_calls'].map(ChatToolCall_1.ChatToolCallFromJSON)),
|
|
52
|
+
'toolCallId': json['tool_call_id'] == null ? undefined : json['tool_call_id'],
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
function ChatMessageToJSON(json) {
|
|
@@ -59,5 +62,8 @@ function ChatMessageToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
59
62
|
return {
|
|
60
63
|
'role': value['role'],
|
|
61
64
|
'content': value['content'],
|
|
65
|
+
'name': value['name'],
|
|
66
|
+
'tool_calls': value['toolCalls'] == null ? undefined : (value['toolCalls'].map(ChatToolCall_1.ChatToolCallToJSON)),
|
|
67
|
+
'tool_call_id': value['toolCallId'],
|
|
62
68
|
};
|
|
63
69
|
}
|
|
@@ -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,64 @@
|
|
|
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.ChatNamedToolChoiceTypeEnum = void 0;
|
|
17
|
+
exports.instanceOfChatNamedToolChoice = instanceOfChatNamedToolChoice;
|
|
18
|
+
exports.ChatNamedToolChoiceFromJSON = ChatNamedToolChoiceFromJSON;
|
|
19
|
+
exports.ChatNamedToolChoiceFromJSONTyped = ChatNamedToolChoiceFromJSONTyped;
|
|
20
|
+
exports.ChatNamedToolChoiceToJSON = ChatNamedToolChoiceToJSON;
|
|
21
|
+
exports.ChatNamedToolChoiceToJSONTyped = ChatNamedToolChoiceToJSONTyped;
|
|
22
|
+
const ChatNamedToolChoiceFunction_1 = require("./ChatNamedToolChoiceFunction");
|
|
23
|
+
/**
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.ChatNamedToolChoiceTypeEnum = {
|
|
27
|
+
Function: 'function'
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Check if a given object implements the ChatNamedToolChoice interface.
|
|
31
|
+
*/
|
|
32
|
+
function instanceOfChatNamedToolChoice(value) {
|
|
33
|
+
if (!('type' in value) || value['type'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if (value['type'] !== 'function')
|
|
36
|
+
return false;
|
|
37
|
+
if ((!('_function' in value) && !('function' in value)) || (value['_function'] === undefined && value['function'] === undefined))
|
|
38
|
+
return false;
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
function ChatNamedToolChoiceFromJSON(json) {
|
|
42
|
+
return ChatNamedToolChoiceFromJSONTyped(json, false);
|
|
43
|
+
}
|
|
44
|
+
function ChatNamedToolChoiceFromJSONTyped(json, ignoreDiscriminator) {
|
|
45
|
+
if (json == null) {
|
|
46
|
+
return json;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'type': json['type'],
|
|
50
|
+
'_function': (0, ChatNamedToolChoiceFunction_1.ChatNamedToolChoiceFunctionFromJSON)(json['function']),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function ChatNamedToolChoiceToJSON(json) {
|
|
54
|
+
return ChatNamedToolChoiceToJSONTyped(json, false);
|
|
55
|
+
}
|
|
56
|
+
function ChatNamedToolChoiceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
'type': value['type'],
|
|
62
|
+
'function': (0, ChatNamedToolChoiceFunction_1.ChatNamedToolChoiceFunctionToJSON)(value['_function']),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 ChatNamedToolChoiceFunction
|
|
16
|
+
*/
|
|
17
|
+
export interface ChatNamedToolChoiceFunction {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof ChatNamedToolChoiceFunction
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given object implements the ChatNamedToolChoiceFunction interface.
|
|
27
|
+
*/
|
|
28
|
+
export declare function instanceOfChatNamedToolChoiceFunction(value: object): value is ChatNamedToolChoiceFunction;
|
|
29
|
+
export declare function ChatNamedToolChoiceFunctionFromJSON(json: any): ChatNamedToolChoiceFunction;
|
|
30
|
+
export declare function ChatNamedToolChoiceFunctionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatNamedToolChoiceFunction;
|
|
31
|
+
export declare function ChatNamedToolChoiceFunctionToJSON(json: any): ChatNamedToolChoiceFunction;
|
|
32
|
+
export declare function ChatNamedToolChoiceFunctionToJSONTyped(value?: ChatNamedToolChoiceFunction | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,50 @@
|
|
|
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.instanceOfChatNamedToolChoiceFunction = instanceOfChatNamedToolChoiceFunction;
|
|
17
|
+
exports.ChatNamedToolChoiceFunctionFromJSON = ChatNamedToolChoiceFunctionFromJSON;
|
|
18
|
+
exports.ChatNamedToolChoiceFunctionFromJSONTyped = ChatNamedToolChoiceFunctionFromJSONTyped;
|
|
19
|
+
exports.ChatNamedToolChoiceFunctionToJSON = ChatNamedToolChoiceFunctionToJSON;
|
|
20
|
+
exports.ChatNamedToolChoiceFunctionToJSONTyped = ChatNamedToolChoiceFunctionToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the ChatNamedToolChoiceFunction interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfChatNamedToolChoiceFunction(value) {
|
|
25
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
function ChatNamedToolChoiceFunctionFromJSON(json) {
|
|
30
|
+
return ChatNamedToolChoiceFunctionFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
function ChatNamedToolChoiceFunctionFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'name': json['name'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function ChatNamedToolChoiceFunctionToJSON(json) {
|
|
41
|
+
return ChatNamedToolChoiceFunctionToJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
function ChatNamedToolChoiceFunctionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'name': value['name'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { ChatJSONSchemaFormat } from './ChatJSONSchemaFormat';
|
|
13
|
+
/**
|
|
14
|
+
* Structured outputs. {"type":"json_object"} (JSON mode) or {"type":"json_schema","json_schema":{...}}; "text" is the default. Only models whose /v1/models entry has supports_structured_outputs: true accept json_object / json_schema.
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ChatResponseFormat
|
|
17
|
+
*/
|
|
18
|
+
export interface ChatResponseFormat {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {ChatResponseFormatTypeEnum}
|
|
22
|
+
* @memberof ChatResponseFormat
|
|
23
|
+
*/
|
|
24
|
+
type: ChatResponseFormatTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {ChatJSONSchemaFormat}
|
|
28
|
+
* @memberof ChatResponseFormat
|
|
29
|
+
*/
|
|
30
|
+
jsonSchema?: ChatJSONSchemaFormat;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const ChatResponseFormatTypeEnum: {
|
|
36
|
+
readonly Text: "text";
|
|
37
|
+
readonly JsonObject: "json_object";
|
|
38
|
+
readonly JsonSchema: "json_schema";
|
|
39
|
+
};
|
|
40
|
+
export type ChatResponseFormatTypeEnum = typeof ChatResponseFormatTypeEnum[keyof typeof ChatResponseFormatTypeEnum];
|
|
41
|
+
/**
|
|
42
|
+
* Check if a given object implements the ChatResponseFormat interface.
|
|
43
|
+
*/
|
|
44
|
+
export declare function instanceOfChatResponseFormat(value: object): value is ChatResponseFormat;
|
|
45
|
+
export declare function ChatResponseFormatFromJSON(json: any): ChatResponseFormat;
|
|
46
|
+
export declare function ChatResponseFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatResponseFormat;
|
|
47
|
+
export declare function ChatResponseFormatToJSON(json: any): ChatResponseFormat;
|
|
48
|
+
export declare function ChatResponseFormatToJSONTyped(value?: ChatResponseFormat | null, ignoreDiscriminator?: boolean): any;
|