@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.
Files changed (142) hide show
  1. package/.openapi-generator/FILES +24 -0
  2. package/README.md +14 -2
  3. package/dist/apis/InstancesApi.d.ts +2 -0
  4. package/dist/apis/InstancesApi.js +2 -0
  5. package/dist/esm/apis/InstancesApi.d.ts +2 -0
  6. package/dist/esm/apis/InstancesApi.js +2 -0
  7. package/dist/esm/models/ChatCompletionRequest.d.ts +27 -0
  8. package/dist/esm/models/ChatCompletionRequest.js +11 -0
  9. package/dist/esm/models/ChatCompletionRequestToolChoice.d.ts +22 -0
  10. package/dist/esm/models/ChatCompletionRequestToolChoice.js +50 -0
  11. package/dist/esm/models/ChatJSONSchemaFormat.d.ts +52 -0
  12. package/dist/esm/models/ChatJSONSchemaFormat.js +51 -0
  13. package/dist/esm/models/ChatMessage.d.ts +21 -1
  14. package/dist/esm/models/ChatMessage.js +10 -4
  15. package/dist/esm/models/ChatNamedToolChoice.d.ts +46 -0
  16. package/dist/esm/models/ChatNamedToolChoice.js +56 -0
  17. package/dist/esm/models/ChatNamedToolChoiceFunction.d.ts +32 -0
  18. package/dist/esm/models/ChatNamedToolChoiceFunction.js +43 -0
  19. package/dist/esm/models/ChatResponseFormat.d.ts +48 -0
  20. package/dist/esm/models/ChatResponseFormat.js +54 -0
  21. package/dist/esm/models/ChatTool.d.ts +46 -0
  22. package/dist/esm/models/ChatTool.js +56 -0
  23. package/dist/esm/models/ChatToolCall.d.ts +52 -0
  24. package/dist/esm/models/ChatToolCall.js +60 -0
  25. package/dist/esm/models/ChatToolCallFunction.d.ts +38 -0
  26. package/dist/esm/models/ChatToolCallFunction.js +47 -0
  27. package/dist/esm/models/ChatToolFunction.d.ts +52 -0
  28. package/dist/esm/models/ChatToolFunction.js +49 -0
  29. package/dist/esm/models/CreateFunctionVersionRequest.d.ts +6 -0
  30. package/dist/esm/models/CreateFunctionVersionRequest.js +2 -0
  31. package/dist/esm/models/CreateInstanceRequest.d.ts +13 -0
  32. package/dist/esm/models/CreateInstanceRequest.js +5 -0
  33. package/dist/esm/models/DedicatedIPRequest.d.ts +32 -0
  34. package/dist/esm/models/DedicatedIPRequest.js +41 -0
  35. package/dist/esm/models/FunctionVersion.d.ts +6 -0
  36. package/dist/esm/models/FunctionVersion.js +4 -0
  37. package/dist/esm/models/Instance.d.ts +7 -0
  38. package/dist/esm/models/Instance.js +3 -0
  39. package/dist/esm/models/InstanceDedicatedIP.d.ts +83 -0
  40. package/dist/esm/models/InstanceDedicatedIP.js +77 -0
  41. package/dist/esm/models/Model.d.ts +12 -0
  42. package/dist/esm/models/Model.js +4 -0
  43. package/dist/esm/models/OfferingAlternative.d.ts +68 -0
  44. package/dist/esm/models/OfferingAlternative.js +67 -0
  45. package/dist/esm/models/OperationError.d.ts +20 -1
  46. package/dist/esm/models/OperationError.js +7 -0
  47. package/dist/esm/models/Problem.d.ts +3 -0
  48. package/dist/esm/models/Problem.js +3 -0
  49. package/dist/esm/models/index.d.ts +12 -0
  50. package/dist/esm/models/index.js +12 -0
  51. package/dist/esm/runtime.js +1 -1
  52. package/dist/models/ChatCompletionRequest.d.ts +27 -0
  53. package/dist/models/ChatCompletionRequest.js +11 -0
  54. package/dist/models/ChatCompletionRequestToolChoice.d.ts +22 -0
  55. package/dist/models/ChatCompletionRequestToolChoice.js +56 -0
  56. package/dist/models/ChatJSONSchemaFormat.d.ts +52 -0
  57. package/dist/models/ChatJSONSchemaFormat.js +58 -0
  58. package/dist/models/ChatMessage.d.ts +21 -1
  59. package/dist/models/ChatMessage.js +10 -4
  60. package/dist/models/ChatNamedToolChoice.d.ts +46 -0
  61. package/dist/models/ChatNamedToolChoice.js +64 -0
  62. package/dist/models/ChatNamedToolChoiceFunction.d.ts +32 -0
  63. package/dist/models/ChatNamedToolChoiceFunction.js +50 -0
  64. package/dist/models/ChatResponseFormat.d.ts +48 -0
  65. package/dist/models/ChatResponseFormat.js +62 -0
  66. package/dist/models/ChatTool.d.ts +46 -0
  67. package/dist/models/ChatTool.js +64 -0
  68. package/dist/models/ChatToolCall.d.ts +52 -0
  69. package/dist/models/ChatToolCall.js +68 -0
  70. package/dist/models/ChatToolCallFunction.d.ts +38 -0
  71. package/dist/models/ChatToolCallFunction.js +54 -0
  72. package/dist/models/ChatToolFunction.d.ts +52 -0
  73. package/dist/models/ChatToolFunction.js +56 -0
  74. package/dist/models/CreateFunctionVersionRequest.d.ts +6 -0
  75. package/dist/models/CreateFunctionVersionRequest.js +2 -0
  76. package/dist/models/CreateInstanceRequest.d.ts +13 -0
  77. package/dist/models/CreateInstanceRequest.js +5 -0
  78. package/dist/models/DedicatedIPRequest.d.ts +32 -0
  79. package/dist/models/DedicatedIPRequest.js +48 -0
  80. package/dist/models/FunctionVersion.d.ts +6 -0
  81. package/dist/models/FunctionVersion.js +4 -0
  82. package/dist/models/Instance.d.ts +7 -0
  83. package/dist/models/Instance.js +3 -0
  84. package/dist/models/InstanceDedicatedIP.d.ts +83 -0
  85. package/dist/models/InstanceDedicatedIP.js +85 -0
  86. package/dist/models/Model.d.ts +12 -0
  87. package/dist/models/Model.js +4 -0
  88. package/dist/models/OfferingAlternative.d.ts +68 -0
  89. package/dist/models/OfferingAlternative.js +74 -0
  90. package/dist/models/OperationError.d.ts +20 -1
  91. package/dist/models/OperationError.js +7 -0
  92. package/dist/models/Problem.d.ts +3 -0
  93. package/dist/models/Problem.js +3 -0
  94. package/dist/models/index.d.ts +12 -0
  95. package/dist/models/index.js +12 -0
  96. package/dist/runtime.js +1 -1
  97. package/docs/ChatCompletionRequest.md +8 -0
  98. package/docs/ChatCompletionRequestToolChoice.md +37 -0
  99. package/docs/ChatJSONSchemaFormat.md +40 -0
  100. package/docs/ChatMessage.md +6 -0
  101. package/docs/ChatNamedToolChoice.md +36 -0
  102. package/docs/ChatNamedToolChoiceFunction.md +34 -0
  103. package/docs/ChatResponseFormat.md +37 -0
  104. package/docs/ChatTool.md +36 -0
  105. package/docs/ChatToolCall.md +38 -0
  106. package/docs/ChatToolCallFunction.md +36 -0
  107. package/docs/ChatToolFunction.md +40 -0
  108. package/docs/CreateFunctionVersionRequest.md +2 -0
  109. package/docs/CreateInstanceRequest.md +4 -0
  110. package/docs/DedicatedIPRequest.md +35 -0
  111. package/docs/FunctionVersion.md +2 -0
  112. package/docs/Instance.md +2 -0
  113. package/docs/InstanceDedicatedIP.md +49 -0
  114. package/docs/InstancesApi.md +3 -1
  115. package/docs/Model.md +4 -0
  116. package/docs/OfferingAlternative.md +47 -0
  117. package/docs/OperationError.md +6 -0
  118. package/package.json +1 -1
  119. package/src/apis/InstancesApi.ts +2 -0
  120. package/src/models/ChatCompletionRequest.ts +53 -0
  121. package/src/models/ChatCompletionRequestToolChoice.ts +69 -0
  122. package/src/models/ChatJSONSchemaFormat.ts +91 -0
  123. package/src/models/ChatMessage.ts +36 -4
  124. package/src/models/ChatNamedToolChoice.ts +95 -0
  125. package/src/models/ChatNamedToolChoiceFunction.ts +66 -0
  126. package/src/models/ChatResponseFormat.ts +94 -0
  127. package/src/models/ChatTool.ts +95 -0
  128. package/src/models/ChatToolCall.ts +104 -0
  129. package/src/models/ChatToolCallFunction.ts +75 -0
  130. package/src/models/ChatToolFunction.ts +90 -0
  131. package/src/models/CreateFunctionVersionRequest.ts +8 -0
  132. package/src/models/CreateInstanceRequest.ts +23 -0
  133. package/src/models/DedicatedIPRequest.ts +65 -0
  134. package/src/models/FunctionVersion.ts +9 -0
  135. package/src/models/Instance.ts +15 -0
  136. package/src/models/InstanceDedicatedIP.ts +140 -0
  137. package/src/models/Model.ts +16 -0
  138. package/src/models/OfferingAlternative.ts +120 -0
  139. package/src/models/OperationError.ts +33 -1
  140. package/src/models/Problem.ts +3 -0
  141. package/src/models/index.ts +12 -0
  142. package/src/runtime.ts +1 -1
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { ChatCompletionRequestToolChoice } from './ChatCompletionRequestToolChoice';
17
+ import {
18
+ ChatCompletionRequestToolChoiceFromJSON,
19
+ ChatCompletionRequestToolChoiceFromJSONTyped,
20
+ ChatCompletionRequestToolChoiceToJSON,
21
+ ChatCompletionRequestToolChoiceToJSONTyped,
22
+ } from './ChatCompletionRequestToolChoice';
16
23
  import type { ChatMessage } from './ChatMessage';
