@scaleway/sdk-inference 2.2.0 → 2.2.2

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.
@@ -10,7 +10,9 @@ class API extends API$1 {
10
10
  * type ∈ {'zone','region','global','unspecified'}
11
11
  */
12
12
  static LOCALITY = toApiLocality({
13
- regions: ["fr-par"]
13
+ regions: [
14
+ "fr-par"
15
+ ]
14
16
  });
15
17
  pageOfListDeployments = (request = {}) => this.client.fetch(
16
18
  {
@@ -21,10 +23,7 @@ class API extends API$1 {
21
23
  ["order_by", request.orderBy],
22
24
  ["organization_id", request.organizationId],
23
25
  ["page", request.page],
24
- [
25
- "page_size",
26
- request.pageSize ?? this.client.settings.defaultPageSize
27
- ],
26
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
28
27
  ["project_id", request.projectId],
29
28
  ["tags", request.tags]
30
29
  )
@@ -59,9 +58,7 @@ class API extends API$1 {
59
58
  * @returns A Promise of Deployment
60
59
  */
61
60
  waitForDeployment = (request, options) => waitForResource(
62
- options?.stop ?? ((res) => Promise.resolve(
63
- !DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status)
64
- )),
61
+ options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))),
65
62
  this.getDeployment,
66
63
  request,
67
64
  options
@@ -120,12 +117,16 @@ class API extends API$1 {
120
117
  * @param request - The request {@link GetDeploymentCertificateRequest}
121
118
  * @returns A Promise of Blob
122
119
  */
123
- getDeploymentCertificate = (request) => this.client.fetch({
124
- method: "GET",
125
- path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
126
- urlParams: urlParams(["dl", 1]),
127
- responseType: "blob"
128
- });
120
+ getDeploymentCertificate = (request) => this.client.fetch(
121
+ {
122
+ method: "GET",
123
+ path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
124
+ urlParams: urlParams(
125
+ ["dl", 1]
126
+ ),
127
+ responseType: "blob"
128
+ }
129
+ );
129
130
  /**
130
131
  * Create an endpoint. Create a new Endpoint related to a specific deployment.
131
132
  *
@@ -165,10 +166,12 @@ class API extends API$1 {
165
166
  *
166
167
  * @param request - The request {@link DeleteEndpointRequest}
167
168
  */
168
- deleteEndpoint = (request) => this.client.fetch({
169
- method: "DELETE",
170
- path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
171
- });
169
+ deleteEndpoint = (request) => this.client.fetch(
170
+ {
171
+ method: "DELETE",
172
+ path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
173
+ }
174
+ );
172
175
  pageOfListModels = (request = {}) => this.client.fetch(
173
176
  {
174
177
  method: "GET",
@@ -177,10 +180,7 @@ class API extends API$1 {
177
180
  ["name", request.name],
178
181
  ["order_by", request.orderBy],
179
182
  ["page", request.page],
180
- [
181
- "page_size",
182
- request.pageSize ?? this.client.settings.defaultPageSize
183
- ],
183
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
184
184
  ["project_id", request.projectId],
185
185
  ["tags", request.tags]
186
186
  )
@@ -215,9 +215,7 @@ class API extends API$1 {
215
215
  * @returns A Promise of Model
216
216
  */
217
217
  waitForModel = (request, options) => waitForResource(
218
- options?.stop ?? ((res) => Promise.resolve(
219
- !MODEL_TRANSIENT_STATUSES.includes(res.status)
220
- )),
218
+ options?.stop ?? ((res) => Promise.resolve(!MODEL_TRANSIENT_STATUSES.includes(res.status))),
221
219
  this.getModel,
222
220
  request,
223
221
  options
@@ -244,10 +242,12 @@ class API extends API$1 {
244
242
  *
245
243
  * @param request - The request {@link DeleteModelRequest}
246
244
  */
247
- deleteModel = (request) => this.client.fetch({
248
- method: "DELETE",
249
- path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
250
- });
245
+ deleteModel = (request) => this.client.fetch(
246
+ {
247
+ method: "DELETE",
248
+ path: `/inference/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam("modelId", request.modelId)}`
249
+ }
250
+ );
251
251
  pageOfListNodeTypes = (request) => this.client.fetch(
252
252
  {
253
253
  method: "GET",
@@ -255,10 +255,7 @@ class API extends API$1 {
255
255
  urlParams: urlParams(
256
256
  ["include_disabled_types", request.includeDisabledTypes],
257
257
  ["page", request.page],
258
- [
259
- "page_size",
260
- request.pageSize ?? this.client.settings.defaultPageSize
261
- ]
258
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
262
259
  )
263
260
  },
264
261
  unmarshalListNodeTypesResponse
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
4
  export type { CreateDeploymentRequest, CreateEndpointRequest, CreateModelRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteModelRequest, Deployment, DeploymentQuantization, DeploymentStatus, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicNetworkDetails, EndpointSpec, GetDeploymentCertificateRequest, GetDeploymentRequest, GetModelRequest, ListDeploymentsRequest, ListDeploymentsRequestOrderBy, ListDeploymentsResponse, ListModelsRequest, ListModelsRequestOrderBy, ListModelsResponse, ListNodeTypesRequest, ListNodeTypesResponse, Model, ModelSource, ModelStatus, ModelSupportedNode, ModelSupportedQuantization, ModelSupportInfo, NodeType, NodeTypeStock, UpdateDeploymentRequest, UpdateEndpointRequest, } from './types.gen.js';
@@ -88,10 +88,7 @@ const unmarshalModelSupportedNode = (data) => {
88
88
  }
89
89
  return {
90
90
  nodeTypeName: data.node_type_name,
91
- quantizations: unmarshalArrayOfObject(
92
- data.quantizations,
93
- unmarshalModelSupportedQuantization
94
- )
91
+ quantizations: unmarshalArrayOfObject(data.quantizations, unmarshalModelSupportedQuantization)
95
92
  };
96
93
  };
97
94
  const unmarshalModelSupportInfo = (data) => {
@@ -117,10 +114,7 @@ const unmarshalModel = (data) => {
117
114
  hasEula: data.has_eula,
118
115
  id: data.id,
119
116
  name: data.name,
120
- nodesSupport: unmarshalArrayOfObject(
121
- data.nodes_support,
122
- unmarshalModelSupportInfo
123
- ),
117
+ nodesSupport: unmarshalArrayOfObject(data.nodes_support, unmarshalModelSupportInfo),
124
118
  parameterSizeBits: data.parameter_size_bits,
125
119
  projectId: data.project_id,
126
120
  region: data.region,
@@ -200,9 +194,7 @@ const marshalEndpointSpec = (request, defaults) => ({
200
194
  },
201
195
  {
202
196
  param: "private_network",
203
- value: request.privateNetwork !== void 0 ? marshalEndpointPrivateNetworkDetails(
204
- request.privateNetwork
205
- ) : void 0
197
+ value: request.privateNetwork !== void 0 ? marshalEndpointPrivateNetworkDetails(request.privateNetwork) : void 0
206
198
  }
207
199
  ])
208
200
  });
@@ -224,7 +216,12 @@ const marshalCreateEndpointRequest = (request, defaults) => ({
224
216
  });
225
217
  const marshalModelSource = (request, defaults) => ({
226
218
  url: request.url,
227
- ...resolveOneOf([{ param: "secret", value: request.secret }])
219
+ ...resolveOneOf([
220
+ {
221
+ param: "secret",
222
+ value: request.secret
223
+ }
224
+ ])
228
225
  });
229
226
  const marshalCreateModelRequest = (request, defaults) => ({
230
227
  name: request.name || randomName("model"),
@@ -10,7 +10,9 @@ class API extends API$1 {
10
10
  * type ∈ {'zone','region','global','unspecified'}
11
11
  */
12
12
  static LOCALITY = toApiLocality({
13
- regions: ["fr-par"]
13
+ regions: [
14
+ "fr-par"
15
+ ]
14
16
  });
15
17
  pageOfListDeployments = (request = {}) => this.client.fetch(
16
18
  {
@@ -21,10 +23,7 @@ class API extends API$1 {
21
23
  ["order_by", request.orderBy],
22
24
  ["organization_id", request.organizationId],
23
25
  ["page", request.page],
24
- [
25
- "page_size",
26
- request.pageSize ?? this.client.settings.defaultPageSize
27
- ],
26
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
28
27
  ["project_id", request.projectId],
29
28
  ["tags", request.tags]
30
29
  )
@@ -59,9 +58,7 @@ class API extends API$1 {
59
58
  * @returns A Promise of Deployment
60
59
  */
61
60
  waitForDeployment = (request, options) => waitForResource(
62
- options?.stop ?? ((res) => Promise.resolve(
63
- !DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status)
64
- )),
61
+ options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))),
65
62
  this.getDeployment,
66
63
  request,
67
64
  options
@@ -120,12 +117,16 @@ class API extends API$1 {
120
117
  * @param request - The request {@link GetDeploymentCertificateRequest}
121
118
  * @returns A Promise of Blob
122
119
  */
123
- getDeploymentCertificate = (request) => this.client.fetch({
124
- method: "GET",
125
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
126
- urlParams: urlParams(["dl", 1]),
127
- responseType: "blob"
128
- });
120
+ getDeploymentCertificate = (request) => this.client.fetch(
121
+ {
122
+ method: "GET",
123
+ path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
124
+ urlParams: urlParams(
125
+ ["dl", 1]
126
+ ),
127
+ responseType: "blob"
128
+ }
129
+ );
129
130
  /**
130
131
  * Create an endpoint. Create a new Endpoint related to a specific deployment.
131
132
  *
@@ -165,20 +166,19 @@ class API extends API$1 {
165
166
  *
166
167
  * @param request - The request {@link DeleteEndpointRequest}
167
168
  */
168
- deleteEndpoint = (request) => this.client.fetch({
169
- method: "DELETE",
170
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
171
- });
169
+ deleteEndpoint = (request) => this.client.fetch(
170
+ {
171
+ method: "DELETE",
172
+ path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
173
+ }
174
+ );
172
175
  pageOfListDeploymentACLRules = (request) => this.client.fetch(
173
176
  {
174
177
  method: "GET",
175
178
  path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/acls`,
176
179
  urlParams: urlParams(
177
180
  ["page", request.page],
178
- [
179
- "page_size",
180
- request.pageSize ?? this.client.settings.defaultPageSize
181
- ]
181
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
182
182
  )
183
183
  },
184
184
  unmarshalListDeploymentACLRulesResponse
@@ -229,10 +229,12 @@ class API extends API$1 {
229
229
  *
230
230
  * @param request - The request {@link DeleteDeploymentACLRuleRequest}
231
231
  */
232
- deleteDeploymentACLRule = (request) => this.client.fetch({
233
- method: "DELETE",
234
- path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam("aclId", request.aclId)}`
235
- });
232
+ deleteDeploymentACLRule = (request) => this.client.fetch(
233
+ {
234
+ method: "DELETE",
235
+ path: `/inference/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam("aclId", request.aclId)}`
236
+ }
237
+ );
236
238
  pageOfListModels = (request = {}) => this.client.fetch(
237
239
  {
238
240
  method: "GET",
@@ -241,10 +243,7 @@ class API extends API$1 {
241
243
  ["name", request.name],
242
244
  ["order_by", request.orderBy],
243
245
  ["page", request.page],
244
- [
245
- "page_size",
246
- request.pageSize ?? this.client.settings.defaultPageSize
247
- ],
246
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
248
247
  ["project_id", request.projectId],
249
248
  ["tags", request.tags]
250
249
  )
@@ -285,10 +284,7 @@ class API extends API$1 {
285
284
  urlParams: urlParams(
286
285
  ["include_disabled_types", request.includeDisabledTypes],
287
286
  ["page", request.page],
288
- [
289
- "page_size",
290
- request.pageSize ?? this.client.settings.defaultPageSize
291
- ]
287
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
292
288
  )
293
289
  },
294
290
  unmarshalListNodeTypesResponse
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
4
  export type { ACLRule, ACLRuleRequest, AddDeploymentACLRulesRequest, AddDeploymentACLRulesResponse, CreateDeploymentRequest, CreateEndpointRequest, DeleteDeploymentACLRuleRequest, DeleteDeploymentRequest, DeleteEndpointRequest, Deployment, DeploymentStatus, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicAccessDetails, EndpointSpec, EndpointSpecPrivateNetwork, EndpointSpecPublic, Eula, GetDeploymentCertificateRequest, GetDeploymentRequest, GetModelEulaRequest, GetModelRequest, ListDeploymentACLRulesRequest, ListDeploymentACLRulesResponse, ListDeploymentsRequest, ListDeploymentsRequestOrderBy, ListDeploymentsResponse, ListModelsRequest, ListModelsRequestOrderBy, ListModelsResponse, ListNodeTypesRequest, ListNodeTypesResponse, Model, ModelS3Model, NodeType, NodeTypeStock, SetDeploymentACLRulesRequest, SetDeploymentACLRulesResponse, UpdateDeploymentRequest, UpdateEndpointRequest, } from './types.gen.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-inference",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Scaleway SDK inference",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.1.1"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@scaleway/sdk-client": "^2.1.0"