@gpuai/sdk 0.4.2 → 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 +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/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 +7 -0
  79. package/dist/models/Instance.js +3 -0
  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 +2 -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 +15 -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,140 @@
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
+ * 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.
18
+ * @export
19
+ * @interface InstanceDedicatedIP
20
+ */
21
+ export interface InstanceDedicatedIP {
22
+ /**
23
+ * The GPU.ai-owned public IPv4 address. Point your DNS A record here.
24
+ * @type {string}
25
+ * @memberof InstanceDedicatedIP
26
+ */
27
+ address: string;
28
+ /**
29
+ * Inbound TCP ports forwarded to the same port on the instance's loopback.
30
+ * @type {Array<number>}
31
+ * @memberof InstanceDedicatedIP
32
+ */
33
+ ports: Array<number>;
34
+ /**
35
+ * 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.
36
+ * @type {InstanceDedicatedIPStatusEnum}
37
+ * @memberof InstanceDedicatedIP
38
+ */
39
+ status: InstanceDedicatedIPStatusEnum;
40
+ /**
41
+ * Why forwarding is suspended, e.g. `transfer_cap`. Present only while suspended.
42
+ * @type {string}
43
+ * @memberof InstanceDedicatedIP
44
+ */
45
+ suspendReason?: string;
46
+ /**
47
+ * USD per hour charged while the address is attached, locked at launch.
48
+ * @type {number}
49
+ * @memberof InstanceDedicatedIP
50
+ */
51
+ hourlyFee: number;
52
+ /**
53
+ * USD per GB of traffic through the address, both directions, locked at launch.
54
+ * @type {number}
55
+ * @memberof InstanceDedicatedIP
56
+ */
57
+ transferPricePerGb: number;
58
+ /**
59
+ * GB transferred through the address so far, both directions.
60
+ * @type {number}
61
+ * @memberof InstanceDedicatedIP
62
+ */
63
+ transferGb: number;
64
+ /**
65
+ * Total charged for this address so far (hourly fee plus transfer), in USD.
66
+ * @type {number}
67
+ * @memberof InstanceDedicatedIP
68
+ */
69
+ chargedUsd: number;
70
+ }
71
+
72
+
73
+ /**
74
+ * @export
75
+ */
76
+ export const InstanceDedicatedIPStatusEnum = {
77
+ Active: 'active',
78
+ Suspended: 'suspended',
79
+ Released: 'released'
80
+ } as const;
81
+ export type InstanceDedicatedIPStatusEnum = typeof InstanceDedicatedIPStatusEnum[keyof typeof InstanceDedicatedIPStatusEnum];
82
+
83
+
84
+ /**
85
+ * Check if a given object implements the InstanceDedicatedIP interface.
86
+ */
87
+ export function instanceOfInstanceDedicatedIP(value: object): value is InstanceDedicatedIP {
88
+ if (!('address' in value) || value['address'] === undefined) return false;
89
+ if (!('ports' in value) || value['ports'] === undefined) return false;
90
+ if (!('status' in value) || value['status'] === undefined) return false;
91
+ if ((!('hourlyFee' in (value as Record<string, any>)) && !('hourly_fee' in (value as Record<string, any>))) || ((value as Record<string, any>)['hourlyFee'] === undefined && (value as Record<string, any>)['hourly_fee'] === undefined)) return false;
92
+ if ((!('transferPricePerGb' in (value as Record<string, any>)) && !('transfer_price_per_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['transferPricePerGb'] === undefined && (value as Record<string, any>)['transfer_price_per_gb'] === undefined)) return false;
93
+ if ((!('transferGb' in (value as Record<string, any>)) && !('transfer_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['transferGb'] === undefined && (value as Record<string, any>)['transfer_gb'] === undefined)) return false;
94
+ if ((!('chargedUsd' in (value as Record<string, any>)) && !('charged_usd' in (value as Record<string, any>))) || ((value as Record<string, any>)['chargedUsd'] === undefined && (value as Record<string, any>)['charged_usd'] === undefined)) return false;
95
+ return true;
96
+ }
97
+
98
+ export function InstanceDedicatedIPFromJSON(json: any): InstanceDedicatedIP {
99
+ return InstanceDedicatedIPFromJSONTyped(json, false);
100
+ }
101
+
102
+ export function InstanceDedicatedIPFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstanceDedicatedIP {
103
+ if (json == null) {
104
+ return json;
105
+ }
106
+ return {
107
+
108
+ 'address': json['address'],
109
+ 'ports': json['ports'],
110
+ 'status': json['status'],
111
+ 'suspendReason': json['suspend_reason'] == null ? undefined : json['suspend_reason'],
112
+ 'hourlyFee': json['hourly_fee'],
113
+ 'transferPricePerGb': json['transfer_price_per_gb'],
114
+ 'transferGb': json['transfer_gb'],
115
+ 'chargedUsd': json['charged_usd'],
116
+ };
117
+ }
118
+
119
+ export function InstanceDedicatedIPToJSON(json: any): InstanceDedicatedIP {
120
+ return InstanceDedicatedIPToJSONTyped(json, false);
121
+ }
122
+
123
+ export function InstanceDedicatedIPToJSONTyped(value?: InstanceDedicatedIP | null, ignoreDiscriminator: boolean = false): any {
124
+ if (value == null) {
125
+ return value;
126
+ }
127
+
128
+ return {
129
+
130
+ 'address': value['address'],
131
+ 'ports': value['ports'],
132
+ 'status': value['status'],
133
+ 'suspend_reason': value['suspendReason'],
134
+ 'hourly_fee': value['hourlyFee'],
135
+ 'transfer_price_per_gb': value['transferPricePerGb'],
136
+ 'transfer_gb': value['transferGb'],
137
+ 'charged_usd': value['chargedUsd'],
138
+ };
139
+ }
140
+
@@ -88,6 +88,18 @@ export interface Model {
88
88
  * @memberof Model
89
89
  */
90
90
  supportedParameters?: Array<string>;
91
+ /**
92
+ * Chat models only. True when POST /v1/chat/completions accepts tools / tool_choice / parallel_tool_calls for this model and tier.
93
+ * @type {boolean}
94
+ * @memberof Model
95
+ */
96
+ supportsTools?: boolean;
97
+ /**
98
+ * Chat models only. True when POST /v1/chat/completions accepts response_format json_object / json_schema for this model and tier.
99
+ * @type {boolean}
100
+ * @memberof Model
101
+ */
102
+ supportsStructuredOutputs?: boolean;
91
103
  /**
92
104
  * Typed parameter descriptors for media (image/video) models — name, type, enum/bounds/default. Playgrounds render input forms from these.
93
105
  * @type {Array<ModelParametersInner>}
@@ -191,6 +203,8 @@ export function ModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): Mod
191
203
  'category': json['category'] == null ? undefined : json['category'],
192
204
  'contextLength': json['context_length'] == null ? undefined : json['context_length'],
193
205
  'supportedParameters': json['supported_parameters'] == null ? undefined : json['supported_parameters'],
206
+ 'supportsTools': json['supports_tools'] == null ? undefined : json['supports_tools'],
207
+ 'supportsStructuredOutputs': json['supports_structured_outputs'] == null ? undefined : json['supports_structured_outputs'],
194
208
  'parameters': json['parameters'] == null ? undefined : ((json['parameters'] as Array<any>).map(ModelParametersInnerFromJSON)),
195
209
  'pricing': ModelPricingFromJSON(json['pricing']),
196
210
  'aliases': json['aliases'] == null ? undefined : json['aliases'],
@@ -220,6 +234,8 @@ export function ModelToJSONTyped(value?: Model | null, ignoreDiscriminator: bool
220
234
  'category': value['category'],
221
235
  'context_length': value['contextLength'],
222
236
  'supported_parameters': value['supportedParameters'],
237
+ 'supports_tools': value['supportsTools'],
238
+ 'supports_structured_outputs': value['supportsStructuredOutputs'],
223
239
  'parameters': value['parameters'] == null ? undefined : ((value['parameters'] as Array<any>).map(ModelParametersInnerToJSON)),
224
240
  'pricing': ModelPricingToJSON(value['pricing']),
225
241
  'aliases': value['aliases'],
@@ -75,6 +75,8 @@ export const ProblemCodeEnum = {
75
75
  ModelTooLarge: 'model_too_large',
76
76
  GpuVramTooSmall: 'gpu_vram_too_small',
77
77
  PriceChanged: 'price_changed',
78
+ DedicatedIpLimit: 'dedicated_ip_limit',
79
+ DedicatedIpUnavailable: 'dedicated_ip_unavailable',
78
80
  InsufficientBalance: 'insufficient_balance',
79
81
  QuotaExceeded: 'quota_exceeded',
80
82
  RateLimited: 'rate_limited',
@@ -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';
package/src/runtime.ts CHANGED
@@ -75,7 +75,7 @@ export class Configuration {
75
75
  }
76
76
 
77
77
  get headers(): HTTPHeaders | undefined {
78
- return { 'User-Agent': 'gpuai-sdk-ts/0.4.2', ...this.configuration.headers };
78
+ return { 'User-Agent': 'gpuai-sdk-ts/0.5.0', ...this.configuration.headers };
79
79
  }
80
80
 
81
81
  get credentials(): RequestCredentials | undefined {