@gpuai/sdk 0.3.18 → 0.4.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 (151) hide show
  1. package/.openapi-generator/FILES +40 -0
  2. package/README.md +36 -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/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/apis/BillingApi.d.ts +70 -0
  10. package/dist/esm/apis/BillingApi.js +197 -0
  11. package/dist/esm/apis/FunctionsApi.d.ts +228 -0
  12. package/dist/esm/apis/FunctionsApi.js +623 -0
  13. package/dist/esm/apis/index.d.ts +1 -0
  14. package/dist/esm/apis/index.js +1 -0
  15. package/dist/esm/models/AutolaunchRule.d.ts +2 -1
  16. package/dist/esm/models/BillingDetails.d.ts +98 -0
  17. package/dist/esm/models/BillingDetails.js +85 -0
  18. package/dist/esm/models/CreateFunctionRequest.d.ts +32 -0
  19. package/dist/esm/models/CreateFunctionRequest.js +43 -0
  20. package/dist/esm/models/CreateFunctionRunRequest.d.ts +38 -0
  21. package/dist/esm/models/CreateFunctionRunRequest.js +45 -0
  22. package/dist/esm/models/CreateFunctionVersionRequest.d.ts +110 -0
  23. package/dist/esm/models/CreateFunctionVersionRequest.js +79 -0
  24. package/dist/esm/models/Function.d.ts +163 -0
  25. package/dist/esm/models/Function.js +109 -0
  26. package/dist/esm/models/FunctionList.d.ts +33 -0
  27. package/dist/esm/models/FunctionList.js +44 -0
  28. package/dist/esm/models/FunctionReplicaCounts.d.ts +44 -0
  29. package/dist/esm/models/FunctionReplicaCounts.js +51 -0
  30. package/dist/esm/models/FunctionRun.d.ts +130 -0
  31. package/dist/esm/models/FunctionRun.js +94 -0
  32. package/dist/esm/models/FunctionRunError.d.ts +44 -0
  33. package/dist/esm/models/FunctionRunError.js +49 -0
  34. package/dist/esm/models/FunctionRunList.d.ts +39 -0
  35. package/dist/esm/models/FunctionRunList.js +48 -0
  36. package/dist/esm/models/FunctionRunLogChunk.d.ts +59 -0
  37. package/dist/esm/models/FunctionRunLogChunk.js +63 -0
  38. package/dist/esm/models/FunctionRunLogs.d.ts +45 -0
  39. package/dist/esm/models/FunctionRunLogs.js +52 -0
  40. package/dist/esm/models/FunctionUpload.d.ts +51 -0
  41. package/dist/esm/models/FunctionUpload.js +59 -0
  42. package/dist/esm/models/FunctionVersion.d.ts +137 -0
  43. package/dist/esm/models/FunctionVersion.js +109 -0
  44. package/dist/esm/models/Invoice.d.ts +68 -0
  45. package/dist/esm/models/Invoice.js +67 -0
  46. package/dist/esm/models/InvoiceList.d.ts +45 -0
  47. package/dist/esm/models/InvoiceList.js +50 -0
  48. package/dist/esm/models/ModelPricing.d.ts +46 -0
  49. package/dist/esm/models/ModelPricing.js +21 -0
  50. package/dist/esm/models/ModelRate.d.ts +62 -0
  51. package/dist/esm/models/ModelRate.js +51 -0
  52. package/dist/esm/models/PeakWindow.d.ts +38 -0
  53. package/dist/esm/models/PeakWindow.js +47 -0
  54. package/dist/esm/models/UpdateBillingDetailsRequest.d.ts +80 -0
  55. package/dist/esm/models/UpdateBillingDetailsRequest.js +57 -0
  56. package/dist/esm/models/index.d.ts +19 -0
  57. package/dist/esm/models/index.js +19 -0
  58. package/dist/esm/runtime.js +1 -1
  59. package/dist/models/AutolaunchRule.d.ts +2 -1
  60. package/dist/models/BillingDetails.d.ts +98 -0
  61. package/dist/models/BillingDetails.js +92 -0
  62. package/dist/models/CreateFunctionRequest.d.ts +32 -0
  63. package/dist/models/CreateFunctionRequest.js +50 -0
  64. package/dist/models/CreateFunctionRunRequest.d.ts +38 -0
  65. package/dist/models/CreateFunctionRunRequest.js +52 -0
  66. package/dist/models/CreateFunctionVersionRequest.d.ts +110 -0
  67. package/dist/models/CreateFunctionVersionRequest.js +86 -0
  68. package/dist/models/Function.d.ts +163 -0
  69. package/dist/models/Function.js +117 -0
  70. package/dist/models/FunctionList.d.ts +33 -0
  71. package/dist/models/FunctionList.js +51 -0
  72. package/dist/models/FunctionReplicaCounts.d.ts +44 -0
  73. package/dist/models/FunctionReplicaCounts.js +58 -0
  74. package/dist/models/FunctionRun.d.ts +130 -0
  75. package/dist/models/FunctionRun.js +102 -0
  76. package/dist/models/FunctionRunError.d.ts +44 -0
  77. package/dist/models/FunctionRunError.js +56 -0
  78. package/dist/models/FunctionRunList.d.ts +39 -0
  79. package/dist/models/FunctionRunList.js +55 -0
  80. package/dist/models/FunctionRunLogChunk.d.ts +59 -0
  81. package/dist/models/FunctionRunLogChunk.js +71 -0
  82. package/dist/models/FunctionRunLogs.d.ts +45 -0
  83. package/dist/models/FunctionRunLogs.js +59 -0
  84. package/dist/models/FunctionUpload.d.ts +51 -0
  85. package/dist/models/FunctionUpload.js +67 -0
  86. package/dist/models/FunctionVersion.d.ts +137 -0
  87. package/dist/models/FunctionVersion.js +117 -0
  88. package/dist/models/Invoice.d.ts +68 -0
  89. package/dist/models/Invoice.js +74 -0
  90. package/dist/models/InvoiceList.d.ts +45 -0
  91. package/dist/models/InvoiceList.js +57 -0
  92. package/dist/models/ModelPricing.d.ts +46 -0
  93. package/dist/models/ModelPricing.js +22 -0
  94. package/dist/models/ModelRate.d.ts +62 -0
  95. package/dist/models/ModelRate.js +58 -0
  96. package/dist/models/PeakWindow.d.ts +38 -0
  97. package/dist/models/PeakWindow.js +54 -0
  98. package/dist/models/UpdateBillingDetailsRequest.d.ts +80 -0
  99. package/dist/models/UpdateBillingDetailsRequest.js +64 -0
  100. package/dist/models/index.d.ts +19 -0
  101. package/dist/models/index.js +19 -0
  102. package/dist/runtime.js +1 -1
  103. package/docs/BillingApi.md +299 -0
  104. package/docs/BillingDetails.md +56 -0
  105. package/docs/CreateFunctionRequest.md +34 -0
  106. package/docs/CreateFunctionRunRequest.md +36 -0
  107. package/docs/CreateFunctionVersionRequest.md +60 -0
  108. package/docs/Function.md +75 -0
  109. package/docs/FunctionList.md +34 -0
  110. package/docs/FunctionReplicaCounts.md +39 -0
  111. package/docs/FunctionRun.md +63 -0
  112. package/docs/FunctionRunError.md +38 -0
  113. package/docs/FunctionRunList.md +36 -0
  114. package/docs/FunctionRunLogChunk.md +40 -0
  115. package/docs/FunctionRunLogs.md +38 -0
  116. package/docs/FunctionUpload.md +38 -0
  117. package/docs/FunctionVersion.md +66 -0
  118. package/docs/FunctionsApi.md +880 -0
  119. package/docs/Invoice.md +46 -0
  120. package/docs/InvoiceList.md +38 -0
  121. package/docs/ModelPricing.md +12 -0
  122. package/docs/ModelRate.md +45 -0
  123. package/docs/PeakWindow.md +37 -0
  124. package/docs/UpdateBillingDetailsRequest.md +50 -0
  125. package/package.json +1 -1
  126. package/src/apis/BillingApi.ts +247 -0
  127. package/src/apis/FunctionsApi.ts +828 -0
  128. package/src/apis/index.ts +1 -0
  129. package/src/models/AutolaunchRule.ts +2 -1
  130. package/src/models/BillingDetails.ts +164 -0
  131. package/src/models/CreateFunctionRequest.ts +66 -0
  132. package/src/models/CreateFunctionRunRequest.ts +74 -0
  133. package/src/models/CreateFunctionVersionRequest.ts +175 -0
  134. package/src/models/Function.ts +255 -0
  135. package/src/models/FunctionList.ts +74 -0
  136. package/src/models/FunctionReplicaCounts.ts +84 -0
  137. package/src/models/FunctionRun.ts +207 -0
  138. package/src/models/FunctionRunError.ts +83 -0
  139. package/src/models/FunctionRunList.ts +83 -0
  140. package/src/models/FunctionRunLogChunk.ts +105 -0
  141. package/src/models/FunctionRunLogs.ts +92 -0
  142. package/src/models/FunctionUpload.ts +96 -0
  143. package/src/models/FunctionVersion.ts +226 -0
  144. package/src/models/Invoice.ts +120 -0
  145. package/src/models/InvoiceList.ts +91 -0
  146. package/src/models/ModelPricing.ts +74 -0
  147. package/src/models/ModelRate.ts +105 -0
  148. package/src/models/PeakWindow.ts +75 -0
  149. package/src/models/UpdateBillingDetailsRequest.ts +129 -0
  150. package/src/models/index.ts +19 -0
  151. package/src/runtime.ts +1 -1
