@gpuai/sdk 0.4.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +24 -0
- package/README.md +14 -2
- package/dist/apis/InstancesApi.d.ts +2 -0
- package/dist/apis/InstancesApi.js +2 -0
- package/dist/esm/apis/InstancesApi.d.ts +2 -0
- package/dist/esm/apis/InstancesApi.js +2 -0
- package/dist/esm/models/ChatCompletionRequest.d.ts +27 -0
- package/dist/esm/models/ChatCompletionRequest.js +11 -0
- package/dist/esm/models/ChatCompletionRequestToolChoice.d.ts +22 -0
- package/dist/esm/models/ChatCompletionRequestToolChoice.js +50 -0
- package/dist/esm/models/ChatJSONSchemaFormat.d.ts +52 -0
- package/dist/esm/models/ChatJSONSchemaFormat.js +51 -0
- package/dist/esm/models/ChatMessage.d.ts +21 -1
- package/dist/esm/models/ChatMessage.js +10 -4
- package/dist/esm/models/ChatNamedToolChoice.d.ts +46 -0
- package/dist/esm/models/ChatNamedToolChoice.js +56 -0
- package/dist/esm/models/ChatNamedToolChoiceFunction.d.ts +32 -0
- package/dist/esm/models/ChatNamedToolChoiceFunction.js +43 -0
- package/dist/esm/models/ChatResponseFormat.d.ts +48 -0
- package/dist/esm/models/ChatResponseFormat.js +54 -0
- package/dist/esm/models/ChatTool.d.ts +46 -0
- package/dist/esm/models/ChatTool.js +56 -0
- package/dist/esm/models/ChatToolCall.d.ts +52 -0
- package/dist/esm/models/ChatToolCall.js +60 -0
- package/dist/esm/models/ChatToolCallFunction.d.ts +38 -0
- package/dist/esm/models/ChatToolCallFunction.js +47 -0
- package/dist/esm/models/ChatToolFunction.d.ts +52 -0
- package/dist/esm/models/ChatToolFunction.js +49 -0
- package/dist/esm/models/CreateFunctionVersionRequest.d.ts +6 -0
- package/dist/esm/models/CreateFunctionVersionRequest.js +2 -0
- package/dist/esm/models/CreateInstanceRequest.d.ts +13 -0
- package/dist/esm/models/CreateInstanceRequest.js +5 -0
- package/dist/esm/models/DedicatedIPRequest.d.ts +32 -0
- package/dist/esm/models/DedicatedIPRequest.js +41 -0
- package/dist/esm/models/FunctionVersion.d.ts +6 -0
- package/dist/esm/models/FunctionVersion.js +4 -0
- package/dist/esm/models/Instance.d.ts +7 -0
- package/dist/esm/models/Instance.js +3 -0
- package/dist/esm/models/InstanceDedicatedIP.d.ts +83 -0
- package/dist/esm/models/InstanceDedicatedIP.js +77 -0
- package/dist/esm/models/Model.d.ts +12 -0
- package/dist/esm/models/Model.js +4 -0
- package/dist/esm/models/OfferingAlternative.d.ts +68 -0
- package/dist/esm/models/OfferingAlternative.js +67 -0
- package/dist/esm/models/OperationError.d.ts +20 -1
- package/dist/esm/models/OperationError.js +7 -0
- package/dist/esm/models/Problem.d.ts +3 -0
- package/dist/esm/models/Problem.js +3 -0
- package/dist/esm/models/index.d.ts +12 -0
- package/dist/esm/models/index.js +12 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/ChatCompletionRequest.d.ts +27 -0
- package/dist/models/ChatCompletionRequest.js +11 -0
- package/dist/models/ChatCompletionRequestToolChoice.d.ts +22 -0
- package/dist/models/ChatCompletionRequestToolChoice.js +56 -0
- package/dist/models/ChatJSONSchemaFormat.d.ts +52 -0
- package/dist/models/ChatJSONSchemaFormat.js +58 -0
- package/dist/models/ChatMessage.d.ts +21 -1
- package/dist/models/ChatMessage.js +10 -4
- package/dist/models/ChatNamedToolChoice.d.ts +46 -0
- package/dist/models/ChatNamedToolChoice.js +64 -0
- package/dist/models/ChatNamedToolChoiceFunction.d.ts +32 -0
- package/dist/models/ChatNamedToolChoiceFunction.js +50 -0
- package/dist/models/ChatResponseFormat.d.ts +48 -0
- package/dist/models/ChatResponseFormat.js +62 -0
- package/dist/models/ChatTool.d.ts +46 -0
- package/dist/models/ChatTool.js +64 -0
- package/dist/models/ChatToolCall.d.ts +52 -0
- package/dist/models/ChatToolCall.js +68 -0
- package/dist/models/ChatToolCallFunction.d.ts +38 -0
- package/dist/models/ChatToolCallFunction.js +54 -0
- package/dist/models/ChatToolFunction.d.ts +52 -0
- package/dist/models/ChatToolFunction.js +56 -0
- package/dist/models/CreateFunctionVersionRequest.d.ts +6 -0
- package/dist/models/CreateFunctionVersionRequest.js +2 -0
- package/dist/models/CreateInstanceRequest.d.ts +13 -0
- package/dist/models/CreateInstanceRequest.js +5 -0
- package/dist/models/DedicatedIPRequest.d.ts +32 -0
- package/dist/models/DedicatedIPRequest.js +48 -0
- package/dist/models/FunctionVersion.d.ts +6 -0
- package/dist/models/FunctionVersion.js +4 -0
- package/dist/models/Instance.d.ts +7 -0
- package/dist/models/Instance.js +3 -0
- package/dist/models/InstanceDedicatedIP.d.ts +83 -0
- package/dist/models/InstanceDedicatedIP.js +85 -0
- package/dist/models/Model.d.ts +12 -0
- package/dist/models/Model.js +4 -0
- package/dist/models/OfferingAlternative.d.ts +68 -0
- package/dist/models/OfferingAlternative.js +74 -0
- package/dist/models/OperationError.d.ts +20 -1
- package/dist/models/OperationError.js +7 -0
- package/dist/models/Problem.d.ts +3 -0
- package/dist/models/Problem.js +3 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.js +12 -0
- package/dist/runtime.js +1 -1
- package/docs/ChatCompletionRequest.md +8 -0
- package/docs/ChatCompletionRequestToolChoice.md +37 -0
- package/docs/ChatJSONSchemaFormat.md +40 -0
- package/docs/ChatMessage.md +6 -0
- package/docs/ChatNamedToolChoice.md +36 -0
- package/docs/ChatNamedToolChoiceFunction.md +34 -0
- package/docs/ChatResponseFormat.md +37 -0
- package/docs/ChatTool.md +36 -0
- package/docs/ChatToolCall.md +38 -0
- package/docs/ChatToolCallFunction.md +36 -0
- package/docs/ChatToolFunction.md +40 -0
- package/docs/CreateFunctionVersionRequest.md +2 -0
- package/docs/CreateInstanceRequest.md +4 -0
- package/docs/DedicatedIPRequest.md +35 -0
- package/docs/FunctionVersion.md +2 -0
- package/docs/Instance.md +2 -0
- package/docs/InstanceDedicatedIP.md +49 -0
- package/docs/InstancesApi.md +3 -1
- package/docs/Model.md +4 -0
- package/docs/OfferingAlternative.md +47 -0
- package/docs/OperationError.md +6 -0
- package/package.json +1 -1
- package/src/apis/InstancesApi.ts +2 -0
- package/src/models/ChatCompletionRequest.ts +53 -0
- package/src/models/ChatCompletionRequestToolChoice.ts +69 -0
- package/src/models/ChatJSONSchemaFormat.ts +91 -0
- package/src/models/ChatMessage.ts +36 -4
- package/src/models/ChatNamedToolChoice.ts +95 -0
- package/src/models/ChatNamedToolChoiceFunction.ts +66 -0
- package/src/models/ChatResponseFormat.ts +94 -0
- package/src/models/ChatTool.ts +95 -0
- package/src/models/ChatToolCall.ts +104 -0
- package/src/models/ChatToolCallFunction.ts +75 -0
- package/src/models/ChatToolFunction.ts +90 -0
- package/src/models/CreateFunctionVersionRequest.ts +8 -0
- package/src/models/CreateInstanceRequest.ts +23 -0
- package/src/models/DedicatedIPRequest.ts +65 -0
- package/src/models/FunctionVersion.ts +9 -0
- package/src/models/Instance.ts +15 -0
- package/src/models/InstanceDedicatedIP.ts +140 -0
- package/src/models/Model.ts +16 -0
- package/src/models/OfferingAlternative.ts +120 -0
- package/src/models/OperationError.ts +33 -1
- package/src/models/Problem.ts +3 -0
- package/src/models/index.ts +12 -0
- package/src/runtime.ts +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatJSONSchemaFormat
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`description` | string
|
|
11
|
+
`schema` | { [key: string]: any; }
|
|
12
|
+
`strict` | boolean
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { ChatJSONSchemaFormat } from '@gpuai/sdk'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"name": null,
|
|
22
|
+
"description": null,
|
|
23
|
+
"schema": null,
|
|
24
|
+
"strict": null,
|
|
25
|
+
} satisfies ChatJSONSchemaFormat
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatJSONSchemaFormat
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
package/docs/ChatMessage.md
CHANGED
|
@@ -8,6 +8,9 @@ Name | Type
|
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`role` | string
|
|
10
10
|
`content` | string
|
|
11
|
+
`name` | string
|
|
12
|
+
`toolCalls` | [Array<ChatToolCall>](ChatToolCall.md)
|
|
13
|
+
`toolCallId` | string
|
|
11
14
|
|
|
12
15
|
## Example
|
|
13
16
|
|
|
@@ -18,6 +21,9 @@ import type { ChatMessage } from '@gpuai/sdk'
|
|
|
18
21
|
const example = {
|
|
19
22
|
"role": null,
|
|
20
23
|
"content": null,
|
|
24
|
+
"name": null,
|
|
25
|
+
"toolCalls": null,
|
|
26
|
+
"toolCallId": null,
|
|
21
27
|
} satisfies ChatMessage
|
|
22
28
|
|
|
23
29
|
console.log(example)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatNamedToolChoice
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`type` | string
|
|
10
|
+
`_function` | [ChatNamedToolChoiceFunction](ChatNamedToolChoiceFunction.md)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ChatNamedToolChoice } from '@gpuai/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"type": null,
|
|
20
|
+
"_function": null,
|
|
21
|
+
} satisfies ChatNamedToolChoice
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatNamedToolChoice
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatNamedToolChoiceFunction
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ChatNamedToolChoiceFunction } from '@gpuai/sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"name": null,
|
|
19
|
+
} satisfies ChatNamedToolChoiceFunction
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatNamedToolChoiceFunction
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatResponseFormat
|
|
3
|
+
|
|
4
|
+
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.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`type` | string
|
|
11
|
+
`jsonSchema` | [ChatJSONSchemaFormat](ChatJSONSchemaFormat.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ChatResponseFormat } from '@gpuai/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"type": null,
|
|
21
|
+
"jsonSchema": null,
|
|
22
|
+
} satisfies ChatResponseFormat
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatResponseFormat
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
package/docs/ChatTool.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatTool
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`type` | string
|
|
10
|
+
`_function` | [ChatToolFunction](ChatToolFunction.md)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ChatTool } from '@gpuai/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"type": null,
|
|
20
|
+
"_function": null,
|
|
21
|
+
} satisfies ChatTool
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatTool
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatToolCall
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`type` | string
|
|
11
|
+
`_function` | [ChatToolCallFunction](ChatToolCallFunction.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ChatToolCall } from '@gpuai/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"id": null,
|
|
21
|
+
"type": null,
|
|
22
|
+
"_function": null,
|
|
23
|
+
} satisfies ChatToolCall
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatToolCall
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatToolCallFunction
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`arguments` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ChatToolCallFunction } from '@gpuai/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"name": null,
|
|
20
|
+
"arguments": null,
|
|
21
|
+
} satisfies ChatToolCallFunction
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatToolCallFunction
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatToolFunction
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`description` | string
|
|
11
|
+
`parameters` | { [key: string]: any; }
|
|
12
|
+
`strict` | boolean
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { ChatToolFunction } from '@gpuai/sdk'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"name": null,
|
|
22
|
+
"description": null,
|
|
23
|
+
"parameters": null,
|
|
24
|
+
"strict": null,
|
|
25
|
+
} satisfies ChatToolFunction
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatToolFunction
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
|
@@ -20,6 +20,7 @@ Name | Type
|
|
|
20
20
|
`timeout` | number
|
|
21
21
|
`idleTimeout` | number
|
|
22
22
|
`maxConcurrency` | number
|
|
23
|
+
`secrets` | Array<string>
|
|
23
24
|
|
|
24
25
|
## Example
|
|
25
26
|
|
|
@@ -42,6 +43,7 @@ const example = {
|
|
|
42
43
|
"timeout": null,
|
|
43
44
|
"idleTimeout": null,
|
|
44
45
|
"maxConcurrency": null,
|
|
46
|
+
"secrets": null,
|
|
45
47
|
} satisfies CreateFunctionVersionRequest
|
|
46
48
|
|
|
47
49
|
console.log(example)
|
|
@@ -25,6 +25,8 @@ Name | Type
|
|
|
25
25
|
`entrypoint` | Array<string>
|
|
26
26
|
`cmd` | Array<string>
|
|
27
27
|
`ports` | [Array<CreateInstanceRequestPortsInner>](CreateInstanceRequestPortsInner.md)
|
|
28
|
+
`dedicatedIp` | [DedicatedIPRequest](DedicatedIPRequest.md)
|
|
29
|
+
`secrets` | Array<string>
|
|
28
30
|
|
|
29
31
|
## Example
|
|
30
32
|
|
|
@@ -52,6 +54,8 @@ const example = {
|
|
|
52
54
|
"entrypoint": null,
|
|
53
55
|
"cmd": null,
|
|
54
56
|
"ports": null,
|
|
57
|
+
"dedicatedIp": null,
|
|
58
|
+
"secrets": null,
|
|
55
59
|
} satisfies CreateInstanceRequest
|
|
56
60
|
|
|
57
61
|
console.log(example)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# DedicatedIPRequest
|
|
3
|
+
|
|
4
|
+
Requests a dedicated public IPv4 address for the instance. Send an empty object for the default ports (80 and 443).
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`ports` | Array<number>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { DedicatedIPRequest } from '@gpuai/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"ports": [80, 443],
|
|
20
|
+
} satisfies DedicatedIPRequest
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as DedicatedIPRequest
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
package/docs/FunctionVersion.md
CHANGED
|
@@ -22,6 +22,7 @@ Name | Type
|
|
|
22
22
|
`timeout` | number
|
|
23
23
|
`idleTimeout` | number
|
|
24
24
|
`maxConcurrency` | number
|
|
25
|
+
`secrets` | Array<string>
|
|
25
26
|
`createdAt` | Date
|
|
26
27
|
|
|
27
28
|
## Example
|
|
@@ -47,6 +48,7 @@ const example = {
|
|
|
47
48
|
"timeout": null,
|
|
48
49
|
"idleTimeout": null,
|
|
49
50
|
"maxConcurrency": null,
|
|
51
|
+
"secrets": null,
|
|
50
52
|
"createdAt": null,
|
|
51
53
|
} satisfies FunctionVersion
|
|
52
54
|
|
package/docs/Instance.md
CHANGED
|
@@ -27,6 +27,7 @@ Name | Type
|
|
|
27
27
|
`lastReachableAt` | Date
|
|
28
28
|
`unreachableSince` | Date
|
|
29
29
|
`bootPhase` | string
|
|
30
|
+
`dedicatedIp` | [InstanceDedicatedIP](InstanceDedicatedIP.md)
|
|
30
31
|
|
|
31
32
|
## Example
|
|
32
33
|
|
|
@@ -56,6 +57,7 @@ const example = {
|
|
|
56
57
|
"lastReachableAt": null,
|
|
57
58
|
"unreachableSince": null,
|
|
58
59
|
"bootPhase": null,
|
|
60
|
+
"dedicatedIp": null,
|
|
59
61
|
} satisfies Instance
|
|
60
62
|
|
|
61
63
|
console.log(example)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
# InstanceDedicatedIP
|
|
3
|
+
|
|
4
|
+
The instance\'s dedicated public IPv4 add-on. Present only on instances launched with `dedicated_ip`, and only on deployments where the add-on is enabled.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`address` | string
|
|
11
|
+
`ports` | Array<number>
|
|
12
|
+
`status` | string
|
|
13
|
+
`suspendReason` | string
|
|
14
|
+
`hourlyFee` | number
|
|
15
|
+
`transferPricePerGb` | number
|
|
16
|
+
`transferGb` | number
|
|
17
|
+
`chargedUsd` | number
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { InstanceDedicatedIP } from '@gpuai/sdk'
|
|
23
|
+
|
|
24
|
+
// TODO: Update the object below with actual values
|
|
25
|
+
const example = {
|
|
26
|
+
"address": 203.0.113.7,
|
|
27
|
+
"ports": [80, 443],
|
|
28
|
+
"status": null,
|
|
29
|
+
"suspendReason": null,
|
|
30
|
+
"hourlyFee": null,
|
|
31
|
+
"transferPricePerGb": null,
|
|
32
|
+
"transferGb": null,
|
|
33
|
+
"chargedUsd": null,
|
|
34
|
+
} satisfies InstanceDedicatedIP
|
|
35
|
+
|
|
36
|
+
console.log(example)
|
|
37
|
+
|
|
38
|
+
// Convert the instance to a JSON string
|
|
39
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
40
|
+
console.log(exampleJSON)
|
|
41
|
+
|
|
42
|
+
// Parse the JSON string back to an object
|
|
43
|
+
const exampleParsed = JSON.parse(exampleJSON) as InstanceDedicatedIP
|
|
44
|
+
console.log(exampleParsed)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
48
|
+
|
|
49
|
+
|
package/docs/InstancesApi.md
CHANGED
|
@@ -19,6 +19,8 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
19
19
|
|
|
20
20
|
Create an instance (async — returns 202 + Operation-Id header)
|
|
21
21
|
|
|
22
|
+
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.
|
|
23
|
+
|
|
22
24
|
### Example
|
|
23
25
|
|
|
24
26
|
```ts
|
|
@@ -80,7 +82,7 @@ example().catch(console.error);
|
|
|
80
82
|
### HTTP response details
|
|
81
83
|
| Status code | Description | Response headers |
|
|
82
84
|
|-------------|-------------|------------------|
|
|
83
|
-
| **202** | Accepted; long-running operation | * Operation-Id - Use GET /operations/{id} to poll <br> |
|
|
85
|
+
| **202** | Accepted; long-running operation | * Operation-Id - Use GET /operations/{id} to poll <br> * GPUAI-Hint - Advisory only, and absent on most launches. Sent when the request is a one-off batch run (a custom image with a command and auto_terminate_hours) to point at Jobs (POST /jobs), which start a machine for the work and shut it down a few minutes after it ends. It never changes the launch. <br> |
|
|
84
86
|
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
85
87
|
| **0** | Error response (RFC 7807) | - |
|
|
86
88
|
|
package/docs/Model.md
CHANGED
|
@@ -15,6 +15,8 @@ Name | Type
|
|
|
15
15
|
`category` | string
|
|
16
16
|
`contextLength` | number
|
|
17
17
|
`supportedParameters` | Array<string>
|
|
18
|
+
`supportsTools` | boolean
|
|
19
|
+
`supportsStructuredOutputs` | boolean
|
|
18
20
|
`parameters` | [Array<ModelParametersInner>](ModelParametersInner.md)
|
|
19
21
|
`pricing` | [ModelPricing](ModelPricing.md)
|
|
20
22
|
`aliases` | Array<string>
|
|
@@ -38,6 +40,8 @@ const example = {
|
|
|
38
40
|
"category": null,
|
|
39
41
|
"contextLength": null,
|
|
40
42
|
"supportedParameters": null,
|
|
43
|
+
"supportsTools": null,
|
|
44
|
+
"supportsStructuredOutputs": null,
|
|
41
45
|
"parameters": null,
|
|
42
46
|
"pricing": null,
|
|
43
47
|
"aliases": null,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
# OfferingAlternative
|
|
3
|
+
|
|
4
|
+
A live catalog row a launch whose pinned offering was gone could take instead. Same fields and meaning as the matching GET /pricing row.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`offeringId` | string
|
|
11
|
+
`gpuType` | string
|
|
12
|
+
`gpuCount` | number
|
|
13
|
+
`region` | string
|
|
14
|
+
`tier` | string
|
|
15
|
+
`pricePerHour` | number
|
|
16
|
+
`available` | number
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import type { OfferingAlternative } from '@gpuai/sdk'
|
|
22
|
+
|
|
23
|
+
// TODO: Update the object below with actual values
|
|
24
|
+
const example = {
|
|
25
|
+
"offeringId": null,
|
|
26
|
+
"gpuType": null,
|
|
27
|
+
"gpuCount": null,
|
|
28
|
+
"region": null,
|
|
29
|
+
"tier": null,
|
|
30
|
+
"pricePerHour": null,
|
|
31
|
+
"available": null,
|
|
32
|
+
} satisfies OfferingAlternative
|
|
33
|
+
|
|
34
|
+
console.log(example)
|
|
35
|
+
|
|
36
|
+
// Convert the instance to a JSON string
|
|
37
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
38
|
+
console.log(exampleJSON)
|
|
39
|
+
|
|
40
|
+
// Parse the JSON string back to an object
|
|
41
|
+
const exampleParsed = JSON.parse(exampleJSON) as OfferingAlternative
|
|
42
|
+
console.log(exampleParsed)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
46
|
+
|
|
47
|
+
|
package/docs/OperationError.md
CHANGED
|
@@ -8,6 +8,9 @@ Name | Type
|
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`code` | string
|
|
10
10
|
`detail` | string
|
|
11
|
+
`alternatives` | [Array<OfferingAlternative>](OfferingAlternative.md)
|
|
12
|
+
`currentPricePerHour` | number
|
|
13
|
+
`maxPricePerHour` | number
|
|
11
14
|
|
|
12
15
|
## Example
|
|
13
16
|
|
|
@@ -18,6 +21,9 @@ import type { OperationError } from '@gpuai/sdk'
|
|
|
18
21
|
const example = {
|
|
19
22
|
"code": null,
|
|
20
23
|
"detail": null,
|
|
24
|
+
"alternatives": null,
|
|
25
|
+
"currentPricePerHour": null,
|
|
26
|
+
"maxPricePerHour": null,
|
|
21
27
|
} satisfies OperationError
|
|
22
28
|
|
|
23
29
|
console.log(example)
|
package/package.json
CHANGED
package/src/apis/InstancesApi.ts
CHANGED
|
@@ -127,6 +127,7 @@ export class InstancesApi extends runtime.BaseAPI {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
+
* 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.
|
|
130
131
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
131
132
|
*/
|
|
132
133
|
async createInstanceRaw(requestParameters: CreateInstanceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Operation>> {
|
|
@@ -137,6 +138,7 @@ export class InstancesApi extends runtime.BaseAPI {
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
/**
|
|
141
|
+
* 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.
|
|
140
142
|
* Create an instance (async — returns 202 + Operation-Id header)
|
|
141
143
|
*/
|
|
142
144
|
async createInstance(requestParameters: CreateInstanceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Operation> {
|