@gpuai/sdk 0.3.12 → 0.3.14

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 (132) hide show
  1. package/.openapi-generator/FILES +36 -0
  2. package/README.md +38 -9
  3. package/dist/apis/AutolaunchApi.d.ts +109 -0
  4. package/dist/apis/AutolaunchApi.js +286 -0
  5. package/dist/apis/InferenceApi.d.ts +19 -0
  6. package/dist/apis/InferenceApi.js +51 -0
  7. package/dist/apis/MarketApi.d.ts +56 -0
  8. package/dist/apis/MarketApi.js +112 -0
  9. package/dist/apis/WatchApi.d.ts +109 -0
  10. package/dist/apis/WatchApi.js +286 -0
  11. package/dist/apis/index.d.ts +3 -0
  12. package/dist/apis/index.js +3 -0
  13. package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
  14. package/dist/esm/apis/AutolaunchApi.js +282 -0
  15. package/dist/esm/apis/InferenceApi.d.ts +19 -0
  16. package/dist/esm/apis/InferenceApi.js +51 -0
  17. package/dist/esm/apis/MarketApi.d.ts +56 -0
  18. package/dist/esm/apis/MarketApi.js +108 -0
  19. package/dist/esm/apis/WatchApi.d.ts +109 -0
  20. package/dist/esm/apis/WatchApi.js +282 -0
  21. package/dist/esm/apis/index.d.ts +3 -0
  22. package/dist/esm/apis/index.js +3 -0
  23. package/dist/esm/models/AutolaunchRule.d.ts +181 -0
  24. package/dist/esm/models/AutolaunchRule.js +142 -0
  25. package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
  26. package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
  27. package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
  28. package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
  29. package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
  30. package/dist/esm/models/AutolaunchRulePage.js +48 -0
  31. package/dist/esm/models/Embedding.d.ts +51 -0
  32. package/dist/esm/models/Embedding.js +59 -0
  33. package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
  34. package/dist/esm/models/EmbeddingsRequest.js +60 -0
  35. package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
  36. package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
  37. package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
  38. package/dist/esm/models/EmbeddingsResponse.js +65 -0
  39. package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
  40. package/dist/esm/models/EmbeddingsUsage.js +47 -0
  41. package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
  42. package/dist/esm/models/MarketHistoryPoint.js +55 -0
  43. package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
  44. package/dist/esm/models/MarketHistoryResponse.js +60 -0
  45. package/dist/esm/models/Problem.d.ts +1 -0
  46. package/dist/esm/models/Problem.js +1 -0
  47. package/dist/esm/models/WatchRule.d.ts +141 -0
  48. package/dist/esm/models/WatchRule.js +117 -0
  49. package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
  50. package/dist/esm/models/WatchRuleCreate.js +72 -0
  51. package/dist/esm/models/WatchRulePage.d.ts +39 -0
  52. package/dist/esm/models/WatchRulePage.js +48 -0
  53. package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
  54. package/dist/esm/models/WatchRuleUpdate.js +68 -0
  55. package/dist/esm/models/index.d.ts +15 -0
  56. package/dist/esm/models/index.js +15 -0
  57. package/dist/models/AutolaunchRule.d.ts +181 -0
  58. package/dist/models/AutolaunchRule.js +150 -0
  59. package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
  60. package/dist/models/AutolaunchRuleCreate.js +92 -0
  61. package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
  62. package/dist/models/AutolaunchRuleDisarm.js +50 -0
  63. package/dist/models/AutolaunchRulePage.d.ts +39 -0
  64. package/dist/models/AutolaunchRulePage.js +55 -0
  65. package/dist/models/Embedding.d.ts +51 -0
  66. package/dist/models/Embedding.js +67 -0
  67. package/dist/models/EmbeddingsRequest.d.ts +64 -0
  68. package/dist/models/EmbeddingsRequest.js +68 -0
  69. package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
  70. package/dist/models/EmbeddingsRequestInput.js +53 -0
  71. package/dist/models/EmbeddingsResponse.d.ts +59 -0
  72. package/dist/models/EmbeddingsResponse.js +73 -0
  73. package/dist/models/EmbeddingsUsage.d.ts +38 -0
  74. package/dist/models/EmbeddingsUsage.js +54 -0
  75. package/dist/models/MarketHistoryPoint.d.ts +59 -0
  76. package/dist/models/MarketHistoryPoint.js +62 -0
  77. package/dist/models/MarketHistoryResponse.d.ts +60 -0
  78. package/dist/models/MarketHistoryResponse.js +67 -0
  79. package/dist/models/Problem.d.ts +1 -0
  80. package/dist/models/Problem.js +1 -0
  81. package/dist/models/WatchRule.d.ts +141 -0
  82. package/dist/models/WatchRule.js +125 -0
  83. package/dist/models/WatchRuleCreate.d.ts +87 -0
  84. package/dist/models/WatchRuleCreate.js +80 -0
  85. package/dist/models/WatchRulePage.d.ts +39 -0
  86. package/dist/models/WatchRulePage.js +55 -0
  87. package/dist/models/WatchRuleUpdate.d.ts +86 -0
  88. package/dist/models/WatchRuleUpdate.js +76 -0
  89. package/dist/models/index.d.ts +15 -0
  90. package/dist/models/index.js +15 -0
  91. package/docs/AutolaunchApi.md +390 -0
  92. package/docs/AutolaunchRule.md +69 -0
  93. package/docs/AutolaunchRuleCreate.md +50 -0
  94. package/docs/AutolaunchRuleDisarm.md +35 -0
  95. package/docs/AutolaunchRulePage.md +36 -0
  96. package/docs/Embedding.md +38 -0
  97. package/docs/EmbeddingsRequest.md +42 -0
  98. package/docs/EmbeddingsRequestInput.md +33 -0
  99. package/docs/EmbeddingsResponse.md +40 -0
  100. package/docs/EmbeddingsUsage.md +37 -0
  101. package/docs/InferenceApi.md +83 -0
  102. package/docs/MarketApi.md +98 -0
  103. package/docs/MarketHistoryPoint.md +43 -0
  104. package/docs/MarketHistoryResponse.md +43 -0
  105. package/docs/WatchApi.md +389 -0
  106. package/docs/WatchRule.md +61 -0
  107. package/docs/WatchRuleCreate.md +46 -0
  108. package/docs/WatchRulePage.md +36 -0
  109. package/docs/WatchRuleUpdate.md +47 -0
  110. package/package.json +1 -1
  111. package/src/apis/AutolaunchApi.ts +360 -0
  112. package/src/apis/InferenceApi.ts +71 -0
  113. package/src/apis/MarketApi.ts +136 -0
  114. package/src/apis/WatchApi.ts +360 -0
  115. package/src/apis/index.ts +3 -0
  116. package/src/models/AutolaunchRule.ts +270 -0
  117. package/src/models/AutolaunchRuleCreate.ts +162 -0
  118. package/src/models/AutolaunchRuleDisarm.ts +68 -0
  119. package/src/models/AutolaunchRulePage.ts +83 -0
  120. package/src/models/Embedding.ts +96 -0
  121. package/src/models/EmbeddingsRequest.ts +117 -0
  122. package/src/models/EmbeddingsRequestInput.ts +59 -0
  123. package/src/models/EmbeddingsResponse.ts +120 -0
  124. package/src/models/EmbeddingsUsage.ts +75 -0
  125. package/src/models/MarketHistoryPoint.ts +103 -0
  126. package/src/models/MarketHistoryResponse.ts +113 -0
  127. package/src/models/Problem.ts +1 -0
  128. package/src/models/WatchRule.ts +219 -0
  129. package/src/models/WatchRuleCreate.ts +138 -0
  130. package/src/models/WatchRulePage.ts +83 -0
  131. package/src/models/WatchRuleUpdate.ts +135 -0
  132. package/src/models/index.ts +15 -0