17
24
  import {
18
25
  ChatMessageFromJSON,
@@ -27,6 +34,20 @@ import {
27
34
  StreamOptionsToJSON,
28
35
  StreamOptionsToJSONTyped,
29
36
  } from './StreamOptions';
37
+ import type { ChatTool } from './ChatTool';
38
+ import {
39
+ ChatToolFromJSON,
40
+ ChatToolFromJSONTyped,
41
+ ChatToolToJSON,
42
+ ChatToolToJSONTyped,
43
+ } from './ChatTool';
44
+ import type { ChatResponseFormat } from './ChatResponseFormat';
45
+ import {
46
+ ChatResponseFormatFromJSON,
47
+ ChatResponseFormatFromJSONTyped,
48
+ ChatResponseFormatToJSON,
49
+ ChatResponseFormatToJSONTyped,
50
+ } from './ChatResponseFormat';
30
51
 
31
52
  /**
32
53
  *
@@ -70,6 +91,30 @@ export interface ChatCompletionRequest {
70
91
  * @memberof ChatCompletionRequest
71
92
  */
72
93
  streamOptions?: StreamOptions;
94
+ /**
95
+ * 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").
96
+ * @type {Array<ChatTool>}
97
+ * @memberof ChatCompletionRequest
98
+ */
99
+ tools?: Array<ChatTool>;
100
+ /**
101
+ *
102
+ * @type {ChatCompletionRequestToolChoice}
103
+ * @memberof ChatCompletionRequest
104
+ */
105
+ toolChoice?: ChatCompletionRequestToolChoice;
106
+ /**
107
+ * Whether the model may call several tools in one turn. Passed through.
108
+ * @type {boolean}
109
+ * @memberof ChatCompletionRequest
110
+ */
111
+ parallelToolCalls?: boolean;
112
+ /**
113
+ *
114
+ * @type {ChatResponseFormat}
115
+ * @memberof ChatCompletionRequest
116
+ */
117
+ responseFormat?: ChatResponseFormat;
73
118
  }
