@gpuai/sdk 0.4.1 → 0.5.0

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 (130) hide show
  1. package/.openapi-generator/FILES +22 -0
  2. package/README.md +13 -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 +22 -0
  38. package/dist/esm/models/Instance.js +13 -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/Problem.d.ts +2 -0
  44. package/dist/esm/models/Problem.js +2 -0
  45. package/dist/esm/models/index.d.ts +11 -0
  46. package/dist/esm/models/index.js +11 -0
  47. package/dist/esm/runtime.js +1 -1
  48. package/dist/models/ChatCompletionRequest.d.ts +27 -0
  49. package/dist/models/ChatCompletionRequest.js +11 -0
  50. package/dist/models/ChatCompletionRequestToolChoice.d.ts +22 -0
  51. package/dist/models/ChatCompletionRequestToolChoice.js +56 -0
  52. package/dist/models/ChatJSONSchemaFormat.d.ts +52 -0
  53. package/dist/models/ChatJSONSchemaFormat.js +58 -0
  54. package/dist/models/ChatMessage.d.ts +21 -1
  55. package/dist/models/ChatMessage.js +10 -4
  56. package/dist/models/ChatNamedToolChoice.d.ts +46 -0
  57. package/dist/models/ChatNamedToolChoice.js +64 -0
  58. package/dist/models/ChatNamedToolChoiceFunction.d.ts +32 -0
  59. package/dist/models/ChatNamedToolChoiceFunction.js +50 -0
  60. package/dist/models/ChatResponseFormat.d.ts +48 -0
  61. package/dist/models/ChatResponseFormat.js +62 -0
  62. package/dist/models/ChatTool.d.ts +46 -0
  63. package/dist/models/ChatTool.js +64 -0
  64. package/dist/models/ChatToolCall.d.ts +52 -0
  65. package/dist/models/ChatToolCall.js +68 -0
  66. package/dist/models/ChatToolCallFunction.d.ts +38 -0
  67. package/dist/models/ChatToolCallFunction.js +54 -0
  68. package/dist/models/ChatToolFunction.d.ts +52 -0
  69. package/dist/models/ChatToolFunction.js +56 -0
  70. package/dist/models/CreateFunctionVersionRequest.d.ts +6 -0
  71. package/dist/models/CreateFunctionVersionRequest.js +2 -0
  72. package/dist/models/CreateInstanceRequest.d.ts +13 -0
  73. package/dist/models/CreateInstanceRequest.js +5 -0
  74. package/dist/models/DedicatedIPRequest.d.ts +32 -0
  75. package/dist/models/DedicatedIPRequest.js +48 -0
  76. package/dist/models/FunctionVersion.d.ts +6 -0
  77. package/dist/models/FunctionVersion.js +4 -0
  78. package/dist/models/Instance.d.ts +22 -0
  79. package/dist/models/Instance.js +14 -1
  80. package/dist/models/InstanceDedicatedIP.d.ts +83 -0
  81. package/dist/models/InstanceDedicatedIP.js +85 -0
  82. package/dist/models/Model.d.ts +12 -0
  83. package/dist/models/Model.js +4 -0
  84. package/dist/models/Problem.d.ts +2 -0
  85. package/dist/models/Problem.js +2 -0
  86. package/dist/models/index.d.ts +11 -0
  87. package/dist/models/index.js +11 -0
  88. package/dist/runtime.js +1 -1
  89. package/docs/ChatCompletionRequest.md +8 -0
  90. package/docs/ChatCompletionRequestToolChoice.md +37 -0
  91. package/docs/ChatJSONSchemaFormat.md +40 -0
  92. package/docs/ChatMessage.md +6 -0
  93. package/docs/ChatNamedToolChoice.md +36 -0
  94. package/docs/ChatNamedToolChoiceFunction.md +34 -0
  95. package/docs/ChatResponseFormat.md +37 -0
  96. package/docs/ChatTool.md +36 -0
  97. package/docs/ChatToolCall.md +38 -0
  98. package/docs/ChatToolCallFunction.md +36 -0
  99. package/docs/ChatToolFunction.md +40 -0
  100. package/docs/CreateFunctionVersionRequest.md +2 -0
  101. package/docs/CreateInstanceRequest.md +4 -0
  102. package/docs/DedicatedIPRequest.md +35 -0
  103. package/docs/FunctionVersion.md +2 -0
  104. package/docs/Instance.md +4 -0
  105. package/docs/InstanceDedicatedIP.md +49 -0
  106. package/docs/InstancesApi.md +3 -1
  107. package/docs/Model.md +4 -0
  108. package/package.json +1 -1
  109. package/src/apis/InstancesApi.ts +2 -0
  110. package/src/models/ChatCompletionRequest.ts +53 -0
  111. package/src/models/ChatCompletionRequestToolChoice.ts +69 -0
  112. package/src/models/ChatJSONSchemaFormat.ts +91 -0
  113. package/src/models/ChatMessage.ts +36 -4
  114. package/src/models/ChatNamedToolChoice.ts +95 -0
  115. package/src/models/ChatNamedToolChoiceFunction.ts +66 -0
  116. package/src/models/ChatResponseFormat.ts +94 -0
  117. package/src/models/ChatTool.ts +95 -0
  118. package/src/models/ChatToolCall.ts +104 -0
  119. package/src/models/ChatToolCallFunction.ts +75 -0
  120. package/src/models/ChatToolFunction.ts +90 -0
  121. package/src/models/CreateFunctionVersionRequest.ts +8 -0
  122. package/src/models/CreateInstanceRequest.ts +23 -0
  123. package/src/models/DedicatedIPRequest.ts +65 -0
  124. package/src/models/FunctionVersion.ts +9 -0
  125. package/src/models/Instance.ts +33 -0
  126. package/src/models/InstanceDedicatedIP.ts +140 -0
  127. package/src/models/Model.ts +16 -0
  128. package/src/models/Problem.ts +2 -0
  129. package/src/models/index.ts +11 -0
  130. package/src/runtime.ts +1 -1
