@scaleway/sdk-inference 2.6.0 → 2.7.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.
- package/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +6 -6
- package/dist/metadata.gen.js +6 -2
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +83 -179
- package/dist/v1/content.gen.js +2 -2
- package/dist/v1/marshalling.gen.js +23 -23
- package/dist/v1/metadata.gen.js +1 -1
- package/dist/v1/validation-rules.gen.js +6 -6
- package/dist/v1beta1/api.gen.d.ts +1 -1
- package/dist/v1beta1/api.gen.js +98 -199
- package/dist/v1beta1/content.gen.js +1 -1
- package/dist/v1beta1/marshalling.gen.js +25 -25
- package/dist/v1beta1/validation-rules.gen.js +4 -4
- package/package.json +15 -14
- package/LICENSE +0 -191
- package/dist/metadata.gen.json +0 -6
- package/dist/metadata2.gen.js +0 -8
package/dist/metadata.gen.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* This file is automatically generated
|
|
3
3
|
* PLEASE DO NOT EDIT HERE
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
name:
|
|
7
|
-
namespace:
|
|
8
|
-
displayName:
|
|
9
|
-
versions:
|
|
5
|
+
export declare const pkgMetadata: {
|
|
6
|
+
readonly name: "@scaleway/sdk-inference";
|
|
7
|
+
readonly namespace: "inference";
|
|
8
|
+
readonly displayName: "Inference";
|
|
9
|
+
readonly versions: readonly ["v1", "v1beta1"];
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type Metadata = typeof pkgMetadata;
|
|
12
12
|
export default pkgMetadata;
|
package/dist/metadata.gen.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import metadata_gen_default from "./metadata2.gen.js";
|
|
2
1
|
//#region src/metadata.gen.ts
|
|
3
2
|
/**
|
|
4
3
|
* This file is automatically generated
|
|
5
4
|
* PLEASE DO NOT EDIT HERE
|
|
6
5
|
*/
|
|
7
|
-
|
|
6
|
+
const pkgMetadata = {
|
|
7
|
+
name: "@scaleway/sdk-inference",
|
|
8
|
+
namespace: "inference",
|
|
9
|
+
displayName: "Inference",
|
|
10
|
+
versions: ["v1", "v1beta1"]
|
|
11
|
+
};
|
|
8
12
|
//#endregion
|
|
9
13
|
export { pkgMetadata as default, pkgMetadata };
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare class API extends ParentAPI {
|
|
|
37
37
|
* @param options - The waiting options
|
|
38
38
|
* @returns A Promise of Deployment
|
|
39
39
|
*/
|
|
40
|
-
waitForDeployment: (request: Readonly<GetDeploymentRequest>, options?: Readonly<WaitForOptions<Deployment>>) => Promise<Deployment>;
|
|
40
|
+
waitForDeployment: (request: Readonly<GetDeploymentRequest>, options?: Readonly<WaitForOptions<Deployment>> | undefined) => Promise<Deployment>;
|
|
41
41
|
/**
|
|
42
42
|
* Create a deployment. Create a new inference deployment related to a specific model.
|
|
43
43
|
*
|
|
@@ -112,7 +112,7 @@ export declare class API extends ParentAPI {
|
|
|
112
112
|
* @param options - The waiting options
|
|
113
113
|
* @returns A Promise of Model
|
|
114
114
|
*/
|
|
115
|
-
waitForModel: (request: Readonly<GetModelRequest>, options?: Readonly<WaitForOptions<Model>>) => Promise<Model>;
|
|
115
|
+
waitForModel: (request: Readonly<GetModelRequest>, options?: Readonly<WaitForOptions<Model>> | undefined) => Promise<Model>;
|
|
116
116
|
/**
|
|
117
117
|
* Import a model. Import a new model to your model library.
|
|
118
118
|
*
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -2,191 +2,95 @@ import { DEPLOYMENT_TRANSIENT_STATUSES, MODEL_TRANSIENT_STATUSES } from "./conte
|
|
|
2
2
|
import { marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateModelRequest, marshalUpdateDeploymentRequest, marshalUpdateEndpointRequest, unmarshalDeployment, unmarshalEndpoint, unmarshalListDeploymentsResponse, unmarshalListModelsResponse, unmarshalListNodeTypesResponse, unmarshalModel } from "./marshalling.gen.js";
|
|
3
3
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
4
|
//#region src/v1/api.gen.ts
|
|
5
|
-
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
6
|
/**
|
|
7
7
|
* Managed Inference API.
|
|
8
8
|
|
|
9
9
|
This API allows you to handle your Managed Inference services.
|
|
10
10
|
*/
|
|
11
11
|
var API = class extends API$1 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Create an endpoint. Create a new Endpoint related to a specific deployment.
|
|
96
|
-
*
|
|
97
|
-
* @param request - The request {@link CreateEndpointRequest}
|
|
98
|
-
* @returns A Promise of Endpoint
|
|
99
|
-
*/
|
|
100
|
-
createEndpoint = (request) => this.client.fetch({
|
|
101
|
-
body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
|
|
102
|
-
headers: jsonContentHeaders,
|
|
103
|
-
method: "POST",
|
|
104
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
105
|
-
}, unmarshalEndpoint);
|
|
106
|
-
/**
|
|
107
|
-
* Update an endpoint. Update an existing Endpoint.
|
|
108
|
-
*
|
|
109
|
-
* @param request - The request {@link UpdateEndpointRequest}
|
|
110
|
-
* @returns A Promise of Endpoint
|
|
111
|
-
*/
|
|
112
|
-
updateEndpoint = (request) => this.client.fetch({
|
|
113
|
-
body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),
|
|
114
|
-
headers: jsonContentHeaders,
|
|
115
|
-
method: "PATCH",
|
|
116
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
117
|
-
}, unmarshalEndpoint);
|
|
118
|
-
/**
|
|
119
|
-
* Delete an endpoint. Delete an existing Endpoint.
|
|
120
|
-
*
|
|
121
|
-
* @param request - The request {@link DeleteEndpointRequest}
|
|
122
|
-
*/
|
|
123
|
-
deleteEndpoint = (request) => this.client.fetch({
|
|
124
|
-
method: "DELETE",
|
|
125
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
126
|
-
});
|
|
127
|
-
pageOfListModels = (request = {}) => this.client.fetch({
|
|
128
|
-
method: "GET",
|
|
129
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`,
|
|
130
|
-
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
|
|
131
|
-
}, unmarshalListModelsResponse);
|
|
132
|
-
/**
|
|
133
|
-
* List models. List all available models.
|
|
134
|
-
*
|
|
135
|
-
* @param request - The request {@link ListModelsRequest}
|
|
136
|
-
* @returns A Promise of ListModelsResponse
|
|
137
|
-
*/
|
|
138
|
-
listModels = (request = {}) => enrichForPagination("models", this.pageOfListModels, request);
|
|
139
|
-
/**
|
|
140
|
-
* Get a model. Get the model for the given ID.
|
|
141
|
-
*
|
|
142
|
-
* @param request - The request {@link GetModelRequest}
|
|
143
|
-
* @returns A Promise of Model
|
|
144
|
-
*/
|
|
145
|
-
getModel = (request) => this.client.fetch({
|
|
146
|
-
method: "GET",
|
|
147
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
|
|
148
|
-
}, unmarshalModel);
|
|
149
|
-
/**
|
|
150
|
-
* Waits for {@link Model} to be in a final state.
|
|
151
|
-
*
|
|
152
|
-
* @param request - The request {@link GetModelRequest}
|
|
153
|
-
* @param options - The waiting options
|
|
154
|
-
* @returns A Promise of Model
|
|
155
|
-
*/
|
|
156
|
-
waitForModel = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!MODEL_TRANSIENT_STATUSES.includes(res.status))), this.getModel, request, options);
|
|
157
|
-
/**
|
|
158
|
-
* Import a model. Import a new model to your model library.
|
|
159
|
-
*
|
|
160
|
-
* @param request - The request {@link CreateModelRequest}
|
|
161
|
-
* @returns A Promise of Model
|
|
162
|
-
*/
|
|
163
|
-
createModel = (request) => this.client.fetch({
|
|
164
|
-
body: JSON.stringify(marshalCreateModelRequest(request, this.client.settings)),
|
|
165
|
-
headers: jsonContentHeaders,
|
|
166
|
-
method: "POST",
|
|
167
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`
|
|
168
|
-
}, unmarshalModel);
|
|
169
|
-
/**
|
|
170
|
-
* Delete a model. Delete an existing model from your model library.
|
|
171
|
-
*
|
|
172
|
-
* @param request - The request {@link DeleteModelRequest}
|
|
173
|
-
*/
|
|
174
|
-
deleteModel = (request) => this.client.fetch({
|
|
175
|
-
method: "DELETE",
|
|
176
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
|
|
177
|
-
});
|
|
178
|
-
pageOfListNodeTypes = (request) => this.client.fetch({
|
|
179
|
-
method: "GET",
|
|
180
|
-
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
181
|
-
urlParams: urlParams(["include_disabled_types", request.includeDisabledTypes], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
182
|
-
}, unmarshalListNodeTypesResponse);
|
|
183
|
-
/**
|
|
184
|
-
* List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
185
|
-
*
|
|
186
|
-
* @param request - The request {@link ListNodeTypesRequest}
|
|
187
|
-
* @returns A Promise of ListNodeTypesResponse
|
|
188
|
-
*/
|
|
189
|
-
listNodeTypes = (request) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.pageOfListDeployments = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`,
|
|
17
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
|
|
18
|
+
}, unmarshalListDeploymentsResponse);
|
|
19
|
+
this.listDeployments = (request = {}) => enrichForPagination("deployments", this.pageOfListDeployments, request);
|
|
20
|
+
this.getDeployment = (request) => this.client.fetch({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
|
|
23
|
+
}, unmarshalDeployment);
|
|
24
|
+
this.waitForDeployment = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))), this.getDeployment, request, options);
|
|
25
|
+
this.createDeployment = (request) => this.client.fetch({
|
|
26
|
+
body: JSON.stringify(marshalCreateDeploymentRequest(request, this.client.settings)),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`
|
|
30
|
+
}, unmarshalDeployment);
|
|
31
|
+
this.updateDeployment = (request) => this.client.fetch({
|
|
32
|
+
body: JSON.stringify(marshalUpdateDeploymentRequest(request, this.client.settings)),
|
|
33
|
+
headers: jsonContentHeaders,
|
|
34
|
+
method: "PATCH",
|
|
35
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
|
|
36
|
+
}, unmarshalDeployment);
|
|
37
|
+
this.deleteDeployment = (request) => this.client.fetch({
|
|
38
|
+
method: "DELETE",
|
|
39
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
|
|
40
|
+
}, unmarshalDeployment);
|
|
41
|
+
this.getDeploymentCertificate = (request) => this.client.fetch({
|
|
42
|
+
method: "GET",
|
|
43
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
|
|
44
|
+
urlParams: urlParams(["dl", 1]),
|
|
45
|
+
responseType: "blob"
|
|
46
|
+
});
|
|
47
|
+
this.createEndpoint = (request) => this.client.fetch({
|
|
48
|
+
body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
|
|
49
|
+
headers: jsonContentHeaders,
|
|
50
|
+
method: "POST",
|
|
51
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
52
|
+
}, unmarshalEndpoint);
|
|
53
|
+
this.updateEndpoint = (request) => this.client.fetch({
|
|
54
|
+
body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),
|
|
55
|
+
headers: jsonContentHeaders,
|
|
56
|
+
method: "PATCH",
|
|
57
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
58
|
+
}, unmarshalEndpoint);
|
|
59
|
+
this.deleteEndpoint = (request) => this.client.fetch({
|
|
60
|
+
method: "DELETE",
|
|
61
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
|
|
62
|
+
});
|
|
63
|
+
this.pageOfListModels = (request = {}) => this.client.fetch({
|
|
64
|
+
method: "GET",
|
|
65
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`,
|
|
66
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
|
|
67
|
+
}, unmarshalListModelsResponse);
|
|
68
|
+
this.listModels = (request = {}) => enrichForPagination("models", this.pageOfListModels, request);
|
|
69
|
+
this.getModel = (request) => this.client.fetch({
|
|
70
|
+
method: "GET",
|
|
71
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
|
|
72
|
+
}, unmarshalModel);
|
|
73
|
+
this.waitForModel = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!MODEL_TRANSIENT_STATUSES.includes(res.status))), this.getModel, request, options);
|
|
74
|
+
this.createModel = (request) => this.client.fetch({
|
|
75
|
+
body: JSON.stringify(marshalCreateModelRequest(request, this.client.settings)),
|
|
76
|
+
headers: jsonContentHeaders,
|
|
77
|
+
method: "POST",
|
|
78
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`
|
|
79
|
+
}, unmarshalModel);
|
|
80
|
+
this.deleteModel = (request) => this.client.fetch({
|
|
81
|
+
method: "DELETE",
|
|
82
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
|
|
83
|
+
});
|
|
84
|
+
this.pageOfListNodeTypes = (request) => this.client.fetch({
|
|
85
|
+
method: "GET",
|
|
86
|
+
path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
|
|
87
|
+
urlParams: urlParams(["include_disabled_types", request.includeDisabledTypes], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
88
|
+
}, unmarshalListNodeTypesResponse);
|
|
89
|
+
this.listNodeTypes = (request) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
90
|
+
}
|
|
91
|
+
static {
|
|
92
|
+
this.LOCALITY = toApiLocality({ regions: ["fr-par"] });
|
|
93
|
+
}
|
|
190
94
|
};
|
|
191
95
|
//#endregion
|
|
192
96
|
export { API };
|
package/dist/v1/content.gen.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
//#region src/v1/content.gen.ts
|
|
2
2
|
/** Lists transient statutes of the enum {@link DeploymentStatus}. */
|
|
3
|
-
|
|
3
|
+
const DEPLOYMENT_TRANSIENT_STATUSES = [
|
|
4
4
|
"creating",
|
|
5
5
|
"deploying",
|
|
6
6
|
"deleting",
|
|
7
7
|
"scaling"
|
|
8
8
|
];
|
|
9
9
|
/** Lists transient statutes of the enum {@link ModelStatus}. */
|
|
10
|
-
|
|
10
|
+
const MODEL_TRANSIENT_STATUSES = ["preparing", "downloading"];
|
|
11
11
|
//#endregion
|
|
12
12
|
export { DEPLOYMENT_TRANSIENT_STATUSES, MODEL_TRANSIENT_STATUSES };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
2
|
import randomName from "@scaleway/random-name";
|
|
3
3
|
//#region src/v1/marshalling.gen.ts
|
|
4
|
-
|
|
4
|
+
const unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
5
5
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
|
|
6
6
|
return { privateNetworkId: data.private_network_id };
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
const unmarshalEndpointPublicNetworkDetails = (data) => {
|
|
9
9
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`);
|
|
10
10
|
return {};
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
const unmarshalEndpoint = (data) => {
|
|
13
13
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
|
|
14
14
|
return {
|
|
15
15
|
disableAuth: data.disable_auth,
|
|
@@ -19,11 +19,11 @@ var unmarshalEndpoint = (data) => {
|
|
|
19
19
|
url: data.url
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
const unmarshalDeploymentQuantization = (data) => {
|
|
23
23
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeploymentQuantization' failed as data isn't a dictionary.`);
|
|
24
24
|
return { bits: data.bits };
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const unmarshalDeployment = (data) => {
|
|
27
27
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`);
|
|
28
28
|
return {
|
|
29
29
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -45,7 +45,7 @@ var unmarshalDeployment = (data) => {
|
|
|
45
45
|
updatedAt: unmarshalDate(data.updated_at)
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
const unmarshalModelSupportedQuantization = (data) => {
|
|
49
49
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ModelSupportedQuantization' failed as data isn't a dictionary.`);
|
|
50
50
|
return {
|
|
51
51
|
allowed: data.allowed,
|
|
@@ -53,18 +53,18 @@ var unmarshalModelSupportedQuantization = (data) => {
|
|
|
53
53
|
quantizationBits: data.quantization_bits
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
const unmarshalModelSupportedNode = (data) => {
|
|
57
57
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ModelSupportedNode' failed as data isn't a dictionary.`);
|
|
58
58
|
return {
|
|
59
59
|
nodeTypeName: data.node_type_name,
|
|
60
60
|
quantizations: unmarshalArrayOfObject(data.quantizations, unmarshalModelSupportedQuantization)
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
const unmarshalModelSupportInfo = (data) => {
|
|
64
64
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ModelSupportInfo' failed as data isn't a dictionary.`);
|
|
65
65
|
return { nodes: unmarshalArrayOfObject(data.nodes, unmarshalModelSupportedNode) };
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
const unmarshalModel = (data) => {
|
|
68
68
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Model' failed as data isn't a dictionary.`);
|
|
69
69
|
return {
|
|
70
70
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -83,21 +83,21 @@ var unmarshalModel = (data) => {
|
|
|
83
83
|
updatedAt: unmarshalDate(data.updated_at)
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
const unmarshalListDeploymentsResponse = (data) => {
|
|
87
87
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`);
|
|
88
88
|
return {
|
|
89
89
|
deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
|
|
90
90
|
totalCount: data.total_count
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
|
|
93
|
+
const unmarshalListModelsResponse = (data) => {
|
|
94
94
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`);
|
|
95
95
|
return {
|
|
96
96
|
models: unmarshalArrayOfObject(data.models, unmarshalModel),
|
|
97
97
|
totalCount: data.total_count
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
|
|
100
|
+
const unmarshalNodeType = (data) => {
|
|
101
101
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
|
|
102
102
|
return {
|
|
103
103
|
beta: data.beta,
|
|
@@ -114,17 +114,17 @@ var unmarshalNodeType = (data) => {
|
|
|
114
114
|
vram: data.vram
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
|
-
|
|
117
|
+
const unmarshalListNodeTypesResponse = (data) => {
|
|
118
118
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
|
|
119
119
|
return {
|
|
120
120
|
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
121
121
|
totalCount: data.total_count
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const marshalEndpointPrivateNetworkDetails = (request, defaults) => ({ private_network_id: request.privateNetworkId });
|
|
125
|
+
const marshalEndpointPublicNetworkDetails = (request, defaults) => ({});
|
|
126
|
+
const marshalDeploymentQuantization = (request, defaults) => ({ bits: request.bits });
|
|
127
|
+
const marshalEndpointSpec = (request, defaults) => ({
|
|
128
128
|
disable_auth: request.disableAuth,
|
|
129
129
|
...resolveOneOf([{
|
|
130
130
|
param: "public_network",
|
|
@@ -134,7 +134,7 @@ var marshalEndpointSpec = (request, defaults) => ({
|
|
|
134
134
|
value: request.privateNetwork !== void 0 ? marshalEndpointPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
|
|
135
135
|
}])
|
|
136
136
|
});
|
|
137
|
-
|
|
137
|
+
const marshalCreateDeploymentRequest = (request, defaults) => ({
|
|
138
138
|
accept_eula: request.acceptEula,
|
|
139
139
|
endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)),
|
|
140
140
|
max_size: request.maxSize,
|
|
@@ -146,23 +146,23 @@ var marshalCreateDeploymentRequest = (request, defaults) => ({
|
|
|
146
146
|
quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization, defaults) : void 0,
|
|
147
147
|
tags: request.tags
|
|
148
148
|
});
|
|
149
|
-
|
|
149
|
+
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
150
150
|
deployment_id: request.deploymentId,
|
|
151
151
|
endpoint: marshalEndpointSpec(request.endpoint, defaults)
|
|
152
152
|
});
|
|
153
|
-
|
|
153
|
+
const marshalModelSource = (request, defaults) => ({
|
|
154
154
|
url: request.url,
|
|
155
155
|
...resolveOneOf([{
|
|
156
156
|
param: "secret",
|
|
157
157
|
value: request.secret
|
|
158
158
|
}])
|
|
159
159
|
});
|
|
160
|
-
|
|
160
|
+
const marshalCreateModelRequest = (request, defaults) => ({
|
|
161
161
|
name: request.name || randomName("model"),
|
|
162
162
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
163
163
|
source: marshalModelSource(request.source, defaults)
|
|
164
164
|
});
|
|
165
|
-
|
|
165
|
+
const marshalUpdateDeploymentRequest = (request, defaults) => ({
|
|
166
166
|
max_size: request.maxSize,
|
|
167
167
|
min_size: request.minSize,
|
|
168
168
|
model_id: request.modelId,
|
|
@@ -170,6 +170,6 @@ var marshalUpdateDeploymentRequest = (request, defaults) => ({
|
|
|
170
170
|
quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization, defaults) : void 0,
|
|
171
171
|
tags: request.tags
|
|
172
172
|
});
|
|
173
|
-
|
|
173
|
+
const marshalUpdateEndpointRequest = (request, defaults) => ({ disable_auth: request.disableAuth });
|
|
174
174
|
//#endregion
|
|
175
175
|
export { marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateModelRequest, marshalUpdateDeploymentRequest, marshalUpdateEndpointRequest, unmarshalDeployment, unmarshalEndpoint, unmarshalListDeploymentsResponse, unmarshalListModelsResponse, unmarshalListNodeTypesResponse, unmarshalModel };
|
package/dist/v1/metadata.gen.js
CHANGED
|
@@ -8,7 +8,7 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
8
8
|
ListModelsRequest: () => ListModelsRequest,
|
|
9
9
|
UpdateDeploymentRequest: () => UpdateDeploymentRequest
|
|
10
10
|
});
|
|
11
|
-
|
|
11
|
+
const CreateDeploymentRequest = {
|
|
12
12
|
maxSize: {
|
|
13
13
|
greaterThanOrEqual: 1,
|
|
14
14
|
lessThanOrEqual: 50
|
|
@@ -27,21 +27,21 @@ var CreateDeploymentRequest = {
|
|
|
27
27
|
minLength: 1
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
const CreateModelRequest = { name: {
|
|
31
31
|
maxLength: 255,
|
|
32
32
|
minLength: 1,
|
|
33
33
|
pattern: /^[A-Za-z0-9-_/.:]+$/
|
|
34
34
|
} };
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const DeploymentQuantization = { bits: { lessThanOrEqual: 32 } };
|
|
36
|
+
const ListDeploymentsRequest = { name: {
|
|
37
37
|
maxLength: 255,
|
|
38
38
|
minLength: 1
|
|
39
39
|
} };
|
|
40
|
-
|
|
40
|
+
const ListModelsRequest = { name: {
|
|
41
41
|
maxLength: 255,
|
|
42
42
|
minLength: 1
|
|
43
43
|
} };
|
|
44
|
-
|
|
44
|
+
const UpdateDeploymentRequest = {
|
|
45
45
|
maxSize: {
|
|
46
46
|
greaterThanOrEqual: 1,
|
|
47
47
|
lessThanOrEqual: 50
|
|
@@ -37,7 +37,7 @@ export declare class API extends ParentAPI {
|
|
|
37
37
|
* @param options - The waiting options
|
|
38
38
|
* @returns A Promise of Deployment
|
|
39
39
|
*/
|
|
40
|
-
waitForDeployment: (request: Readonly<GetDeploymentRequest>, options?: Readonly<WaitForOptions<Deployment>>) => Promise<Deployment>;
|
|
40
|
+
waitForDeployment: (request: Readonly<GetDeploymentRequest>, options?: Readonly<WaitForOptions<Deployment>> | undefined) => Promise<Deployment>;
|
|
41
41
|
/**
|
|
42
42
|
* Create a deployment. Create a new inference deployment related to a specific model.
|
|
43
43
|
*
|