74
119
 
75
120
  /**
@@ -97,6 +142,10 @@ export function ChatCompletionRequestFromJSONTyped(json: any, ignoreDiscriminato
97
142
  'maxTokens': json['max_tokens'] == null ? undefined : json['max_tokens'],
98
143
  'stream': json['stream'] == null ? undefined : json['stream'],
99
144
  'streamOptions': json['stream_options'] == null ? undefined : StreamOptionsFromJSON(json['stream_options']),
145
+ 'tools': json['tools'] == null ? undefined : ((json['tools'] as Array<any>).map(ChatToolFromJSON)),
146
+ 'toolChoice': json['tool_choice'] == null ? undefined : ChatCompletionRequestToolChoiceFromJSON(json['tool_choice']),
147
+ 'parallelToolCalls': json['parallel_tool_calls'] == null ? undefined : json['parallel_tool_calls'],
148
+ 'responseFormat': json['response_format'] == null ? undefined : ChatResponseFormatFromJSON(json['response_format']),
100
149
  };
101
150
  }
102
151
 
@@ -117,6 +166,10 @@ export function ChatCompletionRequestToJSONTyped(value?: ChatCompletionRequest |
117
166
  'max_tokens': value['maxTokens'],
118
167
  'stream': value['stream'],
119
168
  'stream_options': StreamOptionsToJSON(value['streamOptions']),
169
+ 'tools': value['tools'] == null ? undefined : ((value['tools'] as Array<any>).map(ChatToolToJSON)),
170
+ 'tool_choice': ChatCompletionRequestToolChoiceToJSON(value['toolChoice']),
171
+ 'parallel_tool_calls': value['parallelToolCalls'],
172
+ 'response_format': ChatResponseFormatToJSON(value['responseFormat']),
120
173
  };
121
174
  }
122
175
 
@@ -0,0 +1,69 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { ChatNamedToolChoice } from './ChatNamedToolChoice';
16
+ import {
17
+ instanceOfChatNamedToolChoice,
18
+ ChatNamedToolChoiceFromJSON,
19
+ ChatNamedToolChoiceFromJSONTyped,
20
+ ChatNamedToolChoiceToJSON,
21
+ } from './ChatNamedToolChoice';
22
+
23
+ /**
24
+ * @type ChatCompletionRequestToolChoice
25
+ * "auto" (default), "none", "required", or a named function ({"type":"function","function":{"name":"..."}}) that must be defined in tools.
26
+ * @export
27
+ */
28
+ export type ChatCompletionRequestToolChoice = ChatNamedToolChoice | string;
29
+
30
+ export function ChatCompletionRequestToolChoiceFromJSON(json: any): ChatCompletionRequestToolChoice {
31
+ return ChatCompletionRequestToolChoiceFromJSONTyped(json, false);
32
+ }
33
+
34
+ export function ChatCompletionRequestToolChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatCompletionRequestToolChoice {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ if (typeof json !== 'object') {
39
+ return json;
40
+ }
41
+ if (instanceOfChatNamedToolChoice(json)) {
42
+ return ChatNamedToolChoiceFromJSONTyped(json, true);
43
+ }
44
+ if (typeof json === 'string' && (json === 'none' || json === 'auto' || json === 'required')) {
45
+ return json;
46
+ }
47
+ return {} as any;
48
+ }
49
+
50
+ export function ChatCompletionRequestToolChoiceToJSON(json: any): any {
51
+ return ChatCompletionRequestToolChoiceToJSONTyped(json, false);
52
+ }
53
+
54
+ export function ChatCompletionRequestToolChoiceToJSONTyped(value?: ChatCompletionRequestToolChoice | null, ignoreDiscriminator: boolean = false): any {
55
+ if (value == null) {
56
+ return value;
57
+ }
58
+ if (typeof value !== 'object') {
59
+ return value;
60
+ }
61
+ if (instanceOfChatNamedToolChoice(value)) {
62
+ return ChatNamedToolChoiceToJSON(value as ChatNamedToolChoice);
63
+ }
64
+ if (typeof value === 'string' && (value === 'none' || value === 'auto' || value === 'required')) {
65
+ return value;
66
+ }
67
+ return {};
68
+ }
69
+
@@ -0,0 +1,91 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ChatJSONSchemaFormat
20
+ */
21
+ export interface ChatJSONSchemaFormat {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ChatJSONSchemaFormat
26
+ */
27
+ name: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ChatJSONSchemaFormat
32
+ */
33
+ description?: string;
34
+ /**
35
+ *
36
+ * @type {{ [key: string]: any; }}
37
+ * @memberof ChatJSONSchemaFormat
38
+ */
39
+ schema: { [key: string]: any; };
40
+ /**
41
+ *
42
+ * @type {boolean}
43
+ * @memberof ChatJSONSchemaFormat
44
+ */
45
+ strict?: boolean;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the ChatJSONSchemaFormat interface.
50
+ */
51
+ export function instanceOfChatJSONSchemaFormat(value: object): value is ChatJSONSchemaFormat {
52
+ if (!('name' in value) || value['name'] === undefined) return false;
53
+ if (!('schema' in value) || value['schema'] === undefined) return false;
54
+ return true;
55
+ }
56
+
57
+ export function ChatJSONSchemaFormatFromJSON(json: any): ChatJSONSchemaFormat {
58
+ return ChatJSONSchemaFormatFromJSONTyped(json, false);
59
+ }
60
+
61
+ export function ChatJSONSchemaFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatJSONSchemaFormat {
62
+ if (json == null) {
63
+ return json;
64
+ }
65
+ return {
66
+
67
+ 'name': json['name'],
68
+ 'description': json['description'] == null ? undefined : json['description'],
69
+ 'schema': json['schema'],
70
+ 'strict': json['strict'] == null ? undefined : json['strict'],
71
+ };
72
+ }
73
+
74
+ export function ChatJSONSchemaFormatToJSON(json: any): ChatJSONSchemaFormat {
75
+ return ChatJSONSchemaFormatToJSONTyped(json, false);
76
+ }
77
+
78
+ export function ChatJSONSchemaFormatToJSONTyped(value?: ChatJSONSchemaFormat | null, ignoreDiscriminator: boolean = false): any {
79
+ if (value == null) {
80
+ return value;
81
+ }
82
+
83
+ return {
84
+
85
+ 'name': value['name'],
86
+ 'description': value['description'],
87
+ 'schema': value['schema'],
88
+ 'strict': value['strict'],
89
+ };
90
+ }
91
+
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { ChatToolCall } from './ChatToolCall';
17
+ import {
18
+ ChatToolCallFromJSON,
19
+ ChatToolCallFromJSONTyped,
20
+ ChatToolCallToJSON,
21
+ ChatToolCallToJSONTyped,
22
+ } from './ChatToolCall';
23
+
16
24
  /**
17
25
  *
18
26
  * @export
@@ -25,12 +33,30 @@ export interface ChatMessage {
25
33
  * @memberof ChatMessage
26
34
  */
27
35
  role: ChatMessageRoleEnum;
36
+ /**
37
+ * Message text. null on an assistant message that only calls tools. Requests may also send an array of content parts, passed through unchanged.
38
+ * @type {string}
39
+ * @memberof ChatMessage
40
+ */
41
+ content?: string | null;
28
42
  /**
29
43
  *
30
44
  * @type {string}
31
45
  * @memberof ChatMessage
32
46
  */
33
- content: string;
47
+ name?: string;
48
+ /**
49
+ * Tool calls made by the assistant (assistant messages only).
50
+ * @type {Array<ChatToolCall>}
51
+ * @memberof ChatMessage
52
+ */
53
+ toolCalls?: Array<ChatToolCall>;
54
+ /**
55
+ * The tool call this message answers (required on role "tool").
56
+ * @type {string}
57
+ * @memberof ChatMessage
58
+ */
59
+ toolCallId?: string;
34
60
  }