@@ -0,0 +1,41 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the DedicatedIPRequest interface.
16
+ */
17
+ export function instanceOfDedicatedIPRequest(value) {
18
+ return true;
19
+ }
20
+ export function DedicatedIPRequestFromJSON(json) {
21
+ return DedicatedIPRequestFromJSONTyped(json, false);
22
+ }
23
+ export function DedicatedIPRequestFromJSONTyped(json, ignoreDiscriminator) {
24
+ if (json == null) {
25
+ return json;
26
+ }
27
+ return {
28
+ 'ports': json['ports'] == null ? undefined : json['ports'],
29
+ };
30
+ }
31
+ export function DedicatedIPRequestToJSON(json) {
32
+ return DedicatedIPRequestToJSONTyped(json, false);
33
+ }
34
+ export function DedicatedIPRequestToJSONTyped(value, ignoreDiscriminator = false) {
35
+ if (value == null) {
36
+ return value;
37
+ }
38
+ return {
39
+ 'ports': value['ports'],
40
+ };
41
+ }
@@ -112,6 +112,12 @@ export interface FunctionVersion {
112
112
  * @memberof FunctionVersion
113
113
  */
114
114
  maxConcurrency: number;
115
+ /**
116
+ * Names of the organization secrets each run receives. Empty when none.
117
+ * @type {Array<string>}
118
+ * @memberof FunctionVersion
119
+ */
120
+ secrets: Array<string>;
115
121
  /**
116
122
  *
117
123
  * @type {Date}
@@ -49,6 +49,8 @@ export function instanceOfFunctionVersion(value) {
49
49
  return false;
50
50
  if ((!('maxConcurrency' in value) && !('max_concurrency' in value)) || (value['maxConcurrency'] === undefined && value['max_concurrency'] === undefined))
51
51
  return false;
52
+ if (!('secrets' in value) || value['secrets'] === undefined)
53
+ return false;
52
54
  if ((!('createdAt' in value) && !('created_at' in value)) || (value['createdAt'] === undefined && value['created_at'] === undefined))
53
55
  return false;
54
56
  return true;
@@ -77,6 +79,7 @@ export function FunctionVersionFromJSONTyped(json, ignoreDiscriminator) {
77
79
  'timeout': json['timeout'],
78
80
  'idleTimeout': json['idle_timeout'],
79
81
  'maxConcurrency': json['max_concurrency'],
82
+ 'secrets': json['secrets'],
80
83
  'createdAt': (new Date(json['created_at'])),
81
84
  };
82
85
  }
@@ -104,6 +107,7 @@ export function FunctionVersionToJSONTyped(value, ignoreDiscriminator = false) {
104
107
  'timeout': value['timeout'],
105
108
  'idle_timeout': value['idleTimeout'],
106
109
  'max_concurrency': value['maxConcurrency'],
110
+ 'secrets': value['secrets'],
107
111
  'created_at': value['createdAt'].toISOString(),
108
112
  };
109
113
  }
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import type { InstanceConnection } from './InstanceConnection';
13
13
  import type { InstanceGpuMemory } from './InstanceGpuMemory';
14
+ import type { InstanceDedicatedIP } from './InstanceDedicatedIP';
14
15
  /**
15
16
  *
16
17
  * @export
@@ -137,6 +138,18 @@ export interface Instance {
137
138
  * @memberof Instance
138
139
  */
139
140
  unreachableSince?: Date;
141
+ /**
142
+ * How far a launch that is not ready yet has got. machine_requested means the machine was requested and no image download has been reported yet; pulling_image means the image is downloading or unpacking; setting_up means the container is up and the platform is finishing SSH and the GPU check. Present only while status is allocating or starting and the platform is following the boot; absent otherwise. Lets a client with a fixed timeout tell a launch that is still moving from one that is stuck.
143
+ * @type {InstanceBootPhaseEnum}
144
+ * @memberof Instance
145
+ */
146
+ bootPhase?: InstanceBootPhaseEnum;
147
+ /**
148
+ *
149
+ * @type {InstanceDedicatedIP}
150
+ * @memberof Instance
151
+ */
152
+ dedicatedIp?: InstanceDedicatedIP;
140
153
  }
