@gpuai/sdk 0.3.18 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.openapi-generator/FILES +48 -0
  2. package/README.md +41 -2
  3. package/dist/apis/BillingApi.d.ts +70 -0
  4. package/dist/apis/BillingApi.js +197 -0
  5. package/dist/apis/FunctionsApi.d.ts +228 -0
  6. package/dist/apis/FunctionsApi.js +627 -0
  7. package/dist/apis/InstancesApi.d.ts +18 -0
  8. package/dist/apis/InstancesApi.js +49 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/apis/BillingApi.d.ts +70 -0
  12. package/dist/esm/apis/BillingApi.js +197 -0
  13. package/dist/esm/apis/FunctionsApi.d.ts +228 -0
  14. package/dist/esm/apis/FunctionsApi.js +623 -0
  15. package/dist/esm/apis/InstancesApi.d.ts +18 -0
  16. package/dist/esm/apis/InstancesApi.js +49 -0
  17. package/dist/esm/apis/index.d.ts +1 -0
  18. package/dist/esm/apis/index.js +1 -0
  19. package/dist/esm/models/AutolaunchRule.d.ts +2 -1
  20. package/dist/esm/models/BillingDetails.d.ts +98 -0
  21. package/dist/esm/models/BillingDetails.js +85 -0
  22. package/dist/esm/models/CreateFunctionRequest.d.ts +32 -0
  23. package/dist/esm/models/CreateFunctionRequest.js +43 -0
  24. package/dist/esm/models/CreateFunctionRunRequest.d.ts +38 -0
  25. package/dist/esm/models/CreateFunctionRunRequest.js +45 -0
  26. package/dist/esm/models/CreateFunctionVersionRequest.d.ts +110 -0
  27. package/dist/esm/models/CreateFunctionVersionRequest.js +79 -0
  28. package/dist/esm/models/Function.d.ts +163 -0
  29. package/dist/esm/models/Function.js +109 -0
  30. package/dist/esm/models/FunctionList.d.ts +33 -0
  31. package/dist/esm/models/FunctionList.js +44 -0
  32. package/dist/esm/models/FunctionReplicaCounts.d.ts +44 -0
  33. package/dist/esm/models/FunctionReplicaCounts.js +51 -0
  34. package/dist/esm/models/FunctionRun.d.ts +130 -0
  35. package/dist/esm/models/FunctionRun.js +94 -0
  36. package/dist/esm/models/FunctionRunError.d.ts +44 -0
  37. package/dist/esm/models/FunctionRunError.js +49 -0
  38. package/dist/esm/models/FunctionRunList.d.ts +39 -0
  39. package/dist/esm/models/FunctionRunList.js +48 -0
  40. package/dist/esm/models/FunctionRunLogChunk.d.ts +59 -0
  41. package/dist/esm/models/FunctionRunLogChunk.js +63 -0
  42. package/dist/esm/models/FunctionRunLogs.d.ts +45 -0
  43. package/dist/esm/models/FunctionRunLogs.js +52 -0
  44. package/dist/esm/models/FunctionUpload.d.ts +51 -0
  45. package/dist/esm/models/FunctionUpload.js +59 -0
  46. package/dist/esm/models/FunctionVersion.d.ts +137 -0
  47. package/dist/esm/models/FunctionVersion.js +109 -0
  48. package/dist/esm/models/GpuSuggestion.d.ts +82 -0
  49. package/dist/esm/models/GpuSuggestion.js +77 -0
  50. package/dist/esm/models/GpuSuggestionCheaper.d.ts +62 -0
  51. package/dist/esm/models/GpuSuggestionCheaper.js +63 -0
  52. package/dist/esm/models/GpuSuggestionGpu.d.ts +50 -0
  53. package/dist/esm/models/GpuSuggestionGpu.js +55 -0
  54. package/dist/esm/models/Instance.d.ts +7 -0
  55. package/dist/esm/models/Instance.js +3 -0
  56. package/dist/esm/models/InstanceGpuMemory.d.ts +51 -0
  57. package/dist/esm/models/InstanceGpuMemory.js +55 -0
  58. package/dist/esm/models/Invoice.d.ts +68 -0
  59. package/dist/esm/models/Invoice.js +67 -0
  60. package/dist/esm/models/InvoiceList.d.ts +45 -0
  61. package/dist/esm/models/InvoiceList.js +50 -0
  62. package/dist/esm/models/ModelPricing.d.ts +46 -0
  63. package/dist/esm/models/ModelPricing.js +21 -0
  64. package/dist/esm/models/ModelRate.d.ts +62 -0
  65. package/dist/esm/models/ModelRate.js +51 -0
  66. package/dist/esm/models/PeakWindow.d.ts +38 -0
  67. package/dist/esm/models/PeakWindow.js +47 -0
  68. package/dist/esm/models/UpdateBillingDetailsRequest.d.ts +80 -0
  69. package/dist/esm/models/UpdateBillingDetailsRequest.js +57 -0
  70. package/dist/esm/models/index.d.ts +23 -0
  71. package/dist/esm/models/index.js +23 -0
  72. package/dist/esm/runtime.js +1 -1
  73. package/dist/models/AutolaunchRule.d.ts +2 -1
  74. package/dist/models/BillingDetails.d.ts +98 -0
  75. package/dist/models/BillingDetails.js +92 -0
  76. package/dist/models/CreateFunctionRequest.d.ts +32 -0
  77. package/dist/models/CreateFunctionRequest.js +50 -0
  78. package/dist/models/CreateFunctionRunRequest.d.ts +38 -0
  79. package/dist/models/CreateFunctionRunRequest.js +52 -0
  80. package/dist/models/CreateFunctionVersionRequest.d.ts +110 -0
  81. package/dist/models/CreateFunctionVersionRequest.js +86 -0
  82. package/dist/models/Function.d.ts +163 -0
  83. package/dist/models/Function.js +117 -0
  84. package/dist/models/FunctionList.d.ts +33 -0
  85. package/dist/models/FunctionList.js +51 -0
  86. package/dist/models/FunctionReplicaCounts.d.ts +44 -0
  87. package/dist/models/FunctionReplicaCounts.js +58 -0
  88. package/dist/models/FunctionRun.d.ts +130 -0
  89. package/dist/models/FunctionRun.js +102 -0
  90. package/dist/models/FunctionRunError.d.ts +44 -0
  91. package/dist/models/FunctionRunError.js +56 -0
  92. package/dist/models/FunctionRunList.d.ts +39 -0
  93. package/dist/models/FunctionRunList.js +55 -0
  94. package/dist/models/FunctionRunLogChunk.d.ts +59 -0
  95. package/dist/models/FunctionRunLogChunk.js +71 -0
  96. package/dist/models/FunctionRunLogs.d.ts +45 -0
  97. package/dist/models/FunctionRunLogs.js +59 -0
  98. package/dist/models/FunctionUpload.d.ts +51 -0
  99. package/dist/models/FunctionUpload.js +67 -0
  100. package/dist/models/FunctionVersion.d.ts +137 -0
  101. package/dist/models/FunctionVersion.js +117 -0
  102. package/dist/models/GpuSuggestion.d.ts +82 -0
  103. package/dist/models/GpuSuggestion.js +85 -0
  104. package/dist/models/GpuSuggestionCheaper.d.ts +62 -0
  105. package/dist/models/GpuSuggestionCheaper.js +70 -0
  106. package/dist/models/GpuSuggestionGpu.d.ts +50 -0
  107. package/dist/models/GpuSuggestionGpu.js +62 -0
  108. package/dist/models/Instance.d.ts +7 -0
  109. package/dist/models/Instance.js +3 -0
  110. package/dist/models/InstanceGpuMemory.d.ts +51 -0
  111. package/dist/models/InstanceGpuMemory.js +62 -0
  112. package/dist/models/Invoice.d.ts +68 -0
  113. package/dist/models/Invoice.js +74 -0
  114. package/dist/models/InvoiceList.d.ts +45 -0
  115. package/dist/models/InvoiceList.js +57 -0
  116. package/dist/models/ModelPricing.d.ts +46 -0
  117. package/dist/models/ModelPricing.js +22 -0
  118. package/dist/models/ModelRate.d.ts +62 -0
  119. package/dist/models/ModelRate.js +58 -0
  120. package/dist/models/PeakWindow.d.ts +38 -0
  121. package/dist/models/PeakWindow.js +54 -0
  122. package/dist/models/UpdateBillingDetailsRequest.d.ts +80 -0
  123. package/dist/models/UpdateBillingDetailsRequest.js +64 -0
  124. package/dist/models/index.d.ts +23 -0
  125. package/dist/models/index.js +23 -0
  126. package/dist/runtime.js +1 -1
  127. package/docs/BillingApi.md +299 -0
  128. package/docs/BillingDetails.md +56 -0
  129. package/docs/CreateFunctionRequest.md +34 -0
  130. package/docs/CreateFunctionRunRequest.md +36 -0
  131. package/docs/CreateFunctionVersionRequest.md +60 -0
  132. package/docs/Function.md +75 -0
  133. package/docs/FunctionList.md +34 -0
  134. package/docs/FunctionReplicaCounts.md +39 -0
  135. package/docs/FunctionRun.md +63 -0
  136. package/docs/FunctionRunError.md +38 -0
  137. package/docs/FunctionRunList.md +36 -0
  138. package/docs/FunctionRunLogChunk.md +40 -0
  139. package/docs/FunctionRunLogs.md +38 -0
  140. package/docs/FunctionUpload.md +38 -0
  141. package/docs/FunctionVersion.md +66 -0
  142. package/docs/FunctionsApi.md +880 -0
  143. package/docs/GpuSuggestion.md +47 -0
  144. package/docs/GpuSuggestionCheaper.md +45 -0
  145. package/docs/GpuSuggestionGpu.md +41 -0
  146. package/docs/Instance.md +2 -0
  147. package/docs/InstanceGpuMemory.md +41 -0
  148. package/docs/InstancesApi.md +75 -0
  149. package/docs/Invoice.md +46 -0
  150. package/docs/InvoiceList.md +38 -0
  151. package/docs/ModelPricing.md +12 -0
  152. package/docs/ModelRate.md +45 -0
  153. package/docs/PeakWindow.md +37 -0
  154. package/docs/UpdateBillingDetailsRequest.md +50 -0
  155. package/package.json +1 -1
  156. package/src/apis/BillingApi.ts +247 -0
  157. package/src/apis/FunctionsApi.ts +828 -0
  158. package/src/apis/InstancesApi.ts +64 -0
  159. package/src/apis/index.ts +1 -0
  160. package/src/models/AutolaunchRule.ts +2 -1
  161. package/src/models/BillingDetails.ts +164 -0
  162. package/src/models/CreateFunctionRequest.ts +66 -0
  163. package/src/models/CreateFunctionRunRequest.ts +74 -0
  164. package/src/models/CreateFunctionVersionRequest.ts +175 -0
  165. package/src/models/Function.ts +255 -0
  166. package/src/models/FunctionList.ts +74 -0
  167. package/src/models/FunctionReplicaCounts.ts +84 -0
  168. package/src/models/FunctionRun.ts +207 -0
  169. package/src/models/FunctionRunError.ts +83 -0
  170. package/src/models/FunctionRunList.ts +83 -0
  171. package/src/models/FunctionRunLogChunk.ts +105 -0
  172. package/src/models/FunctionRunLogs.ts +92 -0
  173. package/src/models/FunctionUpload.ts +96 -0
  174. package/src/models/FunctionVersion.ts +226 -0
  175. package/src/models/GpuSuggestion.ts +150 -0
  176. package/src/models/GpuSuggestionCheaper.ts +111 -0
  177. package/src/models/GpuSuggestionGpu.ts +93 -0
  178. package/src/models/Instance.ts +15 -0
  179. package/src/models/InstanceGpuMemory.ts +94 -0
  180. package/src/models/Invoice.ts +120 -0
  181. package/src/models/InvoiceList.ts +91 -0
  182. package/src/models/ModelPricing.ts +74 -0
  183. package/src/models/ModelRate.ts +105 -0
  184. package/src/models/PeakWindow.ts +75 -0
  185. package/src/models/UpdateBillingDetailsRequest.ts +129 -0
  186. package/src/models/index.ts +23 -0
  187. package/src/runtime.ts +1 -1