@@ -0,0 +1,163 @@
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 { FunctionReplicaCounts } from './FunctionReplicaCounts';
13
+ /**
14
+ * A Python function registered with GPU.ai. The settings are those of its current version and are null until the first version is uploaded.
15
+ * @export
16
+ * @interface Function
17
+ */
18
+ export interface Function {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof Function
23
+ */
24
+ id: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof Function
29
+ */
30
+ name: string;
31
+ /**
32
+ * `running`: a call is executing. `warm`: a machine is ready and waiting. `starting`: a machine is being started. `idle`: no machine, nothing is billed.
33
+ * @type {FunctionStatusEnum}
34
+ * @memberof Function
35
+ */
36
+ status: FunctionStatusEnum;
37
+ /**
38
+ *
39
+ * @type {string}
40
+ * @memberof Function
41
+ */
42
+ currentVersionId?: string | null;
43
+ /**
44
+ * The GPU type, or null when the cheapest GPU that fits is used.
45
+ * @type {string}
46
+ * @memberof Function
47
+ */
48
+ gpu?: string | null;
49
+ /**
50
+ *
51
+ * @type {number}
52
+ * @memberof Function
53
+ */
54
+ gpuCount?: number | null;
55
+ /**
56
+ *
57
+ * @type {number}
58
+ * @memberof Function
59
+ */
60
+ minVramGb?: number | null;
61
+ /**
62
+ *
63
+ * @type {Array<string>}
64
+ * @memberof Function
65
+ */
66
+ regions?: Array<string>;
67
+ /**
68
+ *
69
+ * @type {number}
70
+ * @memberof Function
71
+ */
72
+ maxPricePerHour?: number | null;
73
+ /**
74
+ *
75
+ * @type {string}
76
+ * @memberof Function
77
+ */
78
+ pythonVersion?: string | null;
79
+ /**
80
+ *
81
+ * @type {Array<string>}
82
+ * @memberof Function
83
+ */
84
+ pip?: Array<string>;
85
+ /**
86
+ * Seconds one call may run before it is stopped.
87
+ * @type {number}
88
+ * @memberof Function
89
+ */
90
+ timeout?: number | null;
91
+ /**
92
+ * Seconds a machine stays ready after a call.
93
+ * @type {number}
94
+ * @memberof Function
95
+ */
96
+ idleTimeout?: number | null;
97
+ /**
98
+ * Most machines running calls at once.
99
+ * @type {number}
100
+ * @memberof Function
101
+ */
102
+ maxConcurrency?: number | null;
103
+ /**
104
+ *
105
+ * @type {FunctionReplicaCounts}
106
+ * @memberof Function
107
+ */
108
+ replicas: FunctionReplicaCounts;
109
+ /**
110
+ *
111
+ * @type {number}
112
+ * @memberof Function
113
+ */
114
+ runsQueued: number;
115
+ /**
116
+ *
117
+ * @type {number}
118
+ * @memberof Function
119
+ */
120
+ runs24h: number;
121
+ /**
122
+ * Sum of the cost of the runs created in the last 24 hours.
123
+ * @type {number}
124
+ * @memberof Function
125
+ */
126
+ runCost24hUsd: number;
127
+ /**
128
+ * What the function's machines were billed in the last 24 hours, including start-up and idle time that belongs to no run.
129
+ * @type {number}
130
+ * @memberof Function
131
+ */
132
+ machineCost24hUsd: number;
133
+ /**
134
+ *
135
+ * @type {Date}
136
+ * @memberof Function
137
+ */
138
+ lastRunAt?: Date | null;
139
+ /**
140
+ *
141
+ * @type {Date}
142
+ * @memberof Function
143
+ */
144
+ createdAt: Date;
145
+ }
146
+ /**
147
+ * @export
148
+ */
149
+ export declare const FunctionStatusEnum: {
150
+ readonly Idle: "idle";
151
+ readonly Starting: "starting";
152
+ readonly Warm: "warm";
153
+ readonly Running: "running";
154
+ };
155
+ export type FunctionStatusEnum = typeof FunctionStatusEnum[keyof typeof FunctionStatusEnum];
156
+ /**
157
+ * Check if a given object implements the Function interface.
158
+ */
159
+ export declare function instanceOfFunction(value: object): value is Function;
160
+ export declare function FunctionFromJSON(json: any): Function;
161
+ export declare function FunctionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Function;
162
+ export declare function FunctionToJSON(json: any): Function;
163
+ export declare function FunctionToJSONTyped(value?: Function | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,109 @@
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
+ import { FunctionReplicaCountsFromJSON, FunctionReplicaCountsToJSON, } from './FunctionReplicaCounts';
15
+ /**
16
+ * @export
17
+ */
18
+ export const FunctionStatusEnum = {
19
+ Idle: 'idle',
20
+ Starting: 'starting',
21
+ Warm: 'warm',
22
+ Running: 'running'
23
+ };
24
+ /**
25
+ * Check if a given object implements the Function interface.
26
+ */
27
+ export function instanceOfFunction(value) {
28
+ if (!('id' in value) || value['id'] === undefined)
29
+ return false;
30
+ if (!('name' in value) || value['name'] === undefined)
31
+ return false;
32
+ if (!('status' in value) || value['status'] === undefined)
33
+ return false;
34
+ if (!('replicas' in value) || value['replicas'] === undefined)
35
+ return false;
36
+ if ((!('runsQueued' in value) && !('runs_queued' in value)) || (value['runsQueued'] === undefined && value['runs_queued'] === undefined))
37
+ return false;
38
+ if ((!('runs24h' in value) && !('runs_24h' in value)) || (value['runs24h'] === undefined && value['runs_24h'] === undefined))
39
+ return false;
40
+ if ((!('runCost24hUsd' in value) && !('run_cost_24h_usd' in value)) || (value['runCost24hUsd'] === undefined && value['run_cost_24h_usd'] === undefined))
41
+ return false;
42
+ if ((!('machineCost24hUsd' in value) && !('machine_cost_24h_usd' in value)) || (value['machineCost24hUsd'] === undefined && value['machine_cost_24h_usd'] === undefined))
43
+ return false;
44
+ if ((!('createdAt' in value) && !('created_at' in value)) || (value['createdAt'] === undefined && value['created_at'] === undefined))
45
+ return false;
46
+ return true;
47
+ }
48
+ export function FunctionFromJSON(json) {
49
+ return FunctionFromJSONTyped(json, false);
50
+ }
51
+ export function FunctionFromJSONTyped(json, ignoreDiscriminator) {
52
+ if (json == null) {
53
+ return json;
54
+ }
55
+ return {
56
+ 'id': json['id'],
57
+ 'name': json['name'],
58
+ 'status': json['status'],
59
+ 'currentVersionId': json['current_version_id'] === undefined ? undefined : json['current_version_id'] === null ? null : json['current_version_id'],
60
+ 'gpu': json['gpu'] === undefined ? undefined : json['gpu'] === null ? null : json['gpu'],
61
+ 'gpuCount': json['gpu_count'] === undefined ? undefined : json['gpu_count'] === null ? null : json['gpu_count'],
62
+ 'minVramGb': json['min_vram_gb'] === undefined ? undefined : json['min_vram_gb'] === null ? null : json['min_vram_gb'],
63
+ 'regions': json['regions'] == null ? undefined : json['regions'],
64
+ 'maxPricePerHour': json['max_price_per_hour'] === undefined ? undefined : json['max_price_per_hour'] === null ? null : json['max_price_per_hour'],
65
+ 'pythonVersion': json['python_version'] === undefined ? undefined : json['python_version'] === null ? null : json['python_version'],
66
+ 'pip': json['pip'] == null ? undefined : json['pip'],
67
+ 'timeout': json['timeout'] === undefined ? undefined : json['timeout'] === null ? null : json['timeout'],
68
+ 'idleTimeout': json['idle_timeout'] === undefined ? undefined : json['idle_timeout'] === null ? null : json['idle_timeout'],
69
+ 'maxConcurrency': json['max_concurrency'] === undefined ? undefined : json['max_concurrency'] === null ? null : json['max_concurrency'],
70
+ 'replicas': FunctionReplicaCountsFromJSON(json['replicas']),
71
+ 'runsQueued': json['runs_queued'],
72
+ 'runs24h': json['runs_24h'],
73
+ 'runCost24hUsd': json['run_cost_24h_usd'],
74
+ 'machineCost24hUsd': json['machine_cost_24h_usd'],
75
+ 'lastRunAt': json['last_run_at'] === undefined ? undefined : json['last_run_at'] === null ? null : (new Date(json['last_run_at'])),
76
+ 'createdAt': (new Date(json['created_at'])),
77
+ };
78
+ }
79
+ export function FunctionToJSON(json) {
80
+ return FunctionToJSONTyped(json, false);
81
+ }
82
+ export function FunctionToJSONTyped(value, ignoreDiscriminator = false) {
83
+ if (value == null) {
84
+ return value;
85
+ }
86
+ return {
87
+ 'id': value['id'],
88
+ 'name': value['name'],
89
+ 'status': value['status'],
90
+ 'current_version_id': value['currentVersionId'],
91
+ 'gpu': value['gpu'],
92
+ 'gpu_count': value['gpuCount'],
93
+ 'min_vram_gb': value['minVramGb'],
94
+ 'regions': value['regions'],
95
+ 'max_price_per_hour': value['maxPricePerHour'],
96
+ 'python_version': value['pythonVersion'],
97
+ 'pip': value['pip'],
98
+ 'timeout': value['timeout'],
99
+ 'idle_timeout': value['idleTimeout'],
100
+ 'max_concurrency': value['maxConcurrency'],
101
+ 'replicas': FunctionReplicaCountsToJSON(value['replicas']),
102
+ 'runs_queued': value['runsQueued'],
103
+ 'runs_24h': value['runs24h'],
104
+ 'run_cost_24h_usd': value['runCost24hUsd'],
105
+ 'machine_cost_24h_usd': value['machineCost24hUsd'],
106
+ 'last_run_at': value['lastRunAt'] == null ? value['lastRunAt'] : value['lastRunAt'].toISOString(),
107
+ 'created_at': value['createdAt'].toISOString(),
108
+ };
109
+ }
@@ -0,0 +1,33 @@
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 { Function } from './Function';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface FunctionList
17
+ */
18
+ export interface FunctionList {
19
+ /**
20
+ *
21
+ * @type {Array<Function>}
22
+ * @memberof FunctionList
23
+ */
24
+ data: Array<Function>;
25
+ }
26
+ /**
27
+ * Check if a given object implements the FunctionList interface.
28
+ */
29
+ export declare function instanceOfFunctionList(value: object): value is FunctionList;
30
+ export declare function FunctionListFromJSON(json: any): FunctionList;
31
+ export declare function FunctionListFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionList;
32
+ export declare function FunctionListToJSON(json: any): FunctionList;
33
+ export declare function FunctionListToJSONTyped(value?: FunctionList | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,44 @@
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
+ import { FunctionFromJSON, FunctionToJSON, } from './Function';
15
+ /**
16
+ * Check if a given object implements the FunctionList interface.
17
+ */
18
+ export function instanceOfFunctionList(value) {
19
+ if (!('data' in value) || value['data'] === undefined)
20
+ return false;
21
+ return true;
22
+ }
23
+ export function FunctionListFromJSON(json) {
24
+ return FunctionListFromJSONTyped(json, false);
25
+ }
26
+ export function FunctionListFromJSONTyped(json, ignoreDiscriminator) {
27
+ if (json == null) {
28
+ return json;
29
+ }
30
+ return {
31
+ 'data': (json['data'].map(FunctionFromJSON)),
32
+ };
33
+ }
34
+ export function FunctionListToJSON(json) {
35
+ return FunctionListToJSONTyped(json, false);
36
+ }
37
+ export function FunctionListToJSONTyped(value, ignoreDiscriminator = false) {
38
+ if (value == null) {
39
+ return value;
40
+ }
41
+ return {
42
+ 'data': (value['data'].map(FunctionToJSON)),
43
+ };
44
+ }
@@ -0,0 +1,44 @@
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
+ * How many machines a function has in each state.
14
+ * @export
15
+ * @interface FunctionReplicaCounts
16
+ */
17
+ export interface FunctionReplicaCounts {
18
+ /**
19
+ * Machines being started.
20
+ * @type {number}
21
+ * @memberof FunctionReplicaCounts
22
+ */
23
+ starting: number;
24
+ /**
25
+ * Machines ready and waiting for a call.
26
+ * @type {number}
27
+ * @memberof FunctionReplicaCounts
28
+ */
29
+ warm: number;
30
+ /**
31
+ * Machines executing a call.
32
+ * @type {number}
33
+ * @memberof FunctionReplicaCounts
34
+ */
35
+ running: number;
36
+ }
37
+ /**
38
+ * Check if a given object implements the FunctionReplicaCounts interface.
39
+ */
40
+ export declare function instanceOfFunctionReplicaCounts(value: object): value is FunctionReplicaCounts;
41
+ export declare function FunctionReplicaCountsFromJSON(json: any): FunctionReplicaCounts;
42
+ export declare function FunctionReplicaCountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionReplicaCounts;
43
+ export declare function FunctionReplicaCountsToJSON(json: any): FunctionReplicaCounts;
44
+ export declare function FunctionReplicaCountsToJSONTyped(value?: FunctionReplicaCounts | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
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 FunctionReplicaCounts interface.
16
+ */
17
+ export function instanceOfFunctionReplicaCounts(value) {
18
+ if (!('starting' in value) || value['starting'] === undefined)
19
+ return false;
20
+ if (!('warm' in value) || value['warm'] === undefined)
21
+ return false;
22
+ if (!('running' in value) || value['running'] === undefined)
23
+ return false;
24
+ return true;
25
+ }
26
+ export function FunctionReplicaCountsFromJSON(json) {
27
+ return FunctionReplicaCountsFromJSONTyped(json, false);
28
+ }
29
+ export function FunctionReplicaCountsFromJSONTyped(json, ignoreDiscriminator) {
30
+ if (json == null) {
31
+ return json;
32
+ }
33
+ return {
34
+ 'starting': json['starting'],
35
+ 'warm': json['warm'],
36
+ 'running': json['running'],
37
+ };
38
+ }
39
+ export function FunctionReplicaCountsToJSON(json) {
40
+ return FunctionReplicaCountsToJSONTyped(json, false);
41
+ }
42
+ export function FunctionReplicaCountsToJSONTyped(value, ignoreDiscriminator = false) {
43
+ if (value == null) {
44
+ return value;
45
+ }
46
+ return {
47
+ 'starting': value['starting'],
48
+ 'warm': value['warm'],
49
+ 'running': value['running'],
50
+ };
51
+ }
@@ -0,0 +1,130 @@
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 { FunctionRunError } from './FunctionRunError';
13
+ /**
14
+ * One call of a function.
15
+ * @export
16
+ * @interface FunctionRun
17
+ */
18
+ export interface FunctionRun {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof FunctionRun
23
+ */
24
+ id: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof FunctionRun
29
+ */
30
+ functionId: string;
31
+ /**
32
+ *
33
+ * @type {string}
34
+ * @memberof FunctionRun
35
+ */
36
+ versionId: string;
37
+ /**
38
+ * queued waits for a machine; setting_up means a machine took the call and is installing the function's Python and pip requirements; running means the function body is executing.
39
+ * @type {FunctionRunStatusEnum}
40
+ * @memberof FunctionRun
41
+ */
42
+ status: FunctionRunStatusEnum;
43
+ /**
44
+ *
45
+ * @type {boolean}
46
+ * @memberof FunctionRun
47
+ */
48
+ cancelRequested: boolean;
49
+ /**
50
+ * True when the call waited for a machine to start, false when a warm machine took it.
51
+ * @type {boolean}
52
+ * @memberof FunctionRun
53
+ */
54
+ coldStart?: boolean | null;
55
+ /**
56
+ * The machine that ran the call. It is an instance of the organization.
57
+ * @type {string}
58
+ * @memberof FunctionRun
59
+ */
60
+ instanceId?: string | null;
61
+ /**
62
+ *
63
+ * @type {Date}
64
+ * @memberof FunctionRun
65
+ */
66
+ createdAt: Date;
67
+ /**
68
+ *
69
+ * @type {Date}
70
+ * @memberof FunctionRun
71
+ */
72
+ startedAt?: Date | null;
73
+ /**
74
+ *
75
+ * @type {Date}
76
+ * @memberof FunctionRun
77
+ */
78
+ finishedAt?: Date | null;
79
+ /**
80
+ * How long the function body ran.
81
+ * @type {number}
82
+ * @memberof FunctionRun
83
+ */
84
+ durationMs?: number | null;
85
+ /**
86
+ * The time the call held its machine, at the machine's hourly price. Machine time between calls is billed too but belongs to no call.
87
+ * @type {number}
88
+ * @memberof FunctionRun
89
+ */
90
+ costUsd?: number | null;
91
+ /**
92
+ *
93
+ * @type {number}
94
+ * @memberof FunctionRun
95
+ */
96
+ pricePerHour?: number | null;
97
+ /**
98
+ *
99
+ * @type {FunctionRunError}
100
+ * @memberof FunctionRun
101
+ */
102
+ error?: FunctionRunError | null;
103
+ /**
104
+ * The pickled return value, base64-encoded. Present only on a succeeded run fetched with include_result=true.
105
+ * @type {string}
106
+ * @memberof FunctionRun
107
+ */
108
+ result?: string;
109
+ }
110
+ /**
111
+ * @export
112
+ */
113
+ export declare const FunctionRunStatusEnum: {
114
+ readonly Queued: "queued";
115
+ readonly SettingUp: "setting_up";
116
+ readonly Running: "running";
117
+ readonly Succeeded: "succeeded";
118
+ readonly Failed: "failed";
119
+ readonly TimedOut: "timed_out";
120
+ readonly Cancelled: "cancelled";
121
+ };
122
+ export type FunctionRunStatusEnum = typeof FunctionRunStatusEnum[keyof typeof FunctionRunStatusEnum];
123
+ /**
124
+ * Check if a given object implements the FunctionRun interface.
125
+ */
126
+ export declare function instanceOfFunctionRun(value: object): value is FunctionRun;
127
+ export declare function FunctionRunFromJSON(json: any): FunctionRun;
128
+ export declare function FunctionRunFromJSONTyped(json: any, ignoreDiscriminator: boolean): FunctionRun;
129
+ export declare function FunctionRunToJSON(json: any): FunctionRun;
130
+ export declare function FunctionRunToJSONTyped(value?: FunctionRun | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,94 @@
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
+ import { FunctionRunErrorFromJSON, FunctionRunErrorToJSON, } from './FunctionRunError';
15
+ /**
16
+ * @export
17
+ */
18
+ export const FunctionRunStatusEnum = {
19
+ Queued: 'queued',
20
+ SettingUp: 'setting_up',
21
+ Running: 'running',
22
+ Succeeded: 'succeeded',
23
+ Failed: 'failed',
24
+ TimedOut: 'timed_out',
25
+ Cancelled: 'cancelled'
26
+ };
27
+ /**
28
+ * Check if a given object implements the FunctionRun interface.
29
+ */
30
+ export function instanceOfFunctionRun(value) {
31
+ if (!('id' in value) || value['id'] === undefined)
32
+ return false;
33
+ if ((!('functionId' in value) && !('function_id' in value)) || (value['functionId'] === undefined && value['function_id'] === undefined))
34
+ return false;
35
+ if ((!('versionId' in value) && !('version_id' in value)) || (value['versionId'] === undefined && value['version_id'] === undefined))
36
+ return false;
37
+ if (!('status' in value) || value['status'] === undefined)
38
+ return false;
39
+ if ((!('cancelRequested' in value) && !('cancel_requested' in value)) || (value['cancelRequested'] === undefined && value['cancel_requested'] === undefined))
40
+ return false;
41
+ if ((!('createdAt' in value) && !('created_at' in value)) || (value['createdAt'] === undefined && value['created_at'] === undefined))
42
+ return false;
43
+ return true;
44
+ }
45
+ export function FunctionRunFromJSON(json) {
46
+ return FunctionRunFromJSONTyped(json, false);
47
+ }
48
+ export function FunctionRunFromJSONTyped(json, ignoreDiscriminator) {
49
+ if (json == null) {
50
+ return json;
51
+ }
52
+ return {
53
+ 'id': json['id'],
54
+ 'functionId': json['function_id'],
55
+ 'versionId': json['version_id'],
56
+ 'status': json['status'],
57
+ 'cancelRequested': json['cancel_requested'],
58
+ 'coldStart': json['cold_start'] === undefined ? undefined : json['cold_start'] === null ? null : json['cold_start'],
59
+ 'instanceId': json['instance_id'] === undefined ? undefined : json['instance_id'] === null ? null : json['instance_id'],
60
+ 'createdAt': (new Date(json['created_at'])),
61
+ 'startedAt': json['started_at'] === undefined ? undefined : json['started_at'] === null ? null : (new Date(json['started_at'])),
62
+ 'finishedAt': json['finished_at'] === undefined ? undefined : json['finished_at'] === null ? null : (new Date(json['finished_at'])),
63
+ 'durationMs': json['duration_ms'] === undefined ? undefined : json['duration_ms'] === null ? null : json['duration_ms'],
64
+ 'costUsd': json['cost_usd'] === undefined ? undefined : json['cost_usd'] === null ? null : json['cost_usd'],
65
+ 'pricePerHour': json['price_per_hour'] === undefined ? undefined : json['price_per_hour'] === null ? null : json['price_per_hour'],
66
+ 'error': json['error'] === undefined ? undefined : json['error'] === null ? null : FunctionRunErrorFromJSON(json['error']),
67
+ 'result': json['result'] == null ? undefined : json['result'],
68
+ };
69
+ }
70
+ export function FunctionRunToJSON(json) {
71
+ return FunctionRunToJSONTyped(json, false);
72
+ }
73
+ export function FunctionRunToJSONTyped(value, ignoreDiscriminator = false) {
74
+ if (value == null) {
75
+ return value;
76
+ }
77
+ return {
78
+ 'id': value['id'],
79
+ 'function_id': value['functionId'],
80
+ 'version_id': value['versionId'],
81
+ 'status': value['status'],
82
+ 'cancel_requested': value['cancelRequested'],
83
+ 'cold_start': value['coldStart'],
84
+ 'instance_id': value['instanceId'],
85
+ 'created_at': value['createdAt'].toISOString(),
86
+ 'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
87
+ 'finished_at': value['finishedAt'] == null ? value['finishedAt'] : value['finishedAt'].toISOString(),
88
+ 'duration_ms': value['durationMs'],
89
+ 'cost_usd': value['costUsd'],
90
+ 'price_per_hour': value['pricePerHour'],
91
+ 'error': FunctionRunErrorToJSON(value['error']),
92
+ 'result': value['result'],
93
+ };
94
+ }