141
154
  /**
142
155
  * @export
@@ -160,6 +173,15 @@ export declare const InstanceTierEnum: {
160
173
  readonly OnDemand: "on_demand";
161
174
  };
162
175
  export type InstanceTierEnum = typeof InstanceTierEnum[keyof typeof InstanceTierEnum];
176
+ /**
177
+ * @export
178
+ */
179
+ export declare const InstanceBootPhaseEnum: {
180
+ readonly MachineRequested: "machine_requested";
181
+ readonly PullingImage: "pulling_image";
182
+ readonly SettingUp: "setting_up";
183
+ };
184
+ export type InstanceBootPhaseEnum = typeof InstanceBootPhaseEnum[keyof typeof InstanceBootPhaseEnum];
163
185
  /**
164
186
  * Check if a given object implements the Instance interface.
165
187
  */
@@ -13,6 +13,7 @@
13
13
  */
14
14
  import { InstanceConnectionFromJSON, InstanceConnectionToJSON, } from './InstanceConnection';
15
15
  import { InstanceGpuMemoryFromJSON, InstanceGpuMemoryToJSON, } from './InstanceGpuMemory';
16
+ import { InstanceDedicatedIPFromJSON, InstanceDedicatedIPToJSON, } from './InstanceDedicatedIP';
16
17
  /**
17
18
  * @export
18
19
  */
@@ -33,6 +34,14 @@ export const InstanceTierEnum = {
33
34
  Spot: 'spot',
34
35
  OnDemand: 'on_demand'
35
36
  };