35
61
 
36
62
 
@@ -40,7 +66,8 @@ export interface ChatMessage {
40
66
  export const ChatMessageRoleEnum = {
41
67
  System: 'system',
42
68
  User: 'user',
43
- Assistant: 'assistant'
69
+ Assistant: 'assistant',
70
+ Tool: 'tool'
44
71
  } as const;
45
72
  export type ChatMessageRoleEnum = typeof ChatMessageRoleEnum[keyof typeof ChatMessageRoleEnum];
46
73
 
@@ -50,7 +77,6 @@ export type ChatMessageRoleEnum = typeof ChatMessageRoleEnum[keyof typeof ChatMe
50
77
  */
51
78
  export function instanceOfChatMessage(value: object): value is ChatMessage {
52
79
  if (!('role' in value) || value['role'] === undefined) return false;
53
- if (!('content' in value) || value['content'] === undefined) return false;
54
80
  return true;
55
81
  }
56
82
 
@@ -65,7 +91,10 @@ export function ChatMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean
65
91
  return {
66
92
 
67
93
  'role': json['role'],
68
- 'content': json['content'],
94
+ 'content': json['content'] === undefined ? undefined : json['content'] === null ? null : json['content'],
95
+ 'name': json['name'] == null ? undefined : json['name'],
96
+ 'toolCalls': json['tool_calls'] == null ? undefined : ((json['tool_calls'] as Array<any>).map(ChatToolCallFromJSON)),
97
+ 'toolCallId': json['tool_call_id'] == null ? undefined : json['tool_call_id'],
69
98
  };
70
99
  }
71
100
 
@@ -82,6 +111,9 @@ export function ChatMessageToJSONTyped(value?: ChatMessage | null, ignoreDiscrim
82
111
 
83
112
  'role': value['role'],
84
113
  'content': value['content'],
114
+ 'name': value['name'],
115
+ 'tool_calls': value['toolCalls'] == null ? undefined : ((value['toolCalls'] as Array<any>).map(ChatToolCallToJSON)),
116
+ 'tool_call_id': value['toolCallId'],
85
117
  };
86
118
  }