@@ -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
+ /**
17
+ *
18
+ * @export
19
+ * @interface FunctionRunError
20
+ */
21
+ export interface FunctionRunError {
22
+ /**
23
+ * The class name of the exception the function raised, or the platform's reason: Timeout, Cancelled, LaunchError, MachineLost, DependencyError and so on.
24
+ * @type {string}
25
+ * @memberof FunctionRunError
26
+ */
27
+ type: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof FunctionRunError
32
+ */
33
+ message: string;
34
+ /**
35
+ * The remote traceback, when the function raised.
36
+ * @type {string}
37
+ * @memberof FunctionRunError
38
+ */
39
+ traceback?: string;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the FunctionRunError interface.
44
+ */
45
+ export function instanceOfFunctionRunError(value: object): value is FunctionRunError {
46
+ if (!('type' in value) || value['type'] === undefined) return false;
47
+ if (!('message' in value) || value['message'] === undefined) return false;
48
+ return true;
49
+ }
50
+
51
+ export function FunctionRunErrorFromJSON(json: any): FunctionRunError {
52
+ return FunctionRunErrorFromJSONTyped(json, false);
53
+ }
54
+
55
+ export function FunctionRunErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionRunError {
56
+ if (json == null) {
57
+ return json;
58
+ }
59
+ return {
60
+
61
+ 'type': json['type'],
62
+ 'message': json['message'],
63
+ 'traceback': json['traceback'] == null ? undefined : json['traceback'],
64
+ };
65
+ }
66
+
67
+ export function FunctionRunErrorToJSON(json: any): FunctionRunError {
68
+ return FunctionRunErrorToJSONTyped(json, false);
69
+ }
70
+
71
+ export function FunctionRunErrorToJSONTyped(value?: FunctionRunError | null, ignoreDiscriminator: boolean = false): any {
72
+ if (value == null) {
73
+ return value;
74
+ }
75
+
76
+ return {
77
+
78
+ 'type': value['type'],
79
+ 'message': value['message'],
80
+ 'traceback': value['traceback'],
81
+ };
82
+ }
83
+
@@ -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 { FunctionRun } from './FunctionRun';
17
+ import {
18
+ FunctionRunFromJSON,
19
+ FunctionRunFromJSONTyped,
20
+ FunctionRunToJSON,
21
+ FunctionRunToJSONTyped,
22
+ } from './FunctionRun';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface FunctionRunList
28
+ */
29
+ export interface FunctionRunList {
30
+ /**
31
+ *
32
+ * @type {Array<FunctionRun>}
33
+ * @memberof FunctionRunList
34
+ */
35
+ data: Array<FunctionRun>;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof FunctionRunList
40
+ */
41
+ nextCursor: string | null;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the FunctionRunList interface.
46
+ */
47
+ export function instanceOfFunctionRunList(value: object): value is FunctionRunList {
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 FunctionRunListFromJSON(json: any): FunctionRunList {
54
+ return FunctionRunListFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function FunctionRunListFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionRunList {
58
+ if (json == null) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'data': ((json['data'] as Array<any>).map(FunctionRunFromJSON)),
64
+ 'nextCursor': json['next_cursor'],
65
+ };
66
+ }
67
+
68
+ export function FunctionRunListToJSON(json: any): FunctionRunList {
69
+ return FunctionRunListToJSONTyped(json, false);
70
+ }
71
+
72
+ export function FunctionRunListToJSONTyped(value?: FunctionRunList | 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(FunctionRunToJSON)),
80
+ 'next_cursor': value['nextCursor'],
81
+ };
82
+ }
83
+
@@ -0,0 +1,105 @@
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 FunctionRunLogChunk
20
+ */
21
+ export interface FunctionRunLogChunk {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof FunctionRunLogChunk
26
+ */
27
+ cursor: number;
28
+ /**
29
+ * system carries messages from the platform, such as dependency installation.
30
+ * @type {FunctionRunLogChunkStreamEnum}
31
+ * @memberof FunctionRunLogChunk
32
+ */
33
+ stream: FunctionRunLogChunkStreamEnum;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof FunctionRunLogChunk
38
+ */
39
+ data: string;
40
+ /**
41
+ *
42
+ * @type {Date}
43
+ * @memberof FunctionRunLogChunk
44
+ */
45
+ createdAt: Date;
46
+ }
47
+
48
+
49
+ /**
50
+ * @export
51
+ */
52
+ export const FunctionRunLogChunkStreamEnum = {
53
+ Stdout: 'stdout',
54
+ Stderr: 'stderr',
55
+ System: 'system'
56
+ } as const;
57
+ export type FunctionRunLogChunkStreamEnum = typeof FunctionRunLogChunkStreamEnum[keyof typeof FunctionRunLogChunkStreamEnum];
58
+
59
+
60
+ /**
61
+ * Check if a given object implements the FunctionRunLogChunk interface.
62
+ */
63
+ export function instanceOfFunctionRunLogChunk(value: object): value is FunctionRunLogChunk {
64
+ if (!('cursor' in value) || value['cursor'] === undefined) return false;
65
+ if (!('stream' in value) || value['stream'] === undefined) return false;
66
+ if (!('data' in value) || value['data'] === undefined) return false;
67
+ if ((!('createdAt' in (value as Record<string, any>)) && !('created_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['createdAt'] === undefined && (value as Record<string, any>)['created_at'] === undefined)) return false;
68
+ return true;
69
+ }
70
+
71
+ export function FunctionRunLogChunkFromJSON(json: any): FunctionRunLogChunk {
72
+ return FunctionRunLogChunkFromJSONTyped(json, false);
73
+ }
74
+
75
+ export function FunctionRunLogChunkFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionRunLogChunk {
76
+ if (json == null) {
77
+ return json;
78
+ }
79
+ return {
80
+
81
+ 'cursor': json['cursor'],
82
+ 'stream': json['stream'],
83
+ 'data': json['data'],
84
+ 'createdAt': (new Date(json['created_at'])),
85
+ };
86
+ }
87
+
88
+ export function FunctionRunLogChunkToJSON(json: any): FunctionRunLogChunk {
89
+ return FunctionRunLogChunkToJSONTyped(json, false);
90
+ }
91
+
92
+ export function FunctionRunLogChunkToJSONTyped(value?: FunctionRunLogChunk | null, ignoreDiscriminator: boolean = false): any {
93
+ if (value == null) {
94
+ return value;
95
+ }
96
+
97
+ return {
98
+
99
+ 'cursor': value['cursor'],
100
+ 'stream': value['stream'],
101
+ 'data': value['data'],
102
+ 'created_at': value['createdAt'].toISOString(),
103
+ };
104
+ }
105
+
@@ -0,0 +1,92 @@
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 { FunctionRunLogChunk } from './FunctionRunLogChunk';
17
+ import {
18
+ FunctionRunLogChunkFromJSON,
19
+ FunctionRunLogChunkFromJSONTyped,
20
+ FunctionRunLogChunkToJSON,
21
+ FunctionRunLogChunkToJSONTyped,
22
+ } from './FunctionRunLogChunk';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface FunctionRunLogs
28
+ */
29
+ export interface FunctionRunLogs {
30
+ /**
31
+ *
32
+ * @type {Array<FunctionRunLogChunk>}
33
+ * @memberof FunctionRunLogs
34
+ */
35
+ data: Array<FunctionRunLogChunk>;
36
+ /**
37
+ * Pass as `after` on the next read.
38
+ * @type {number}
39
+ * @memberof FunctionRunLogs
40
+ */
41
+ nextCursor: number;
42
+ /**
43
+ * The run's status at read time. Once it is final and data is empty, there is no more output.
44
+ * @type {string}
45
+ * @memberof FunctionRunLogs
46
+ */
47
+ runStatus: string;
48
+ }
49
+
50
+ /**
51
+ * Check if a given object implements the FunctionRunLogs interface.
52
+ */
53
+ export function instanceOfFunctionRunLogs(value: object): value is FunctionRunLogs {
54
+ if (!('data' in value) || value['data'] === undefined) return false;
55
+ 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;
56
+ if ((!('runStatus' in (value as Record<string, any>)) && !('run_status' in (value as Record<string, any>))) || ((value as Record<string, any>)['runStatus'] === undefined && (value as Record<string, any>)['run_status'] === undefined)) return false;
57
+ return true;
58
+ }
59
+
60
+ export function FunctionRunLogsFromJSON(json: any): FunctionRunLogs {
61
+ return FunctionRunLogsFromJSONTyped(json, false);
62
+ }
63
+
64
+ export function FunctionRunLogsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionRunLogs {
65
+ if (json == null) {
66
+ return json;
67
+ }
68
+ return {
69
+
70
+ 'data': ((json['data'] as Array<any>).map(FunctionRunLogChunkFromJSON)),
71
+ 'nextCursor': json['next_cursor'],
72
+ 'runStatus': json['run_status'],
73
+ };
74
+ }
75
+
76
+ export function FunctionRunLogsToJSON(json: any): FunctionRunLogs {
77
+ return FunctionRunLogsToJSONTyped(json, false);
78
+ }
79
+
80
+ export function FunctionRunLogsToJSONTyped(value?: FunctionRunLogs | null, ignoreDiscriminator: boolean = false): any {
81
+ if (value == null) {
82
+ return value;
83
+ }
84
+
85
+ return {
86
+
87
+ 'data': ((value['data'] as Array<any>).map(FunctionRunLogChunkToJSON)),
88
+ 'next_cursor': value['nextCursor'],
89
+ 'run_status': value['runStatus'],
90
+ };
91
+ }
92
+
@@ -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 FunctionUpload
20
+ */
21
+ export interface FunctionUpload {
22
+ /**
23
+ * Where to send the pickled function.
24
+ * @type {string}
25
+ * @memberof FunctionUpload
26
+ */
27
+ url: string;
28
+ /**
29
+ *
30
+ * @type {FunctionUploadMethodEnum}
31
+ * @memberof FunctionUpload
32
+ */
33
+ method: FunctionUploadMethodEnum;
34
+ /**
35
+ *
36
+ * @type {Date}
37
+ * @memberof FunctionUpload
38
+ */
39
+ expiresAt: Date;
40
+ }
41
+
42
+
43
+ /**
44
+ * @export
45
+ */
46
+ export const FunctionUploadMethodEnum = {
47
+ Put: 'PUT'
48
+ } as const;
49
+ export type FunctionUploadMethodEnum = typeof FunctionUploadMethodEnum[keyof typeof FunctionUploadMethodEnum];
50
+
51
+
52
+ /**
53
+ * Check if a given object implements the FunctionUpload interface.
54
+ */
55
+ export function instanceOfFunctionUpload(value: object): value is FunctionUpload {
56
+ if (!('url' in value) || value['url'] === undefined) return false;
57
+ if (!('method' in value) || value['method'] === undefined) return false;
58
+ if (value['method'] !== 'PUT') return false;
59
+
60
+ if ((!('expiresAt' in (value as Record<string, any>)) && !('expires_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['expiresAt'] === undefined && (value as Record<string, any>)['expires_at'] === undefined)) return false;
61
+ return true;
62
+ }
63
+
64
+ export function FunctionUploadFromJSON(json: any): FunctionUpload {
65
+ return FunctionUploadFromJSONTyped(json, false);
66
+ }
67
+
68
+ export function FunctionUploadFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionUpload {
69
+ if (json == null) {
70
+ return json;
71
+ }
72
+ return {
73
+
74
+ 'url': json['url'],
75
+ 'method': json['method'],
76
+ 'expiresAt': (new Date(json['expires_at'])),
77
+ };
78
+ }
79
+
80
+ export function FunctionUploadToJSON(json: any): FunctionUpload {
81
+ return FunctionUploadToJSONTyped(json, false);
82
+ }
83
+
84
+ export function FunctionUploadToJSONTyped(value?: FunctionUpload | null, ignoreDiscriminator: boolean = false): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+
89
+ return {
90
+
91
+ 'url': value['url'],
92
+ 'method': value['method'],
93
+ 'expires_at': value['expiresAt'].toISOString(),
94
+ };
95
+ }
96
+
@@ -0,0 +1,226 @@
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 { FunctionUpload } from './FunctionUpload';
17
+ import {
18
+ FunctionUploadFromJSON,
19
+ FunctionUploadFromJSONTyped,
20
+ FunctionUploadToJSON,
21
+ FunctionUploadToJSONTyped,
22
+ } from './FunctionUpload';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface FunctionVersion
28
+ */
29
+ export interface FunctionVersion {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof FunctionVersion
34
+ */
35
+ id: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof FunctionVersion
40
+ */
41
+ functionId: string;
42
+ /**
43
+ *
44
+ * @type {FunctionVersionStatusEnum}
45
+ * @memberof FunctionVersion
46
+ */
47
+ status: FunctionVersionStatusEnum;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof FunctionVersion
52
+ */
53
+ contentHash: string;
54
+ /**
55
+ * Present while the bundle still has to be uploaded.
56
+ * @type {FunctionUpload}
57
+ * @memberof FunctionVersion
58
+ */
59
+ upload?: FunctionUpload | null;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof FunctionVersion
64
+ */
65
+ pythonVersion: string;
66
+ /**
67
+ *
68
+ * @type {string}
69
+ * @memberof FunctionVersion
70
+ */
71
+ cloudpickleVersion: string;
72
+ /**
73
+ *
74
+ * @type {Array<string>}
75
+ * @memberof FunctionVersion
76
+ */
77
+ pip: Array<string>;
78
+ /**
79
+ *
80
+ * @type {string}
81
+ * @memberof FunctionVersion
82
+ */
83
+ gpu?: string | null;
84
+ /**
85
+ *
86
+ * @type {number}
87
+ * @memberof FunctionVersion
88
+ */
89
+ gpuCount: number;
90
+ /**
91
+ *
92
+ * @type {number}
93
+ * @memberof FunctionVersion
94
+ */
95
+ minVramGb: number;
96
+ /**
97
+ *
98
+ * @type {Array<string>}
99
+ * @memberof FunctionVersion
100
+ */
101
+ regions: Array<string>;
102
+ /**
103
+ *
104
+ * @type {number}
105
+ * @memberof FunctionVersion
106
+ */
107
+ maxPricePerHour?: number | null;
108
+ /**
109
+ *
110
+ * @type {number}
111
+ * @memberof FunctionVersion
112
+ */
113
+ timeout: number;
114
+ /**
115
+ *
116
+ * @type {number}
117
+ * @memberof FunctionVersion
118
+ */
119
+ idleTimeout: number;
120
+ /**
121
+ *
122
+ * @type {number}
123
+ * @memberof FunctionVersion
124
+ */
125
+ maxConcurrency: number;
126
+ /**
127
+ *
128
+ * @type {Date}
129
+ * @memberof FunctionVersion
130
+ */
131
+ createdAt: Date;
132
+ }
133
+
134
+
135
+ /**
136
+ * @export
137
+ */
138
+ export const FunctionVersionStatusEnum = {
139
+ PendingUpload: 'pending_upload',
140
+ Ready: 'ready'
141
+ } as const;
142
+ export type FunctionVersionStatusEnum = typeof FunctionVersionStatusEnum[keyof typeof FunctionVersionStatusEnum];
143
+
144
+
145
+ /**
146
+ * Check if a given object implements the FunctionVersion interface.
147
+ */
148
+ export function instanceOfFunctionVersion(value: object): value is FunctionVersion {
149
+ if (!('id' in value) || value['id'] === undefined) return false;
150
+ if ((!('functionId' in (value as Record<string, any>)) && !('function_id' in (value as Record<string, any>))) || ((value as Record<string, any>)['functionId'] === undefined && (value as Record<string, any>)['function_id'] === undefined)) return false;
151
+ if (!('status' in value) || value['status'] === undefined) return false;
152
+ if ((!('contentHash' in (value as Record<string, any>)) && !('content_hash' in (value as Record<string, any>))) || ((value as Record<string, any>)['contentHash'] === undefined && (value as Record<string, any>)['content_hash'] === undefined)) return false;
153
+ if ((!('pythonVersion' in (value as Record<string, any>)) && !('python_version' in (value as Record<string, any>))) || ((value as Record<string, any>)['pythonVersion'] === undefined && (value as Record<string, any>)['python_version'] === undefined)) return false;
154
+ if ((!('cloudpickleVersion' in (value as Record<string, any>)) && !('cloudpickle_version' in (value as Record<string, any>))) || ((value as Record<string, any>)['cloudpickleVersion'] === undefined && (value as Record<string, any>)['cloudpickle_version'] === undefined)) return false;
155
+ if (!('pip' in value) || value['pip'] === undefined) return false;
156
+ if ((!('gpuCount' in (value as Record<string, any>)) && !('gpu_count' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuCount'] === undefined && (value as Record<string, any>)['gpu_count'] === undefined)) return false;
157
+ if ((!('minVramGb' in (value as Record<string, any>)) && !('min_vram_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['minVramGb'] === undefined && (value as Record<string, any>)['min_vram_gb'] === undefined)) return false;
158
+ if (!('regions' in value) || value['regions'] === undefined) return false;
159
+ if (!('timeout' in value) || value['timeout'] === undefined) return false;
160
+ if ((!('idleTimeout' in (value as Record<string, any>)) && !('idle_timeout' in (value as Record<string, any>))) || ((value as Record<string, any>)['idleTimeout'] === undefined && (value as Record<string, any>)['idle_timeout'] === undefined)) return false;
161
+ if ((!('maxConcurrency' in (value as Record<string, any>)) && !('max_concurrency' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxConcurrency'] === undefined && (value as Record<string, any>)['max_concurrency'] === undefined)) return false;
162
+ if ((!('createdAt' in (value as Record<string, any>)) && !('created_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['createdAt'] === undefined && (value as Record<string, any>)['created_at'] === undefined)) return false;
163
+ return true;
164
+ }
165
+
166
+ export function FunctionVersionFromJSON(json: any): FunctionVersion {
167
+ return FunctionVersionFromJSONTyped(json, false);
168
+ }
169
+
170
+ export function FunctionVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionVersion {
171
+ if (json == null) {
172
+ return json;
173
+ }
174
+ return {
175
+
176
+ 'id': json['id'],
177
+ 'functionId': json['function_id'],
178
+ 'status': json['status'],
179
+ 'contentHash': json['content_hash'],
180
+ 'upload': json['upload'] === undefined ? undefined : json['upload'] === null ? null : FunctionUploadFromJSON(json['upload']),
181
+ 'pythonVersion': json['python_version'],
182
+ 'cloudpickleVersion': json['cloudpickle_version'],
183
+ 'pip': json['pip'],
184
+ 'gpu': json['gpu'] === undefined ? undefined : json['gpu'] === null ? null : json['gpu'],
185
+ 'gpuCount': json['gpu_count'],
186
+ 'minVramGb': json['min_vram_gb'],
187
+ 'regions': json['regions'],
188
+ 'maxPricePerHour': json['max_price_per_hour'] === undefined ? undefined : json['max_price_per_hour'] === null ? null : json['max_price_per_hour'],
189
+ 'timeout': json['timeout'],
190
+ 'idleTimeout': json['idle_timeout'],
191
+ 'maxConcurrency': json['max_concurrency'],
192
+ 'createdAt': (new Date(json['created_at'])),
193
+ };
194
+ }
195
+
196
+ export function FunctionVersionToJSON(json: any): FunctionVersion {
197
+ return FunctionVersionToJSONTyped(json, false);
198
+ }
199
+
200
+ export function FunctionVersionToJSONTyped(value?: FunctionVersion | null, ignoreDiscriminator: boolean = false): any {
201
+ if (value == null) {
202
+ return value;
203
+ }
204
+
205
+ return {
206
+
207
+ 'id': value['id'],
208
+ 'function_id': value['functionId'],
209
+ 'status': value['status'],
210
+ 'content_hash': value['contentHash'],
211
+ 'upload': FunctionUploadToJSON(value['upload']),
212
+ 'python_version': value['pythonVersion'],
213
+ 'cloudpickle_version': value['cloudpickleVersion'],
214
+ 'pip': value['pip'],
215
+ 'gpu': value['gpu'],
216
+ 'gpu_count': value['gpuCount'],
217
+ 'min_vram_gb': value['minVramGb'],
218
+ 'regions': value['regions'],
219
+ 'max_price_per_hour': value['maxPricePerHour'],
220
+ 'timeout': value['timeout'],
221
+ 'idle_timeout': value['idleTimeout'],
222
+ 'max_concurrency': value['maxConcurrency'],
223
+ 'created_at': value['createdAt'].toISOString(),
224
+ };
225
+ }
226
+