37
+ /**
38
+ * @export
39
+ */
40
+ export const InstanceBootPhaseEnum = {
41
+ MachineRequested: 'machine_requested',
42
+ PullingImage: 'pulling_image',
43
+ SettingUp: 'setting_up'
44
+ };
36
45
  /**
37
46
  * Check if a given object implements the Instance interface.
38
47
  */
@@ -83,6 +92,8 @@ export function InstanceFromJSONTyped(json, ignoreDiscriminator) {
83
92
  'terminatedAt': json['terminated_at'] == null ? undefined : (new Date(json['terminated_at'])),
84
93
  'lastReachableAt': json['last_reachable_at'] == null ? undefined : (new Date(json['last_reachable_at'])),
85
94
  'unreachableSince': json['unreachable_since'] == null ? undefined : (new Date(json['unreachable_since'])),
95
+ 'bootPhase': json['boot_phase'] == null ? undefined : json['boot_phase'],
96
+ 'dedicatedIp': json['dedicated_ip'] == null ? undefined : InstanceDedicatedIPFromJSON(json['dedicated_ip']),
86
97
  };
87
98
  }
88
99
  export function InstanceToJSON(json) {
@@ -113,5 +124,7 @@ export function InstanceToJSONTyped(value, ignoreDiscriminator = false) {
113
124
  'terminated_at': value['terminatedAt'] == null ? value['terminatedAt'] : value['terminatedAt'].toISOString(),
114
125
  'last_reachable_at': value['lastReachableAt'] == null ? value['lastReachableAt'] : value['lastReachableAt'].toISOString(),
115
126
  'unreachable_since': value['unreachableSince'] == null ? value['unreachableSince'] : value['unreachableSince'].toISOString(),
127
+ 'boot_phase': value['bootPhase'],
128
+ 'dedicated_ip': InstanceDedicatedIPToJSON(value['dedicatedIp']),
116
129
  };
117
130
  }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * The instance's dedicated public IPv4 add-on. Present only on instances launched with `dedicated_ip`, and only on deployments where the add-on is enabled.
