@mlhub/models-ts-sdk 0.2.0 → 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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @mlhub/models-ts-sdk@0.2.0
1
+ ## @mlhub/models-ts-sdk@0.4.0
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @mlhub/models-ts-sdk@0.2.0 --save
39
+ npm install @mlhub/models-ts-sdk@0.4.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -19,10 +19,12 @@ export interface DiscoverModelsRequest {
19
19
  limit?: number;
20
20
  cursor?: string;
21
21
  includeCount?: boolean;
22
+ includeGlobalModels?: boolean;
22
23
  }
23
- export interface GetModelRequest {
24
- author: string;
24
+ export interface GetModelByAuthorAndNameRequest {
25
25
  name: string;
26
+ author: string;
27
+ scope?: GetModelByAuthorAndNameScopeEnum;
26
28
  }
27
29
  export interface IngestCanonicalModelRequest {
28
30
  author: string;
@@ -55,11 +57,11 @@ export declare class ModelsApi extends runtime.BaseAPI {
55
57
  /**
56
58
  * Get model by the author and name
57
59
  */
58
- getModelRaw(requestParameters: GetModelRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<GetModelResponse>>;
60
+ getModelByAuthorAndNameRaw(requestParameters: GetModelByAuthorAndNameRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<GetModelResponse>>;
59
61
  /**
60
62
  * Get model by the author and name
61
63
  */
62
- getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit): Promise<GetModelResponse>;
64
+ getModelByAuthorAndName(requestParameters: GetModelByAuthorAndNameRequest, initOverrides?: RequestInit): Promise<GetModelResponse>;
63
65
  /**
64
66
  * Ingest canonical model artifact
65
67
  */
@@ -69,19 +71,19 @@ export declare class ModelsApi extends runtime.BaseAPI {
69
71
  */
70
72
  ingestCanonicalModel(requestParameters: IngestCanonicalModelRequest, initOverrides?: RequestInit): Promise<IngestModelArtifactResponse>;
71
73
  /**
72
- * List all models
73
- */
74
- listModelsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>>;
75
- /**
76
- * List all models
77
- */
78
- listModels(initOverrides?: RequestInit): Promise<ListModelsResponse>;
79
- /**
80
- * List models by author
74
+ * List models by author in the current tenant
81
75
  */
82
76
  listModelsByAuthorRaw(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>>;
83
77
  /**
84
- * List models by author
78
+ * List models by author in the current tenant
85
79
  */
86
80
  listModelsByAuthor(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<ListModelsResponse>;
87
81
  }
82
+ /**
83
+ * @export
84
+ * @enum {string}
85
+ */
86
+ export declare enum GetModelByAuthorAndNameScopeEnum {
87
+ Tenant = "tenant",
88
+ Global = "global"
89
+ }
@@ -64,7 +64,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
64
64
  }
65
65
  };
66
66
  Object.defineProperty(exports, "__esModule", { value: true });
67
- exports.ModelsApi = void 0;
67
+ exports.GetModelByAuthorAndNameScopeEnum = exports.ModelsApi = void 0;
68
68
  var runtime = require("../runtime");
69
69
  var models_1 = require("../models");
70
70
  /**
@@ -143,6 +143,9 @@ var ModelsApi = /** @class */ (function (_super) {
143
143
  if (requestParameters.includeCount !== undefined) {
144
144
  queryParameters['include_count'] = requestParameters.includeCount;
145
145
  }
146
+ if (requestParameters.includeGlobalModels !== undefined) {
147
+ queryParameters['include_global_models'] = requestParameters.includeGlobalModels;
148
+ }
146
149
  headerParameters = {};
147
150
  headerParameters['Content-Type'] = 'application/json';
148
151
  return [4 /*yield*/, this.request({
@@ -179,22 +182,25 @@ var ModelsApi = /** @class */ (function (_super) {
179
182
  /**
180
183
  * Get model by the author and name
181
184
  */
182
- ModelsApi.prototype.getModelRaw = function (requestParameters, initOverrides) {
185
+ ModelsApi.prototype.getModelByAuthorAndNameRaw = function (requestParameters, initOverrides) {
183
186
  return __awaiter(this, void 0, void 0, function () {
184
187
  var queryParameters, headerParameters, response;
185
188
  return __generator(this, function (_a) {
186
189
  switch (_a.label) {
187
190
  case 0:
188
- if (requestParameters.author === null || requestParameters.author === undefined) {
189
- throw new runtime.RequiredError('author', 'Required parameter requestParameters.author was null or undefined when calling getModel.');
190
- }
191
191
  if (requestParameters.name === null || requestParameters.name === undefined) {
192
- throw new runtime.RequiredError('name', 'Required parameter requestParameters.name was null or undefined when calling getModel.');
192
+ throw new runtime.RequiredError('name', 'Required parameter requestParameters.name was null or undefined when calling getModelByAuthorAndName.');
193
+ }
194
+ if (requestParameters.author === null || requestParameters.author === undefined) {
195
+ throw new runtime.RequiredError('author', 'Required parameter requestParameters.author was null or undefined when calling getModelByAuthorAndName.');
193
196
  }
194
197
  queryParameters = {};
198
+ if (requestParameters.scope !== undefined) {
199
+ queryParameters['scope'] = requestParameters.scope;
200
+ }
195
201
  headerParameters = {};
196
202
  return [4 /*yield*/, this.request({
197
- path: "/models-api/models/{author}/{name}".replace("{".concat("author", "}"), encodeURIComponent(String(requestParameters.author))).replace("{".concat("name", "}"), encodeURIComponent(String(requestParameters.name))),
203
+ path: "/models-api/models/{author}/{name}".replace("{".concat("name", "}"), encodeURIComponent(String(requestParameters.name))).replace("{".concat("author", "}"), encodeURIComponent(String(requestParameters.author))),
198
204
  method: 'GET',
199
205
  headers: headerParameters,
200
206
  query: queryParameters,
@@ -209,12 +215,12 @@ var ModelsApi = /** @class */ (function (_super) {
209
215
  /**
210
216
  * Get model by the author and name
211
217
  */
212
- ModelsApi.prototype.getModel = function (requestParameters, initOverrides) {
218
+ ModelsApi.prototype.getModelByAuthorAndName = function (requestParameters, initOverrides) {
213
219
  return __awaiter(this, void 0, void 0, function () {
214
220
  var response;
215
221
  return __generator(this, function (_a) {
216
222
  switch (_a.label) {
217
- case 0: return [4 /*yield*/, this.getModelRaw(requestParameters, initOverrides)];
223
+ case 0: return [4 /*yield*/, this.getModelByAuthorAndNameRaw(requestParameters, initOverrides)];
218
224
  case 1:
219
225
  response = _a.sent();
220
226
  return [4 /*yield*/, response.value()];
@@ -276,48 +282,7 @@ var ModelsApi = /** @class */ (function (_super) {
276
282
  });
277
283
  };
278
284
  /**
279
- * List all models
280
- */
281
- ModelsApi.prototype.listModelsRaw = function (initOverrides) {
282
- return __awaiter(this, void 0, void 0, function () {
283
- var queryParameters, headerParameters, response;
284
- return __generator(this, function (_a) {
285
- switch (_a.label) {
286
- case 0:
287
- queryParameters = {};
288
- headerParameters = {};
289
- return [4 /*yield*/, this.request({
290
- path: "/models-api/models",
291
- method: 'GET',
292
- headers: headerParameters,
293
- query: queryParameters,
294
- }, initOverrides)];
295
- case 1:
296
- response = _a.sent();
297
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ListModelsResponseFromJSON)(jsonValue); })];
298
- }
299
- });
300
- });
301
- };
302
- /**
303
- * List all models
304
- */
305
- ModelsApi.prototype.listModels = function (initOverrides) {
306
- return __awaiter(this, void 0, void 0, function () {
307
- var response;
308
- return __generator(this, function (_a) {
309
- switch (_a.label) {
310
- case 0: return [4 /*yield*/, this.listModelsRaw(initOverrides)];
311
- case 1:
312
- response = _a.sent();
313
- return [4 /*yield*/, response.value()];
314
- case 2: return [2 /*return*/, _a.sent()];
315
- }
316
- });
317
- });
318
- };
319
- /**
320
- * List models by author
285
+ * List models by author in the current tenant
321
286
  */
322
287
  ModelsApi.prototype.listModelsByAuthorRaw = function (requestParameters, initOverrides) {
323
288
  return __awaiter(this, void 0, void 0, function () {
@@ -344,7 +309,7 @@ var ModelsApi = /** @class */ (function (_super) {
344
309
  });
345
310
  };
346
311
  /**
347
- * List models by author
312
+ * List models by author in the current tenant
348
313
  */
349
314
  ModelsApi.prototype.listModelsByAuthor = function (requestParameters, initOverrides) {
350
315
  return __awaiter(this, void 0, void 0, function () {
@@ -363,3 +328,12 @@ var ModelsApi = /** @class */ (function (_super) {
363
328
  return ModelsApi;
364
329
  }(runtime.BaseAPI));
365
330
  exports.ModelsApi = ModelsApi;
331
+ /**
332
+ * @export
333
+ * @enum {string}
334
+ */
335
+ var GetModelByAuthorAndNameScopeEnum;
336
+ (function (GetModelByAuthorAndNameScopeEnum) {
337
+ GetModelByAuthorAndNameScopeEnum["Tenant"] = "tenant";
338
+ GetModelByAuthorAndNameScopeEnum["Global"] = "global";
339
+ })(GetModelByAuthorAndNameScopeEnum || (exports.GetModelByAuthorAndNameScopeEnum = GetModelByAuthorAndNameScopeEnum = {}));
@@ -22,12 +22,6 @@ export interface CreateModelMetadataBody {
22
22
  * @memberof CreateModelMetadataBody
23
23
  */
24
24
  annotations?: any | null;
25
- /**
26
- *
27
- * @type {string}
28
- * @memberof CreateModelMetadataBody
29
- */
30
- author?: string | null;
31
25
  /**
32
26
  *
33
27
  * @type {number}
@@ -153,7 +147,7 @@ export interface CreateModelMetadataBody {
153
147
  * @type {string}
154
148
  * @memberof CreateModelMetadataBody
155
149
  */
156
- name?: string | null;
150
+ name: string;
157
151
  /**
158
152
  *
159
153
  * @type {boolean}
@@ -203,12 +197,6 @@ export interface CreateModelMetadataBody {
203
197
  * @memberof CreateModelMetadataBody
204
198
  */
205
199
  task_types?: Array<Task> | null;
206
- /**
207
- *
208
- * @type {string}
209
- * @memberof CreateModelMetadataBody
210
- */
211
- tenant_id?: string | null;
212
200
  /**
213
201
  *
214
202
  * @type {boolean}
@@ -27,7 +27,6 @@ function CreateModelMetadataBodyFromJSONTyped(json, ignoreDiscriminator) {
27
27
  }
28
28
  return {
29
29
  'annotations': !(0, runtime_1.exists)(json, 'annotations') ? undefined : json['annotations'],
30
- 'author': !(0, runtime_1.exists)(json, 'author') ? undefined : json['author'],
31
30
  'bias_evaluation_score': !(0, runtime_1.exists)(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
32
31
  'edge_optimized': !(0, runtime_1.exists)(json, 'edge_optimized') ? undefined : json['edge_optimized'],
33
32
  'finetuning_datasets': !(0, runtime_1.exists)(json, 'finetuning_datasets') ? undefined : json['finetuning_datasets'],
@@ -48,7 +47,7 @@ function CreateModelMetadataBodyFromJSONTyped(json, ignoreDiscriminator) {
48
47
  'model_outputs': !(0, runtime_1.exists)(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : json['model_outputs'].map(_1.ModelIOFromJSON)),
49
48
  'model_type': !(0, runtime_1.exists)(json, 'model_type') ? undefined : json['model_type'],
50
49
  'multi_modal': !(0, runtime_1.exists)(json, 'multi_modal') ? undefined : json['multi_modal'],
51
- 'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'],
50
+ 'name': json['name'],
52
51
  'pretrained': !(0, runtime_1.exists)(json, 'pretrained') ? undefined : json['pretrained'],
53
52
  'pretraining_datasets': !(0, runtime_1.exists)(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
54
53
  'pruned': !(0, runtime_1.exists)(json, 'pruned') ? undefined : json['pruned'],
@@ -57,7 +56,6 @@ function CreateModelMetadataBodyFromJSONTyped(json, ignoreDiscriminator) {
57
56
  'slimmed': !(0, runtime_1.exists)(json, 'slimmed') ? undefined : json['slimmed'],
58
57
  'supports_quantization': !(0, runtime_1.exists)(json, 'supports_quantization') ? undefined : json['supports_quantization'],
59
58
  'task_types': !(0, runtime_1.exists)(json, 'task_types') ? undefined : (json['task_types'] === null ? null : json['task_types'].map(_1.TaskFromJSON)),
60
- 'tenant_id': !(0, runtime_1.exists)(json, 'tenant_id') ? undefined : json['tenant_id'],
61
59
  'training_distributed': !(0, runtime_1.exists)(json, 'training_distributed') ? undefined : json['training_distributed'],
62
60
  'training_hardware': !(0, runtime_1.exists)(json, 'training_hardware') ? undefined : (0, _1.HardwareRequirementsFromJSON)(json['training_hardware']),
63
61
  'training_max_energy_consumption_watts': !(0, runtime_1.exists)(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],
@@ -74,7 +72,6 @@ function CreateModelMetadataBodyToJSON(value) {
74
72
  }
75
73
  return {
76
74
  'annotations': value.annotations,
77
- 'author': value.author,
78
75
  'bias_evaluation_score': value.bias_evaluation_score,
79
76
  'edge_optimized': value.edge_optimized,
80
77
  'finetuning_datasets': value.finetuning_datasets,
@@ -104,7 +101,6 @@ function CreateModelMetadataBodyToJSON(value) {
104
101
  'slimmed': value.slimmed,
105
102
  'supports_quantization': value.supports_quantization,
106
103
  'task_types': value.task_types === undefined ? undefined : (value.task_types === null ? null : value.task_types.map(_1.TaskToJSON)),
107
- 'tenant_id': value.tenant_id,
108
104
  'training_distributed': value.training_distributed,
109
105
  'training_hardware': (0, _1.HardwareRequirementsToJSON)(value.training_hardware),
110
106
  'training_max_energy_consumption_watts': value.training_max_energy_consumption_watts,
@@ -9,19 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { ArtifactType, ModelMetadata } from './';
13
12
  /**
14
13
  *
15
14
  * @export
16
15
  * @interface ModelArtifact
17
16
  */
18
17
  export interface ModelArtifact {
19
- /**
20
- *
21
- * @type {ArtifactType}
22
- * @memberof ModelArtifact
23
- */
24
- artifact_type: ArtifactType;
25
18
  /**
26
19
  *
27
20
  * @type {string}
@@ -40,12 +33,6 @@ export interface ModelArtifact {
40
33
  * @memberof ModelArtifact
41
34
  */
42
35
  last_modified: string;
43
- /**
44
- *
45
- * @type {ModelMetadata}
46
- * @memberof ModelArtifact
47
- */
48
- metadata?: ModelMetadata;
49
36
  }
50
37
  export declare function ModelArtifactFromJSON(json: any): ModelArtifact;
51
38
  export declare function ModelArtifactFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelArtifact;
@@ -16,8 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ModelArtifactFromJSON = ModelArtifactFromJSON;
17
17
  exports.ModelArtifactFromJSONTyped = ModelArtifactFromJSONTyped;
18
18
  exports.ModelArtifactToJSON = ModelArtifactToJSON;
19
- var runtime_1 = require("../runtime");
20
- var _1 = require("./");
21
19
  function ModelArtifactFromJSON(json) {
22
20
  return ModelArtifactFromJSONTyped(json, false);
23
21
  }
@@ -26,11 +24,9 @@ function ModelArtifactFromJSONTyped(json, ignoreDiscriminator) {
26
24
  return json;
27
25
  }
28
26
  return {
29
- 'artifact_type': (0, _1.ArtifactTypeFromJSON)(json['artifact_type']),
30
27
  'created_at': json['created_at'],
31
28
  'id': json['id'],
32
29
  'last_modified': json['last_modified'],
33
- 'metadata': !(0, runtime_1.exists)(json, 'metadata') ? undefined : (0, _1.ModelMetadataFromJSON)(json['metadata']),
34
30
  };
35
31
  }
36
32
  function ModelArtifactToJSON(value) {
@@ -41,10 +37,8 @@ function ModelArtifactToJSON(value) {
41
37
  return null;
42
38
  }
43
39
  return {
44
- 'artifact_type': (0, _1.ArtifactTypeToJSON)(value.artifact_type),
45
40
  'created_at': value.created_at,
46
41
  'id': value.id,
47
42
  'last_modified': value.last_modified,
48
- 'metadata': (0, _1.ModelMetadataToJSON)(value.metadata),
49
43
  };
50
44
  }
@@ -27,7 +27,7 @@ export interface ModelMetadata {
27
27
  * @type {string}
28
28
  * @memberof ModelMetadata
29
29
  */
30
- author?: string | null;
30
+ author: string;
31
31
  /**
32
32
  *
33
33
  * @type {number}
@@ -159,7 +159,7 @@ export interface ModelMetadata {
159
159
  * @type {string}
160
160
  * @memberof ModelMetadata
161
161
  */
162
- name?: string | null;
162
+ name: string;
163
163
  /**
164
164
  *
165
165
  * @type {boolean}
@@ -214,7 +214,7 @@ export interface ModelMetadata {
214
214
  * @type {string}
215
215
  * @memberof ModelMetadata
216
216
  */
217
- tenant_id?: string | null;
217
+ tenant_id: string;
218
218
  /**
219
219
  *
220
220
  * @type {boolean}
@@ -27,7 +27,7 @@ function ModelMetadataFromJSONTyped(json, ignoreDiscriminator) {
27
27
  }
28
28
  return {
29
29
  'annotations': !(0, runtime_1.exists)(json, 'annotations') ? undefined : json['annotations'],
30
- 'author': !(0, runtime_1.exists)(json, 'author') ? undefined : json['author'],
30
+ 'author': json['author'],
31
31
  'bias_evaluation_score': !(0, runtime_1.exists)(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
32
32
  'canonical': !(0, runtime_1.exists)(json, 'canonical') ? undefined : (0, _1.CanonicalFromJSON)(json['canonical']),
33
33
  'edge_optimized': !(0, runtime_1.exists)(json, 'edge_optimized') ? undefined : json['edge_optimized'],
@@ -49,7 +49,7 @@ function ModelMetadataFromJSONTyped(json, ignoreDiscriminator) {
49
49
  'model_outputs': !(0, runtime_1.exists)(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : json['model_outputs'].map(_1.ModelIOFromJSON)),
50
50
  'model_type': !(0, runtime_1.exists)(json, 'model_type') ? undefined : json['model_type'],
51
51
  'multi_modal': !(0, runtime_1.exists)(json, 'multi_modal') ? undefined : json['multi_modal'],
52
- 'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'],
52
+ 'name': json['name'],
53
53
  'pretrained': !(0, runtime_1.exists)(json, 'pretrained') ? undefined : json['pretrained'],
54
54
  'pretraining_datasets': !(0, runtime_1.exists)(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
55
55
  'pruned': !(0, runtime_1.exists)(json, 'pruned') ? undefined : json['pruned'],
@@ -58,7 +58,7 @@ function ModelMetadataFromJSONTyped(json, ignoreDiscriminator) {
58
58
  'slimmed': !(0, runtime_1.exists)(json, 'slimmed') ? undefined : json['slimmed'],
59
59
  'supports_quantization': !(0, runtime_1.exists)(json, 'supports_quantization') ? undefined : json['supports_quantization'],
60
60
  'task_types': !(0, runtime_1.exists)(json, 'task_types') ? undefined : (json['task_types'] === null ? null : json['task_types'].map(_1.TaskFromJSON)),
61
- 'tenant_id': !(0, runtime_1.exists)(json, 'tenant_id') ? undefined : json['tenant_id'],
61
+ 'tenant_id': json['tenant_id'],
62
62
  'training_distributed': !(0, runtime_1.exists)(json, 'training_distributed') ? undefined : json['training_distributed'],
63
63
  'training_hardware': !(0, runtime_1.exists)(json, 'training_hardware') ? undefined : (0, _1.HardwareRequirementsFromJSON)(json['training_hardware']),
64
64
  'training_max_energy_consumption_watts': !(0, runtime_1.exists)(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlhub/models-ts-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "OpenAPI client for @mlhub/models-ts-sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "main": "./dist/index.js",
@@ -59,11 +59,13 @@ export interface DiscoverModelsRequest {
59
59
  limit?: number;
60
60
  cursor?: string;
61
61
  includeCount?: boolean;
62
+ includeGlobalModels?: boolean;
62
63
  }
63
64
 
64
- export interface GetModelRequest {
65
- author: string;
65
+ export interface GetModelByAuthorAndNameRequest {
66
66
  name: string;
67
+ author: string;
68
+ scope?: GetModelByAuthorAndNameScopeEnum;
67
69
  }
68
70
 
69
71
  export interface IngestCanonicalModelRequest {
@@ -136,6 +138,10 @@ export class ModelsApi extends runtime.BaseAPI {
136
138
  queryParameters['include_count'] = requestParameters.includeCount;
137
139
  }
138
140
 
141
+ if (requestParameters.includeGlobalModels !== undefined) {
142
+ queryParameters['include_global_models'] = requestParameters.includeGlobalModels;
143
+ }
144
+
139
145
  const headerParameters: runtime.HTTPHeaders = {};
140
146
 
141
147
  headerParameters['Content-Type'] = 'application/json';
@@ -162,21 +168,25 @@ export class ModelsApi extends runtime.BaseAPI {
162
168
  /**
163
169
  * Get model by the author and name
164
170
  */
165
- async getModelRaw(requestParameters: GetModelRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<GetModelResponse>> {
166
- if (requestParameters.author === null || requestParameters.author === undefined) {
167
- throw new runtime.RequiredError('author','Required parameter requestParameters.author was null or undefined when calling getModel.');
171
+ async getModelByAuthorAndNameRaw(requestParameters: GetModelByAuthorAndNameRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<GetModelResponse>> {
172
+ if (requestParameters.name === null || requestParameters.name === undefined) {
173
+ throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getModelByAuthorAndName.');
168
174
  }
169
175
 
170
- if (requestParameters.name === null || requestParameters.name === undefined) {
171
- throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getModel.');
176
+ if (requestParameters.author === null || requestParameters.author === undefined) {
177
+ throw new runtime.RequiredError('author','Required parameter requestParameters.author was null or undefined when calling getModelByAuthorAndName.');
172
178
  }
173
179
 
174
180
  const queryParameters: any = {};
175
181
 
182
+ if (requestParameters.scope !== undefined) {
183
+ queryParameters['scope'] = requestParameters.scope;
184
+ }
185
+
176
186
  const headerParameters: runtime.HTTPHeaders = {};
177
187
 
178
188
  const response = await this.request({
179
- path: `/models-api/models/{author}/{name}`.replace(`{${"author"}}`, encodeURIComponent(String(requestParameters.author))).replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
189
+ path: `/models-api/models/{author}/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))).replace(`{${"author"}}`, encodeURIComponent(String(requestParameters.author))),
180
190
  method: 'GET',
181
191
  headers: headerParameters,
182
192
  query: queryParameters,
@@ -188,8 +198,8 @@ export class ModelsApi extends runtime.BaseAPI {
188
198
  /**
189
199
  * Get model by the author and name
190
200
  */
191
- async getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit): Promise<GetModelResponse> {
192
- const response = await this.getModelRaw(requestParameters, initOverrides);
201
+ async getModelByAuthorAndName(requestParameters: GetModelByAuthorAndNameRequest, initOverrides?: RequestInit): Promise<GetModelResponse> {
202
+ const response = await this.getModelByAuthorAndNameRaw(requestParameters, initOverrides);
193
203
  return await response.value();
194
204
  }
195
205
 
@@ -235,33 +245,7 @@ export class ModelsApi extends runtime.BaseAPI {
235
245
  }
236
246
 
237
247
  /**
238
- * List all models
239
- */
240
- async listModelsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>> {
241
- const queryParameters: any = {};
242
-
243
- const headerParameters: runtime.HTTPHeaders = {};
244
-
245
- const response = await this.request({
246
- path: `/models-api/models`,
247
- method: 'GET',
248
- headers: headerParameters,
249
- query: queryParameters,
250
- }, initOverrides);
251
-
252
- return new runtime.JSONApiResponse(response, (jsonValue) => ListModelsResponseFromJSON(jsonValue));
253
- }
254
-
255
- /**
256
- * List all models
257
- */
258
- async listModels(initOverrides?: RequestInit): Promise<ListModelsResponse> {
259
- const response = await this.listModelsRaw(initOverrides);
260
- return await response.value();
261
- }
262
-
263
- /**
264
- * List models by author
248
+ * List models by author in the current tenant
265
249
  */
266
250
  async listModelsByAuthorRaw(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>> {
267
251
  if (requestParameters.author === null || requestParameters.author === undefined) {
@@ -283,7 +267,7 @@ export class ModelsApi extends runtime.BaseAPI {
283
267
  }
284
268
 
285
269
  /**
286
- * List models by author
270
+ * List models by author in the current tenant
287
271
  */
288
272
  async listModelsByAuthor(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<ListModelsResponse> {
289
273
  const response = await this.listModelsByAuthorRaw(requestParameters, initOverrides);
@@ -291,3 +275,12 @@ export class ModelsApi extends runtime.BaseAPI {
291
275
  }
292
276
 
293
277
  }
278
+
279
+ /**
280
+ * @export
281
+ * @enum {string}
282
+ */
283
+ export enum GetModelByAuthorAndNameScopeEnum {
284
+ Tenant = 'tenant',
285
+ Global = 'global'
286
+ }
@@ -40,12 +40,6 @@ export interface CreateModelMetadataBody {
40
40
  * @memberof CreateModelMetadataBody
41
41
  */
42
42
  annotations?: any | null;
43
- /**
44
- *
45
- * @type {string}
46
- * @memberof CreateModelMetadataBody
47
- */
48
- author?: string | null;
49
43
  /**
50
44
  *
51
45
  * @type {number}
@@ -171,7 +165,7 @@ export interface CreateModelMetadataBody {
171
165
  * @type {string}
172
166
  * @memberof CreateModelMetadataBody
173
167
  */
174
- name?: string | null;
168
+ name: string;
175
169
  /**
176
170
  *
177
171
  * @type {boolean}
@@ -221,12 +215,6 @@ export interface CreateModelMetadataBody {
221
215
  * @memberof CreateModelMetadataBody
222
216
  */
223
217
  task_types?: Array<Task> | null;
224
- /**
225
- *
226
- * @type {string}
227
- * @memberof CreateModelMetadataBody
228
- */
229
- tenant_id?: string | null;
230
218
  /**
231
219
  *
232
220
  * @type {boolean}
@@ -270,7 +258,6 @@ export function CreateModelMetadataBodyFromJSONTyped(json: any, ignoreDiscrimina
270
258
  return {
271
259
 
272
260
  'annotations': !exists(json, 'annotations') ? undefined : json['annotations'],
273
- 'author': !exists(json, 'author') ? undefined : json['author'],
274
261
  'bias_evaluation_score': !exists(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
275
262
  'edge_optimized': !exists(json, 'edge_optimized') ? undefined : json['edge_optimized'],
276
263
  'finetuning_datasets': !exists(json, 'finetuning_datasets') ? undefined : json['finetuning_datasets'],
@@ -291,7 +278,7 @@ export function CreateModelMetadataBodyFromJSONTyped(json: any, ignoreDiscrimina
291
278
  'model_outputs': !exists(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : (json['model_outputs'] as Array<any>).map(ModelIOFromJSON)),
292
279
  'model_type': !exists(json, 'model_type') ? undefined : json['model_type'],
293
280
  'multi_modal': !exists(json, 'multi_modal') ? undefined : json['multi_modal'],
294
- 'name': !exists(json, 'name') ? undefined : json['name'],
281
+ 'name': json['name'],
295
282
  'pretrained': !exists(json, 'pretrained') ? undefined : json['pretrained'],
296
283
  'pretraining_datasets': !exists(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
297
284
  'pruned': !exists(json, 'pruned') ? undefined : json['pruned'],
@@ -300,7 +287,6 @@ export function CreateModelMetadataBodyFromJSONTyped(json: any, ignoreDiscrimina
300
287
  'slimmed': !exists(json, 'slimmed') ? undefined : json['slimmed'],
301
288
  'supports_quantization': !exists(json, 'supports_quantization') ? undefined : json['supports_quantization'],
302
289
  'task_types': !exists(json, 'task_types') ? undefined : (json['task_types'] === null ? null : (json['task_types'] as Array<any>).map(TaskFromJSON)),
303
- 'tenant_id': !exists(json, 'tenant_id') ? undefined : json['tenant_id'],
304
290
  'training_distributed': !exists(json, 'training_distributed') ? undefined : json['training_distributed'],
305
291
  'training_hardware': !exists(json, 'training_hardware') ? undefined : HardwareRequirementsFromJSON(json['training_hardware']),
306
292
  'training_max_energy_consumption_watts': !exists(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],
@@ -319,7 +305,6 @@ export function CreateModelMetadataBodyToJSON(value?: CreateModelMetadataBody |
319
305
  return {
320
306
 
321
307
  'annotations': value.annotations,
322
- 'author': value.author,
323
308
  'bias_evaluation_score': value.bias_evaluation_score,
324
309
  'edge_optimized': value.edge_optimized,
325
310
  'finetuning_datasets': value.finetuning_datasets,
@@ -349,7 +334,6 @@ export function CreateModelMetadataBodyToJSON(value?: CreateModelMetadataBody |
349
334
  'slimmed': value.slimmed,
350
335
  'supports_quantization': value.supports_quantization,
351
336
  'task_types': value.task_types === undefined ? undefined : (value.task_types === null ? null : (value.task_types as Array<any>).map(TaskToJSON)),
352
- 'tenant_id': value.tenant_id,
353
337
  'training_distributed': value.training_distributed,
354
338
  'training_hardware': HardwareRequirementsToJSON(value.training_hardware),
355
339
  'training_max_energy_consumption_watts': value.training_max_energy_consumption_watts,
@@ -13,29 +13,12 @@
13
13
  */
14
14
 
15
15
  import { exists, mapValues } from '../runtime';
16
- import {
17
- ArtifactType,
18
- ArtifactTypeFromJSON,
19
- ArtifactTypeFromJSONTyped,
20
- ArtifactTypeToJSON,
21
- ModelMetadata,
22
- ModelMetadataFromJSON,
23
- ModelMetadataFromJSONTyped,
24
- ModelMetadataToJSON,
25
- } from './';
26
-
27
16
  /**
28
17
  *
29
18
  * @export
30
19
  * @interface ModelArtifact
31
20
  */
32
21
  export interface ModelArtifact {
33
- /**
34
- *
35
- * @type {ArtifactType}
36
- * @memberof ModelArtifact
37
- */
38
- artifact_type: ArtifactType;
39
22
  /**
40
23
  *
41
24
  * @type {string}
@@ -54,12 +37,6 @@ export interface ModelArtifact {
54
37
  * @memberof ModelArtifact
55
38
  */
56
39
  last_modified: string;
57
- /**
58
- *
59
- * @type {ModelMetadata}
60
- * @memberof ModelArtifact
61
- */
62
- metadata?: ModelMetadata;
63
40
  }
64
41
 
65
42
  export function ModelArtifactFromJSON(json: any): ModelArtifact {
@@ -72,11 +49,9 @@ export function ModelArtifactFromJSONTyped(json: any, ignoreDiscriminator: boole
72
49
  }
73
50
  return {
74
51
 
75
- 'artifact_type': ArtifactTypeFromJSON(json['artifact_type']),
76
52
  'created_at': json['created_at'],
77
53
  'id': json['id'],
78
54
  'last_modified': json['last_modified'],
79
- 'metadata': !exists(json, 'metadata') ? undefined : ModelMetadataFromJSON(json['metadata']),
80
55
  };
81
56
  }
82
57
 
@@ -89,11 +64,9 @@ export function ModelArtifactToJSON(value?: ModelArtifact | null): any {
89
64
  }
90
65
  return {
91
66
 
92
- 'artifact_type': ArtifactTypeToJSON(value.artifact_type),
93
67
  'created_at': value.created_at,
94
68
  'id': value.id,
95
69
  'last_modified': value.last_modified,
96
- 'metadata': ModelMetadataToJSON(value.metadata),
97
70
  };
98
71
  }
99
72
 
@@ -49,7 +49,7 @@ export interface ModelMetadata {
49
49
  * @type {string}
50
50
  * @memberof ModelMetadata
51
51
  */
52
- author?: string | null;
52
+ author: string;
53
53
  /**
54
54
  *
55
55
  * @type {number}
@@ -181,7 +181,7 @@ export interface ModelMetadata {
181
181
  * @type {string}
182
182
  * @memberof ModelMetadata
183
183
  */
184
- name?: string | null;
184
+ name: string;
185
185
  /**
186
186
  *
187
187
  * @type {boolean}
@@ -236,7 +236,7 @@ export interface ModelMetadata {
236
236
  * @type {string}
237
237
  * @memberof ModelMetadata
238
238
  */
239
- tenant_id?: string | null;
239
+ tenant_id: string;
240
240
  /**
241
241
  *
242
242
  * @type {boolean}
@@ -280,7 +280,7 @@ export function ModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
280
280
  return {
281
281
 
282
282
  'annotations': !exists(json, 'annotations') ? undefined : json['annotations'],
283
- 'author': !exists(json, 'author') ? undefined : json['author'],
283
+ 'author': json['author'],
284
284
  'bias_evaluation_score': !exists(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
285
285
  'canonical': !exists(json, 'canonical') ? undefined : CanonicalFromJSON(json['canonical']),
286
286
  'edge_optimized': !exists(json, 'edge_optimized') ? undefined : json['edge_optimized'],
@@ -302,7 +302,7 @@ export function ModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
302
302
  'model_outputs': !exists(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : (json['model_outputs'] as Array<any>).map(ModelIOFromJSON)),
303
303
  'model_type': !exists(json, 'model_type') ? undefined : json['model_type'],
304
304
  'multi_modal': !exists(json, 'multi_modal') ? undefined : json['multi_modal'],
305
- 'name': !exists(json, 'name') ? undefined : json['name'],
305
+ 'name': json['name'],
306
306
  'pretrained': !exists(json, 'pretrained') ? undefined : json['pretrained'],
307
307
  'pretraining_datasets': !exists(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
308
308
  'pruned': !exists(json, 'pruned') ? undefined : json['pruned'],
@@ -311,7 +311,7 @@ export function ModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
311
311
  'slimmed': !exists(json, 'slimmed') ? undefined : json['slimmed'],
312
312
  'supports_quantization': !exists(json, 'supports_quantization') ? undefined : json['supports_quantization'],
313
313
  'task_types': !exists(json, 'task_types') ? undefined : (json['task_types'] === null ? null : (json['task_types'] as Array<any>).map(TaskFromJSON)),
314
- 'tenant_id': !exists(json, 'tenant_id') ? undefined : json['tenant_id'],
314
+ 'tenant_id': json['tenant_id'],
315
315
  'training_distributed': !exists(json, 'training_distributed') ? undefined : json['training_distributed'],
316
316
  'training_hardware': !exists(json, 'training_hardware') ? undefined : HardwareRequirementsFromJSON(json['training_hardware']),
317
317
  'training_max_energy_consumption_watts': !exists(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],