@@ -0,0 +1,162 @@
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 AutolaunchRuleCreate
20
+ */
21
+ export interface AutolaunchRuleCreate {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof AutolaunchRuleCreate
26
+ */
27
+ gpuModel: string;
28
+ /**
29
+ * Omit or send null to consider every region.
30
+ * @type {string}
31
+ * @memberof AutolaunchRuleCreate
32
+ */
33
+ region?: string | null;
34
+ /**
35
+ * Omit or send null to consider both capacity classes.
36
+ * @type {AutolaunchRuleCreateCapacityClassEnum}
37
+ * @memberof AutolaunchRuleCreate
38
+ */
39
+ capacityClass?: AutolaunchRuleCreateCapacityClassEnum | null;
40
+ /**
41
+ *
42
+ * @type {AutolaunchRuleCreateConditionKindEnum}
43
+ * @memberof AutolaunchRuleCreate
44
+ */
45
+ conditionKind: AutolaunchRuleCreateConditionKindEnum;
46
+ /**
47
+ * The TRIGGER, in dollars PER GPU-HOUR for price_under or a unit count for count_at_least. Required and greater than zero for both. Ignored for in_stock. Not the spend cap. Values above the maximum are refused with a 422 naming the bound — it is the largest value the column stores.
48
+ *
49
+ * @type {number}
50
+ * @memberof AutolaunchRuleCreate
51
+ */
52
+ threshold?: number | null;
53
+ /**
54
+ * The CEILING, in dollars per hour for the WHOLE INSTANCE. Required even for in_stock rules: "buy it when it comes back" with no ceiling is an unbounded authorization, and this resource has no such shape. Values above the maximum are refused with a 422 naming the bound.
55
+ *
56
+ * @type {number}
57
+ * @memberof AutolaunchRuleCreate
58
+ */
59
+ maxPricePerHour: number;
60
+ /**
61
+ *
62
+ * @type {number}
63
+ * @memberof AutolaunchRuleCreate
64
+ */
65
+ maxRuntimeHours: number;
66
+ /**
67
+ * The full create-instance body this rule freezes and replays — the same shape POST /v1/instances accepts. It is modelled as an open object rather than a $ref because the instance-create body is an inline requestBody schema rather than a named component; promoting it would rewrite the instances operation and every generated client's signature for it, in a change that only needs to STORE one.
68
+ *
69
+ * Two fields behave differently here than on a live create: `offering_id` is REJECTED (a pinned offering produces a rule that can never fire, because offering identity churns between catalog polls), and `auto_terminate_hours` is OVERWRITTEN from the rule's `max_runtime_hours` so a nested field cannot widen the runtime bound the customer approved.
70
+ *
71
+ * @type {{ [key: string]: any; }}
72
+ * @memberof AutolaunchRuleCreate
73
+ */
74
+ spec: { [key: string]: any; };
75
+ /**
76
+ * REQUIRED. Echo of the worst-case total, max_price_per_hour × max_runtime_hours, accepted within one cent. This is the consent gate: a caller that never computed this number cannot have shown it to the person approving the rule, and a caller that displayed a different number disagrees with what is about to be stored. Either way the request is refused so the caller can re-render the real figure.
77
+ *
78
+ * @type {number}
79
+ * @memberof AutolaunchRuleCreate
80
+ */
81
+ acknowledgedMaxTotalUsd: number;
82
+ }
83
+
84
+
85
+ /**
86
+ * @export
87
+ */
88
+ export const AutolaunchRuleCreateCapacityClassEnum = {
89
+ Secure: 'secure',
90
+ Community: 'community'
91
+ } as const;
92
+ export type AutolaunchRuleCreateCapacityClassEnum = typeof AutolaunchRuleCreateCapacityClassEnum[keyof typeof AutolaunchRuleCreateCapacityClassEnum];
93
+
94
+ /**
95
+ * @export
96
+ */
97
+ export const AutolaunchRuleCreateConditionKindEnum = {
98
+ PriceUnder: 'price_under',
99
+ InStock: 'in_stock',
100
+ CountAtLeast: 'count_at_least'
101
+ } as const;
102
+ export type AutolaunchRuleCreateConditionKindEnum = typeof AutolaunchRuleCreateConditionKindEnum[keyof typeof AutolaunchRuleCreateConditionKindEnum];
103
+
104
+
105
+ /**
106
+ * Check if a given object implements the AutolaunchRuleCreate interface.
107
+ */
108
+ export function instanceOfAutolaunchRuleCreate(value: object): value is AutolaunchRuleCreate {
109
+ if ((!('gpuModel' in (value as Record<string, any>)) && !('gpu_model' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuModel'] === undefined && (value as Record<string, any>)['gpu_model'] === undefined)) return false;
110
+ if ((!('conditionKind' in (value as Record<string, any>)) && !('condition_kind' in (value as Record<string, any>))) || ((value as Record<string, any>)['conditionKind'] === undefined && (value as Record<string, any>)['condition_kind'] === undefined)) return false;
111
+ if ((!('maxPricePerHour' in (value as Record<string, any>)) && !('max_price_per_hour' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxPricePerHour'] === undefined && (value as Record<string, any>)['max_price_per_hour'] === undefined)) return false;
112
+ if ((!('maxRuntimeHours' in (value as Record<string, any>)) && !('max_runtime_hours' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxRuntimeHours'] === undefined && (value as Record<string, any>)['max_runtime_hours'] === undefined)) return false;
113
+ if (!('spec' in value) || value['spec'] === undefined) return false;
114
+ if ((!('acknowledgedMaxTotalUsd' in (value as Record<string, any>)) && !('acknowledged_max_total_usd' in (value as Record<string, any>))) || ((value as Record<string, any>)['acknowledgedMaxTotalUsd'] === undefined && (value as Record<string, any>)['acknowledged_max_total_usd'] === undefined)) return false;
115
+ return true;
116
+ }
117
+
118
+ export function AutolaunchRuleCreateFromJSON(json: any): AutolaunchRuleCreate {
119
+ return AutolaunchRuleCreateFromJSONTyped(json, false);
120
+ }
121
+
122
+ export function AutolaunchRuleCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRuleCreate {
123
+ if (json == null) {
124
+ return json;
125
+ }
126
+ return {
127
+
128
+ 'gpuModel': json['gpu_model'],
129
+ 'region': json['region'] === undefined ? undefined : json['region'] === null ? null : json['region'],
130
+ 'capacityClass': json['capacity_class'] === undefined ? undefined : json['capacity_class'] === null ? null : json['capacity_class'],
131
+ 'conditionKind': json['condition_kind'],
132
+ 'threshold': json['threshold'] === undefined ? undefined : json['threshold'] === null ? null : json['threshold'],
133
+ 'maxPricePerHour': json['max_price_per_hour'],
134
+ 'maxRuntimeHours': json['max_runtime_hours'],
135
+ 'spec': json['spec'],
136
+ 'acknowledgedMaxTotalUsd': json['acknowledged_max_total_usd'],
137
+ };
138
+ }
139
+
140
+ export function AutolaunchRuleCreateToJSON(json: any): AutolaunchRuleCreate {
141
+ return AutolaunchRuleCreateToJSONTyped(json, false);
142
+ }
143
+
144
+ export function AutolaunchRuleCreateToJSONTyped(value?: AutolaunchRuleCreate | null, ignoreDiscriminator: boolean = false): any {
145
+ if (value == null) {
146
+ return value;
147
+ }
148
+
149
+ return {
150
+
151
+ 'gpu_model': value['gpuModel'],
152
+ 'region': value['region'],
153
+ 'capacity_class': value['capacityClass'],
154
+ 'condition_kind': value['conditionKind'],
155
+ 'threshold': value['threshold'],
156
+ 'max_price_per_hour': value['maxPricePerHour'],
157
+ 'max_runtime_hours': value['maxRuntimeHours'],
158
+ 'spec': value['spec'],
159
+ 'acknowledged_max_total_usd': value['acknowledgedMaxTotalUsd'],
160
+ };
161
+ }
162
+
@@ -0,0 +1,68 @@
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 entire PATCH surface. `enabled` must be present and must be false. Any other key is refused rather than accepted-and-ignored, because a PATCH carrying a new ceiling that returned 200 would leave the caller believing the cap had moved.
18
+ *
19
+ * @export
20
+ * @interface AutolaunchRuleDisarm
21
+ */
22
+ export interface AutolaunchRuleDisarm {
23
+ /**
24
+ * Must be false. Sending true is refused: a fired rule consumed its one shot, so "resume" would silently be an authorization nobody gave, and arming again is a create.
25
+ *
26
+ * @type {boolean}
27
+ * @memberof AutolaunchRuleDisarm
28
+ */
29
+ enabled: boolean;
30
+ }
31
+
32
+ /**
33
+ * Check if a given object implements the AutolaunchRuleDisarm interface.
34
+ */
35
+ export function instanceOfAutolaunchRuleDisarm(value: object): value is AutolaunchRuleDisarm {
36
+ if (!('enabled' in value) || value['enabled'] === undefined) return false;
37
+ return true;
38
+ }
39
+
40
+ export function AutolaunchRuleDisarmFromJSON(json: any): AutolaunchRuleDisarm {
41
+ return AutolaunchRuleDisarmFromJSONTyped(json, false);
42
+ }
43
+
44
+ export function AutolaunchRuleDisarmFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRuleDisarm {
45
+ if (json == null) {
46
+ return json;
47
+ }
48
+ return {
49
+
50
+ 'enabled': json['enabled'],
51
+ };
52
+ }
53
+
54
+ export function AutolaunchRuleDisarmToJSON(json: any): AutolaunchRuleDisarm {
55
+ return AutolaunchRuleDisarmToJSONTyped(json, false);
56
+ }
57
+
58
+ export function AutolaunchRuleDisarmToJSONTyped(value?: AutolaunchRuleDisarm | null, ignoreDiscriminator: boolean = false): any {
59
+ if (value == null) {
60
+ return value;
61
+ }
62
+
63
+ return {
64
+
65
+ 'enabled': value['enabled'],
66
+ };
67
+ }
68
+
@@ -0,0 +1,83 @@
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 { AutolaunchRule } from './AutolaunchRule';
17
+ import {
18
+ AutolaunchRuleFromJSON,
19
+ AutolaunchRuleFromJSONTyped,
20
+ AutolaunchRuleToJSON,
21
+ AutolaunchRuleToJSONTyped,
22
+ } from './AutolaunchRule';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface AutolaunchRulePage
28
+ */
29
+ export interface AutolaunchRulePage {
30
+ /**
31
+ *
32
+ * @type {Array<AutolaunchRule>}
33
+ * @memberof AutolaunchRulePage
34
+ */
35
+ data: Array<AutolaunchRule>;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AutolaunchRulePage
40
+ */
41
+ nextCursor: string | null;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the AutolaunchRulePage interface.
46
+ */
47
+ export function instanceOfAutolaunchRulePage(value: object): value is AutolaunchRulePage {
48
+ if (!('data' in value) || value['data'] === undefined) return false;
49
+ if ((!('nextCursor' in (value as Record<string, any>)) && !('next_cursor' in (value as Record<string, any>))) || ((value as Record<string, any>)['nextCursor'] === undefined && (value as Record<string, any>)['next_cursor'] === undefined)) return false;
50
+ return true;
51
+ }
52
+
53
+ export function AutolaunchRulePageFromJSON(json: any): AutolaunchRulePage {
54
+ return AutolaunchRulePageFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function AutolaunchRulePageFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRulePage {
58
+ if (json == null) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'data': ((json['data'] as Array<any>).map(AutolaunchRuleFromJSON)),
64
+ 'nextCursor': json['next_cursor'],
65
+ };
66
+ }
67
+
68
+ export function AutolaunchRulePageToJSON(json: any): AutolaunchRulePage {
69
+ return AutolaunchRulePageToJSONTyped(json, false);
70
+ }
71
+
72
+ export function AutolaunchRulePageToJSONTyped(value?: AutolaunchRulePage | null, ignoreDiscriminator: boolean = false): any {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+
77
+ return {
78
+
79
+ 'data': ((value['data'] as Array<any>).map(AutolaunchRuleToJSON)),
80
+ 'next_cursor': value['nextCursor'],
81
+ };
82
+ }
83
+
@@ -0,0 +1,96 @@
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 Embedding
20
+ */
21
+ export interface Embedding {
22
+ /**
23
+ *
24
+ * @type {EmbeddingObjectEnum}
25
+ * @memberof Embedding
26
+ */
27
+ object: EmbeddingObjectEnum;
28
+ /**
29
+ * The embedding vector as 32-bit floats.
30
+ * @type {Array<number>}
31
+ * @memberof Embedding
32
+ */
33
+ embedding: Array<number>;
34
+ /**
35
+ * Position of this vector's input in the request.
36
+ * @type {number}
37
+ * @memberof Embedding
38
+ */
39
+ index: number;
40
+ }
41
+
42
+
43
+ /**
44
+ * @export
45
+ */
46
+ export const EmbeddingObjectEnum = {
47
+ Embedding: 'embedding'
48
+ } as const;
49
+ export type EmbeddingObjectEnum = typeof EmbeddingObjectEnum[keyof typeof EmbeddingObjectEnum];
50
+
51
+
52
+ /**
53
+ * Check if a given object implements the Embedding interface.
54
+ */
55
+ export function instanceOfEmbedding(value: object): value is Embedding {
56
+ if (!('object' in value) || value['object'] === undefined) return false;
57
+ if (value['object'] !== 'embedding') return false;
58
+
59
+ if (!('embedding' in value) || value['embedding'] === undefined) return false;
60
+ if (!('index' in value) || value['index'] === undefined) return false;
61
+ return true;
62
+ }
63
+
64
+ export function EmbeddingFromJSON(json: any): Embedding {
65
+ return EmbeddingFromJSONTyped(json, false);
66
+ }
67
+
68
+ export function EmbeddingFromJSONTyped(json: any, ignoreDiscriminator: boolean): Embedding {
69
+ if (json == null) {
70
+ return json;
71
+ }
72
+ return {
73
+
74
+ 'object': json['object'],
75
+ 'embedding': json['embedding'],
76
+ 'index': json['index'],
77
+ };
78
+ }
79
+
80
+ export function EmbeddingToJSON(json: any): Embedding {
81
+ return EmbeddingToJSONTyped(json, false);
82
+ }
83
+
84
+ export function EmbeddingToJSONTyped(value?: Embedding | null, ignoreDiscriminator: boolean = false): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+
89
+ return {
90
+
91
+ 'object': value['object'],
92
+ 'embedding': value['embedding'],
93
+ 'index': value['index'],
94
+ };
95
+ }
96
+
@@ -0,0 +1,117 @@
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 { EmbeddingsRequestInput } from './EmbeddingsRequestInput';
17
+ import {
18
+ EmbeddingsRequestInputFromJSON,
19
+ EmbeddingsRequestInputFromJSONTyped,
20
+ EmbeddingsRequestInputToJSON,
21
+ EmbeddingsRequestInputToJSONTyped,
22
+ } from './EmbeddingsRequestInput';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface EmbeddingsRequest
28
+ */
29
+ export interface EmbeddingsRequest {
30
+ /**
31
+ * Canonical embedding model id, e.g. "gpuai/qwen3-embedding-8b".
32
+ * @type {string}
33
+ * @memberof EmbeddingsRequest
34
+ */
35
+ model: string;
36
+ /**
37
+ *
38
+ * @type {EmbeddingsRequestInput}
39
+ * @memberof EmbeddingsRequest
40
+ */
41
+ input: EmbeddingsRequestInput;
42
+ /**
43
+ * Only "float" is supported. A value of "base64" is rejected with invalid_request_error / unsupported_parameter.
44
+ * @type {EmbeddingsRequestEncodingFormatEnum}
45
+ * @memberof EmbeddingsRequest
46
+ */
47
+ encodingFormat?: EmbeddingsRequestEncodingFormatEnum;
48
+ /**
49
+ * Requested output dimensionality, for models that support truncated (Matryoshka) embeddings. Passed through to the model when set.
50
+ * @type {number}
51
+ * @memberof EmbeddingsRequest
52
+ */
53
+ dimensions?: number;
54
+ /**
55
+ * Opaque end-user identifier for abuse tracing. Optional.
56
+ * @type {string}
57
+ * @memberof EmbeddingsRequest
58
+ */
59
+ user?: string;
60
+ }
61
+
62
+
63
+ /**
64
+ * @export
65
+ */
66
+ export const EmbeddingsRequestEncodingFormatEnum = {
67
+ Float: 'float'
68
+ } as const;
69
+ export type EmbeddingsRequestEncodingFormatEnum = typeof EmbeddingsRequestEncodingFormatEnum[keyof typeof EmbeddingsRequestEncodingFormatEnum];
70
+
71
+
72
+ /**
73
+ * Check if a given object implements the EmbeddingsRequest interface.
74
+ */
75
+ export function instanceOfEmbeddingsRequest(value: object): value is EmbeddingsRequest {
76
+ if (!('model' in value) || value['model'] === undefined) return false;
77
+ if (!('input' in value) || value['input'] === undefined) return false;
78
+ return true;
79
+ }
80
+
81
+ export function EmbeddingsRequestFromJSON(json: any): EmbeddingsRequest {
82
+ return EmbeddingsRequestFromJSONTyped(json, false);
83
+ }
84
+
85
+ export function EmbeddingsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmbeddingsRequest {
86
+ if (json == null) {
87
+ return json;
88
+ }
89
+ return {
90
+
91
+ 'model': json['model'],
92
+ 'input': EmbeddingsRequestInputFromJSON(json['input']),
93
+ 'encodingFormat': json['encoding_format'] == null ? undefined : json['encoding_format'],
94
+ 'dimensions': json['dimensions'] == null ? undefined : json['dimensions'],
95
+ 'user': json['user'] == null ? undefined : json['user'],
96
+ };
97
+ }
98
+
99
+ export function EmbeddingsRequestToJSON(json: any): EmbeddingsRequest {
100
+ return EmbeddingsRequestToJSONTyped(json, false);
101
+ }
102
+
103
+ export function EmbeddingsRequestToJSONTyped(value?: EmbeddingsRequest | null, ignoreDiscriminator: boolean = false): any {
104
+ if (value == null) {
105
+ return value;
106
+ }
107
+
108
+ return {
109
+
110
+ 'model': value['model'],
111
+ 'input': EmbeddingsRequestInputToJSON(value['input']),
112
+ 'encoding_format': value['encodingFormat'],
113
+ 'dimensions': value['dimensions'],
114
+ 'user': value['user'],
115
+ };
116
+ }
117
+
@@ -0,0 +1,59 @@
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
+ /**
16
+ * @type EmbeddingsRequestInput
17
+ * Text to embed: either a single string or an array of up to 2048 strings. Token-id arrays are not supported. The per-request ceiling is bounded so the response stays under 64 MiB — about 680 inputs at 4096 dimensions, fewer at a larger `dimensions` value; an over-limit batch is rejected with 400 invalid_request_error whose message states the limit, before any processing.
18
+ * @export
19
+ */
20
+ export type EmbeddingsRequestInput = Array<string> | string;
21
+
22
+ export function EmbeddingsRequestInputFromJSON(json: any): EmbeddingsRequestInput {
23
+ return EmbeddingsRequestInputFromJSONTyped(json, false);
24
+ }
25
+
26
+ export function EmbeddingsRequestInputFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmbeddingsRequestInput {
27
+ if (json == null) {
28
+ return json;
29
+ }
30
+ if (Array.isArray(json)) {
31
+ if (json.every(item => typeof item === 'string')) {
32
+ return json;
33
+ }
34
+ }
35
+ if (typeof json === 'string') {
36
+ return json;
37
+ }
38
+ return {} as any;
39
+ }
40
+
41
+ export function EmbeddingsRequestInputToJSON(json: any): any {
42
+ return EmbeddingsRequestInputToJSONTyped(json, false);
43
+ }
44
+
45
+ export function EmbeddingsRequestInputToJSONTyped(value?: EmbeddingsRequestInput | null, ignoreDiscriminator: boolean = false): any {
46
+ if (value == null) {
47
+ return value;
48
+ }
49
+ if (Array.isArray(value)) {
50
+ if (value.every(item => typeof item === 'string')) {
51
+ return value;
52
+ }
53
+ }
54
+ if (typeof value === 'string') {
55
+ return value;
56
+ }
57
+ return {};
58
+ }
59
+