87
119
 
@@ -0,0 +1,95 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ChatNamedToolChoiceFunction } from './ChatNamedToolChoiceFunction';
17
+ import {
18
+ ChatNamedToolChoiceFunctionFromJSON,
19
+ ChatNamedToolChoiceFunctionFromJSONTyped,
20
+ ChatNamedToolChoiceFunctionToJSON,
21
+ ChatNamedToolChoiceFunctionToJSONTyped,
22
+ } from './ChatNamedToolChoiceFunction';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ChatNamedToolChoice
28
+ */
29
+ export interface ChatNamedToolChoice {
30
+ /**
31
+ *
32
+ * @type {ChatNamedToolChoiceTypeEnum}
33
+ * @memberof ChatNamedToolChoice
34
+ */
35
+ type: ChatNamedToolChoiceTypeEnum;
36
+ /**
37
+ *
38
+ * @type {ChatNamedToolChoiceFunction}
39
+ * @memberof ChatNamedToolChoice
40
+ */
41
+ _function: ChatNamedToolChoiceFunction;
42
+ }
43
+
44
+
45
+ /**
46
+ * @export
47
+ */
48
+ export const ChatNamedToolChoiceTypeEnum = {
49
+ Function: 'function'
50
+ } as const;
51
+ export type ChatNamedToolChoiceTypeEnum = typeof ChatNamedToolChoiceTypeEnum[keyof typeof ChatNamedToolChoiceTypeEnum];
52
+
53
+
54
+ /**
55
+ * Check if a given object implements the ChatNamedToolChoice interface.
56
+ */
57
+ export function instanceOfChatNamedToolChoice(value: object): value is ChatNamedToolChoice {
58
+ if (!('type' in value) || value['type'] === undefined) return false;
59
+ if (value['type'] !== 'function') return false;
60
+
61
+ if ((!('_function' in (value as Record<string, any>)) && !('function' in (value as Record<string, any>))) || ((value as Record<string, any>)['_function'] === undefined && (value as Record<string, any>)['function'] === undefined)) return false;
62
+ return true;
63
+ }
64
+
65
+ export function ChatNamedToolChoiceFromJSON(json: any): ChatNamedToolChoice {
66
+ return ChatNamedToolChoiceFromJSONTyped(json, false);
67
+ }
68
+
69
+ export function ChatNamedToolChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatNamedToolChoice {
70
+ if (json == null) {
71
+ return json;
72
+ }
73
+ return {
74
+
75
+ 'type': json['type'],
76
+ '_function': ChatNamedToolChoiceFunctionFromJSON(json['function']),
77
+ };
78
+ }
79
+
80
+ export function ChatNamedToolChoiceToJSON(json: any): ChatNamedToolChoice {
81
+ return ChatNamedToolChoiceToJSONTyped(json, false);
82
+ }
83
+
84
+ export function ChatNamedToolChoiceToJSONTyped(value?: ChatNamedToolChoice | null, ignoreDiscriminator: boolean = false): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+
89
+ return {
90
+
91
+ 'type': value['type'],
92
+ 'function': ChatNamedToolChoiceFunctionToJSON(value['_function']),
93
+ };
94
+ }
95
+
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ChatNamedToolChoiceFunction
20
+ */
21
+ export interface ChatNamedToolChoiceFunction {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ChatNamedToolChoiceFunction
26
+ */
27
+ name: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ChatNamedToolChoiceFunction interface.
32
+ */
33
+ export function instanceOfChatNamedToolChoiceFunction(value: object): value is ChatNamedToolChoiceFunction {
34
+ if (!('name' in value) || value['name'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function ChatNamedToolChoiceFunctionFromJSON(json: any): ChatNamedToolChoiceFunction {
39
+ return ChatNamedToolChoiceFunctionFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ChatNamedToolChoiceFunctionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatNamedToolChoiceFunction {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'name': json['name'],
49
+ };
50
+ }
51
+
52
+ export function ChatNamedToolChoiceFunctionToJSON(json: any): ChatNamedToolChoiceFunction {
53
+ return ChatNamedToolChoiceFunctionToJSONTyped(json, false);
54
+ }
55
+
56
+ export function ChatNamedToolChoiceFunctionToJSONTyped(value?: ChatNamedToolChoiceFunction | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'name': value['name'],
64
+ };
65
+ }
66
+
@@ -0,0 +1,94 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ChatJSONSchemaFormat } from './ChatJSONSchemaFormat';
17
+ import {
18
+ ChatJSONSchemaFormatFromJSON,
19
+ ChatJSONSchemaFormatFromJSONTyped,
20
+ ChatJSONSchemaFormatToJSON,
21
+ ChatJSONSchemaFormatToJSONTyped,
22
+ } from './ChatJSONSchemaFormat';
23
+
24
+ /**
25
+ * 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.
26
+ * @export
27
+ * @interface ChatResponseFormat
28
+ */
29
+ export interface ChatResponseFormat {
30
+ /**
31
+ *
32
+ * @type {ChatResponseFormatTypeEnum}
33
+ * @memberof ChatResponseFormat
34
+ */
35
+ type: ChatResponseFormatTypeEnum;
36
+ /**
37
+ *
38
+ * @type {ChatJSONSchemaFormat}
39
+ * @memberof ChatResponseFormat
40
+ */
41
+ jsonSchema?: ChatJSONSchemaFormat;
42
+ }
43
+
44
+
45
+ /**
46
+ * @export
47
+ */
48
+ export const ChatResponseFormatTypeEnum = {
49
+ Text: 'text',
50
+ JsonObject: 'json_object',
51
+ JsonSchema: 'json_schema'
52
+ } as const;
53
+ export type ChatResponseFormatTypeEnum = typeof ChatResponseFormatTypeEnum[keyof typeof ChatResponseFormatTypeEnum];
54
+
55
+
56
+ /**
57
+ * Check if a given object implements the ChatResponseFormat interface.
58
+ */
59
+ export function instanceOfChatResponseFormat(value: object): value is ChatResponseFormat {
60
+ if (!('type' in value) || value['type'] === undefined) return false;
61
+ return true;
62
+ }
63
+
64
+ export function ChatResponseFormatFromJSON(json: any): ChatResponseFormat {
65
+ return ChatResponseFormatFromJSONTyped(json, false);
66
+ }
67
+
68
+ export function ChatResponseFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatResponseFormat {
69
+ if (json == null) {
70
+ return json;
71
+ }
72
+ return {
73
+
74
+ 'type': json['type'],
75
+ 'jsonSchema': json['json_schema'] == null ? undefined : ChatJSONSchemaFormatFromJSON(json['json_schema']),
76
+ };
77
+ }
78
+
79
+ export function ChatResponseFormatToJSON(json: any): ChatResponseFormat {
80
+ return ChatResponseFormatToJSONTyped(json, false);
81
+ }
82
+
83
+ export function ChatResponseFormatToJSONTyped(value?: ChatResponseFormat | null, ignoreDiscriminator: boolean = false): any {
84
+ if (value == null) {
85
+ return value;
86
+ }
87
+
88
+ return {
89
+
90
+ 'type': value['type'],
91
+ 'json_schema': ChatJSONSchemaFormatToJSON(value['jsonSchema']),
92
+ };
93
+ }
94
+
@@ -0,0 +1,95 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ChatToolFunction } from './ChatToolFunction';
17
+ import {
18
+ ChatToolFunctionFromJSON,
19
+ ChatToolFunctionFromJSONTyped,
20
+ ChatToolFunctionToJSON,
21
+ ChatToolFunctionToJSONTyped,
22
+ } from './ChatToolFunction';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ChatTool
28
+ */
29
+ export interface ChatTool {
30
+ /**
31
+ *
32
+ * @type {ChatToolTypeEnum}
33
+ * @memberof ChatTool
34
+ */
35
+ type: ChatToolTypeEnum;
36
+ /**
37
+ *
38
+ * @type {ChatToolFunction}
39
+ * @memberof ChatTool
40
+ */
41
+ _function: ChatToolFunction;
42
+ }
43
+
44
+
45
+ /**
46
+ * @export
47
+ */
48
+ export const ChatToolTypeEnum = {
49
+ Function: 'function'
50
+ } as const;
51
+ export type ChatToolTypeEnum = typeof ChatToolTypeEnum[keyof typeof ChatToolTypeEnum];
52
+
53
+
54
+ /**
55
+ * Check if a given object implements the ChatTool interface.
56
+ */
57
+ export function instanceOfChatTool(value: object): value is ChatTool {
58
+ if (!('type' in value) || value['type'] === undefined) return false;
59
+ if (value['type'] !== 'function') return false;
60
+
61
+ if ((!('_function' in (value as Record<string, any>)) && !('function' in (value as Record<string, any>))) || ((value as Record<string, any>)['_function'] === undefined && (value as Record<string, any>)['function'] === undefined)) return false;
62
+ return true;
63
+ }
64
+
65
+ export function ChatToolFromJSON(json: any): ChatTool {
66
+ return ChatToolFromJSONTyped(json, false);
67
+ }
68
+
69
+ export function ChatToolFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatTool {
70
+ if (json == null) {
71
+ return json;
72
+ }
73
+ return {
74
+
75
+ 'type': json['type'],
76
+ '_function': ChatToolFunctionFromJSON(json['function']),
77
+ };
78
+ }
79
+
80
+ export function ChatToolToJSON(json: any): ChatTool {
81
+ return ChatToolToJSONTyped(json, false);
82
+ }
83
+
84
+ export function ChatToolToJSONTyped(value?: ChatTool | null, ignoreDiscriminator: boolean = false): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+
89
+ return {
90
+
91
+ 'type': value['type'],
92
+ 'function': ChatToolFunctionToJSON(value['_function']),
93
+ };
94
+ }
95
+