14
+ * @export
15
+ * @interface InstanceDedicatedIP
16
+ */
17
+ export interface InstanceDedicatedIP {
18
+ /**
19
+ * The GPU.ai-owned public IPv4 address. Point your DNS A record here.
20
+ * @type {string}
21
+ * @memberof InstanceDedicatedIP
22
+ */
23
+ address: string;
24
+ /**
25
+ * Inbound TCP ports forwarded to the same port on the instance's loopback.
26
+ * @type {Array<number>}
27
+ * @memberof InstanceDedicatedIP
28
+ */
29
+ ports: Array<number>;
30
+ /**
31
+ * active means traffic is forwarded. suspended means forwarding has stopped (see suspend_reason), for example after the transfer cap was reached. released means the address was returned because the instance terminated or failed.
32
+ * @type {InstanceDedicatedIPStatusEnum}
33
+ * @memberof InstanceDedicatedIP
34
+ */
35
+ status: InstanceDedicatedIPStatusEnum;
36
+ /**
37
+ * Why forwarding is suspended, e.g. `transfer_cap`. Present only while suspended.
38
+ * @type {string}
39
+ * @memberof InstanceDedicatedIP
40
+ */
41
+ suspendReason?: string;
42
+ /**
43
+ * USD per hour charged while the address is attached, locked at launch.
44
+ * @type {number}
45
+ * @memberof InstanceDedicatedIP
46
+ */
47
+ hourlyFee: number;
48
+ /**
49
+ * USD per GB of traffic through the address, both directions, locked at launch.
50
+ * @type {number}
51
+ * @memberof InstanceDedicatedIP
52
+ */
53
+ transferPricePerGb: number;
54
+ /**
55
+ * GB transferred through the address so far, both directions.
56
+ * @type {number}
57
+ * @memberof InstanceDedicatedIP
58
+ */
59
+ transferGb: number;
60
+ /**
61
+ * Total charged for this address so far (hourly fee plus transfer), in USD.
62
+ * @type {number}
63
+ * @memberof InstanceDedicatedIP
64
+ */
65
+ chargedUsd: number;
66
+ }
67
+ /**
68
+ * @export
69
+ */
70
+ export declare const InstanceDedicatedIPStatusEnum: {
71
+ readonly Active: "active";
72
+ readonly Suspended: "suspended";
73
+ readonly Released: "released";
74
+ };
75
+ export type InstanceDedicatedIPStatusEnum = typeof InstanceDedicatedIPStatusEnum[keyof typeof InstanceDedicatedIPStatusEnum];
76
+ /**
77
+ * Check if a given object implements the InstanceDedicatedIP interface.
78
+ */
79
+ export declare function instanceOfInstanceDedicatedIP(value: object): value is InstanceDedicatedIP;
80
+ export declare function InstanceDedicatedIPFromJSON(json: any): InstanceDedicatedIP;
81
+ export declare function InstanceDedicatedIPFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstanceDedicatedIP;
82
+ export declare function InstanceDedicatedIPToJSON(json: any): InstanceDedicatedIP;
83
+ export declare function InstanceDedicatedIPToJSONTyped(value?: InstanceDedicatedIP | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,77 @@
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
+ * @export
16
+ */
17
+ export const InstanceDedicatedIPStatusEnum = {
18
+ Active: 'active',
19
+ Suspended: 'suspended',
20
+ Released: 'released'
21
+ };
22
+ /**
23
+ * Check if a given object implements the InstanceDedicatedIP interface.
24
+ */
25
+ export function instanceOfInstanceDedicatedIP(value) {
26
+ if (!('address' in value) || value['address'] === undefined)
27
+ return false;
28
+ if (!('ports' in value) || value['ports'] === undefined)
29
+ return false;
30
+ if (!('status' in value) || value['status'] === undefined)
31
+ return false;
32
+ if ((!('hourlyFee' in value) && !('hourly_fee' in value)) || (value['hourlyFee'] === undefined && value['hourly_fee'] === undefined))
33
+ return false;
34
+ if ((!('transferPricePerGb' in value) && !('transfer_price_per_gb' in value)) || (value['transferPricePerGb'] === undefined && value['transfer_price_per_gb'] === undefined))
35
+ return false;
36
+ if ((!('transferGb' in value) && !('transfer_gb' in value)) || (value['transferGb'] === undefined && value['transfer_gb'] === undefined))
37
+ return false;
38
+ if ((!('chargedUsd' in value) && !('charged_usd' in value)) || (value['chargedUsd'] === undefined && value['charged_usd'] === undefined))
39
+ return false;
40
+ return true;
41
+ }
42
+ export function InstanceDedicatedIPFromJSON(json) {
43
+ return InstanceDedicatedIPFromJSONTyped(json, false);
44
+ }
45
+ export function InstanceDedicatedIPFromJSONTyped(json, ignoreDiscriminator) {
46
+ if (json == null) {
47
+ return json;
48
+ }
49
+ return {
50
+ 'address': json['address'],
51
+ 'ports': json['ports'],
52
+ 'status': json['status'],
53
+ 'suspendReason': json['suspend_reason'] == null ? undefined : json['suspend_reason'],
54
+ 'hourlyFee': json['hourly_fee'],
55
+ 'transferPricePerGb': json['transfer_price_per_gb'],
56
+ 'transferGb': json['transfer_gb'],
57
+ 'chargedUsd': json['charged_usd'],
58
+ };
59
+ }
60
+ export function InstanceDedicatedIPToJSON(json) {
61
+ return InstanceDedicatedIPToJSONTyped(json, false);
62
+ }
63
+ export function InstanceDedicatedIPToJSONTyped(value, ignoreDiscriminator = false) {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+ return {
68
+ 'address': value['address'],
69
+ 'ports': value['ports'],
70
+ 'status': value['status'],
71
+ 'suspend_reason': value['suspendReason'],
72
+ 'hourly_fee': value['hourlyFee'],
73
+ 'transfer_price_per_gb': value['transferPricePerGb'],
74
+ 'transfer_gb': value['transferGb'],
75
+ 'charged_usd': value['chargedUsd'],
76
+ };
77
+ }
@@ -71,6 +71,18 @@ export interface Model {
71
71
  * @memberof Model
72
72
  */
73
73
  supportedParameters?: Array<string>;
74
+ /**
75
+ * Chat models only. True when POST /v1/chat/completions accepts tools / tool_choice / parallel_tool_calls for this model and tier.
76
+ * @type {boolean}
77
+ * @memberof Model
78
+ */
79
+ supportsTools?: boolean;
80
+ /**
81
+ * Chat models only. True when POST /v1/chat/completions accepts response_format json_object / json_schema for this model and tier.
82
+ * @type {boolean}
83
+ * @memberof Model
84
+ */
85
+ supportsStructuredOutputs?: boolean;
74
86
  /**
75
87
  * Typed parameter descriptors for media (image/video) models — name, type, enum/bounds/default. Playgrounds render input forms from these.
76
88
  * @type {Array<ModelParametersInner>}
@@ -73,6 +73,8 @@ export function ModelFromJSONTyped(json, ignoreDiscriminator) {
73
73
  'category': json['category'] == null ? undefined : json['category'],
74
74
  'contextLength': json['context_length'] == null ? undefined : json['context_length'],
75
75
  'supportedParameters': json['supported_parameters'] == null ? undefined : json['supported_parameters'],
76
+ 'supportsTools': json['supports_tools'] == null ? undefined : json['supports_tools'],
77
+ 'supportsStructuredOutputs': json['supports_structured_outputs'] == null ? undefined : json['supports_structured_outputs'],
76
78
  'parameters': json['parameters'] == null ? undefined : (json['parameters'].map(ModelParametersInnerFromJSON)),
77
79
  'pricing': ModelPricingFromJSON(json['pricing']),
78
80
  'aliases': json['aliases'] == null ? undefined : json['aliases'],
@@ -98,6 +100,8 @@ export function ModelToJSONTyped(value, ignoreDiscriminator = false) {
98
100
  'category': value['category'],
99
101
  'context_length': value['contextLength'],
100
102
  'supported_parameters': value['supportedParameters'],
103
+ 'supports_tools': value['supportsTools'],
104
+ 'supports_structured_outputs': value['supportsStructuredOutputs'],
101
105
  'parameters': value['parameters'] == null ? undefined : (value['parameters'].map(ModelParametersInnerToJSON)),
102
106
  'pricing': ModelPricingToJSON(value['pricing']),
103
107
  'aliases': value['aliases'],
@@ -69,6 +69,8 @@ export declare const ProblemCodeEnum: {
69
69
  readonly ModelTooLarge: "model_too_large";
70
70
  readonly GpuVramTooSmall: "gpu_vram_too_small";
71
71
  readonly PriceChanged: "price_changed";
72
+ readonly DedicatedIpLimit: "dedicated_ip_limit";
73
+ readonly DedicatedIpUnavailable: "dedicated_ip_unavailable";
72
74
  readonly InsufficientBalance: "insufficient_balance";
73
75
  readonly QuotaExceeded: "quota_exceeded";
74
76
  readonly RateLimited: "rate_limited";
@@ -28,6 +28,8 @@ export const ProblemCodeEnum = {
28
28
  ModelTooLarge: 'model_too_large',
29
29
  GpuVramTooSmall: 'gpu_vram_too_small',
30
30
  PriceChanged: 'price_changed',
31
+ DedicatedIpLimit: 'dedicated_ip_limit',
32
+ DedicatedIpUnavailable: 'dedicated_ip_unavailable',
31
33
  InsufficientBalance: 'insufficient_balance',
32
34
  QuotaExceeded: 'quota_exceeded',
33
35
  RateLimited: 'rate_limited',
@@ -6,8 +6,17 @@ export * from './Balance';
6
6
  export * from './BillingDetails';
7
7
  export * from './ChatChoice';
8
8
  export * from './ChatCompletionRequest';
9
+ export * from './ChatCompletionRequestToolChoice';
9
10
  export * from './ChatCompletionResponse';
11
+ export * from './ChatJSONSchemaFormat';
10
12
  export * from './ChatMessage';
13
+ export * from './ChatNamedToolChoice';
14
+ export * from './ChatNamedToolChoiceFunction';
15
+ export * from './ChatResponseFormat';
16
+ export * from './ChatTool';
17
+ export * from './ChatToolCall';
18
+ export * from './ChatToolCallFunction';
19
+ export * from './ChatToolFunction';
11
20
  export * from './CommunityMachine';
12
21
  export * from './CommunityMachineDelistResult';
13
22
  export * from './CommunityMachineRegistration';
@@ -26,6 +35,7 @@ export * from './CreateRegistryCredentialRequest';
26
35
  export * from './CreateSshKeyRequest';
27
36
  export * from './CreateWebhookEndpointRequest';
28
37
  export * from './CryptoDeposit';
38
+ export * from './DedicatedIPRequest';
29
39
  export * from './Embedding';
30
40
  export * from './EmbeddingsRequest';
31
41
  export * from './EmbeddingsRequestInput';
@@ -63,6 +73,7 @@ export * from './ImagesResponseUsage';
63
73
  export * from './IncludeItem';
64
74
  export * from './Instance';
65
75
  export * from './InstanceConnection';
76
+ export * from './InstanceDedicatedIP';
66
77
  export * from './InstanceGpuMemory';
67
78
  export * from './InstancePage';
68
79
  export * from './Invoice';
@@ -8,8 +8,17 @@ export * from './Balance';
8
8
  export * from './BillingDetails';
9
9
  export * from './ChatChoice';
10
10
  export * from './ChatCompletionRequest';
11
+ export * from './ChatCompletionRequestToolChoice';
11
12
  export * from './ChatCompletionResponse';
13
+ export * from './ChatJSONSchemaFormat';
12
14
  export * from './ChatMessage';
15
+ export * from './ChatNamedToolChoice';
16
+ export * from './ChatNamedToolChoiceFunction';
17
+ export * from './ChatResponseFormat';
18
+ export * from './ChatTool';
19
+ export * from './ChatToolCall';
20
+ export * from './ChatToolCallFunction';
21
+ export * from './ChatToolFunction';
13
22
  export * from './CommunityMachine';
14
23
  export * from './CommunityMachineDelistResult';
15
24
  export * from './CommunityMachineRegistration';
@@ -28,6 +37,7 @@ export * from './CreateRegistryCredentialRequest';
28
37
  export * from './CreateSshKeyRequest';
29
38
  export * from './CreateWebhookEndpointRequest';
30
39
  export * from './CryptoDeposit';
40
+ export * from './DedicatedIPRequest';
31
41
  export * from './Embedding';
32
42
  export * from './EmbeddingsRequest';
33
43
  export * from './EmbeddingsRequestInput';
@@ -65,6 +75,7 @@ export * from './ImagesResponseUsage';
65
75
  export * from './IncludeItem';
66
76
  export * from './Instance';
67
77
  export * from './InstanceConnection';
78
+ export * from './InstanceDedicatedIP';
68
79
  export * from './InstanceGpuMemory';
69
80
  export * from './InstancePage';
70
81
  export * from './Invoice';
@@ -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.4.1' }, this.configuration.headers);
64
+ return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.5.0' }, 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
+ }