@scaleway/sdk-inference 1.3.0 → 2.1.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.
@@ -1,257 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const randomName = require("@scaleway/random-name");
4
- const sdkClient = require("@scaleway/sdk-client");
5
- const unmarshalEndpointPrivateNetworkDetails = (data) => {
6
- if (!sdkClient.isJSONObject(data)) {
7
- throw new TypeError(
8
- `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
9
- );
10
- }
11
- return {
12
- privateNetworkId: data.private_network_id
13
- };
14
- };
15
- const unmarshalEndpointPublicNetworkDetails = (data) => {
16
- if (!sdkClient.isJSONObject(data)) {
17
- throw new TypeError(
18
- `Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`
19
- );
20
- }
21
- return {};
22
- };
23
- const unmarshalEndpoint = (data) => {
24
- if (!sdkClient.isJSONObject(data)) {
25
- throw new TypeError(
26
- `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
27
- );
28
- }
29
- return {
30
- disableAuth: data.disable_auth,
31
- id: data.id,
32
- privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
33
- publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : void 0,
34
- url: data.url
35
- };
36
- };
37
- const unmarshalDeploymentQuantization = (data) => {
38
- if (!sdkClient.isJSONObject(data)) {
39
- throw new TypeError(
40
- `Unmarshalling the type 'DeploymentQuantization' failed as data isn't a dictionary.`
41
- );
42
- }
43
- return {
44
- bits: data.bits
45
- };
46
- };
47
- const unmarshalDeployment = (data) => {
48
- if (!sdkClient.isJSONObject(data)) {
49
- throw new TypeError(
50
- `Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`
51
- );
52
- }
53
- return {
54
- createdAt: sdkClient.unmarshalDate(data.created_at),
55
- endpoints: sdkClient.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
56
- errorMessage: data.error_message,
57
- id: data.id,
58
- maxSize: data.max_size,
59
- minSize: data.min_size,
60
- modelId: data.model_id,
61
- modelName: data.model_name,
62
- name: data.name,
63
- nodeTypeName: data.node_type_name,
64
- projectId: data.project_id,
65
- quantization: data.quantization ? unmarshalDeploymentQuantization(data.quantization) : void 0,
66
- region: data.region,
67
- size: data.size,
68
- status: data.status,
69
- tags: data.tags,
70
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
71
- };
72
- };
73
- const unmarshalModelSupportedQuantization = (data) => {
74
- if (!sdkClient.isJSONObject(data)) {
75
- throw new TypeError(
76
- `Unmarshalling the type 'ModelSupportedQuantization' failed as data isn't a dictionary.`
77
- );
78
- }
79
- return {
80
- allowed: data.allowed,
81
- maxContextSize: data.max_context_size,
82
- quantizationBits: data.quantization_bits
83
- };
84
- };
85
- const unmarshalModelSupportedNode = (data) => {
86
- if (!sdkClient.isJSONObject(data)) {
87
- throw new TypeError(
88
- `Unmarshalling the type 'ModelSupportedNode' failed as data isn't a dictionary.`
89
- );
90
- }
91
- return {
92
- nodeTypeName: data.node_type_name,
93
- quantizations: sdkClient.unmarshalArrayOfObject(
94
- data.quantizations,
95
- unmarshalModelSupportedQuantization
96
- )
97
- };
98
- };
99
- const unmarshalModelSupportInfo = (data) => {
100
- if (!sdkClient.isJSONObject(data)) {
101
- throw new TypeError(
102
- `Unmarshalling the type 'ModelSupportInfo' failed as data isn't a dictionary.`
103
- );
104
- }
105
- return {
106
- nodes: sdkClient.unmarshalArrayOfObject(data.nodes, unmarshalModelSupportedNode)
107
- };
108
- };
109
- const unmarshalModel = (data) => {
110
- if (!sdkClient.isJSONObject(data)) {
111
- throw new TypeError(
112
- `Unmarshalling the type 'Model' failed as data isn't a dictionary.`
113
- );
114
- }
115
- return {
116
- createdAt: sdkClient.unmarshalDate(data.created_at),
117
- description: data.description,
118
- errorMessage: data.error_message,
119
- hasEula: data.has_eula,
120
- id: data.id,
121
- name: data.name,
122
- nodesSupport: sdkClient.unmarshalArrayOfObject(
123
- data.nodes_support,
124
- unmarshalModelSupportInfo
125
- ),
126
- parameterSizeBits: data.parameter_size_bits,
127
- projectId: data.project_id,
128
- region: data.region,
129
- sizeBytes: data.size_bytes,
130
- status: data.status,
131
- tags: data.tags,
132
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
133
- };
134
- };
135
- const unmarshalListDeploymentsResponse = (data) => {
136
- if (!sdkClient.isJSONObject(data)) {
137
- throw new TypeError(
138
- `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`
139
- );
140
- }
141
- return {
142
- deployments: sdkClient.unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
143
- totalCount: data.total_count
144
- };
145
- };
146
- const unmarshalListModelsResponse = (data) => {
147
- if (!sdkClient.isJSONObject(data)) {
148
- throw new TypeError(
149
- `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
150
- );
151
- }
152
- return {
153
- models: sdkClient.unmarshalArrayOfObject(data.models, unmarshalModel),
154
- totalCount: data.total_count
155
- };
156
- };
157
- const unmarshalNodeType = (data) => {
158
- if (!sdkClient.isJSONObject(data)) {
159
- throw new TypeError(
160
- `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
161
- );
162
- }
163
- return {
164
- beta: data.beta,
165
- createdAt: sdkClient.unmarshalDate(data.created_at),
166
- description: data.description,
167
- disabled: data.disabled,
168
- gpus: data.gpus,
169
- memory: data.memory,
170
- name: data.name,
171
- region: data.region,
172
- stockStatus: data.stock_status,
173
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
174
- vcpus: data.vcpus,
175
- vram: data.vram
176
- };
177
- };
178
- const unmarshalListNodeTypesResponse = (data) => {
179
- if (!sdkClient.isJSONObject(data)) {
180
- throw new TypeError(
181
- `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
182
- );
183
- }
184
- return {
185
- nodeTypes: sdkClient.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
186
- totalCount: data.total_count
187
- };
188
- };
189
- const marshalEndpointPrivateNetworkDetails = (request, defaults) => ({
190
- private_network_id: request.privateNetworkId
191
- });
192
- const marshalEndpointPublicNetworkDetails = (request, defaults) => ({});
193
- const marshalDeploymentQuantization = (request, defaults) => ({
194
- bits: request.bits
195
- });
196
- const marshalEndpointSpec = (request, defaults) => ({
197
- disable_auth: request.disableAuth,
198
- ...sdkClient.resolveOneOf([
199
- {
200
- param: "public_network",
201
- value: request.publicNetwork !== void 0 ? marshalEndpointPublicNetworkDetails(request.publicNetwork) : void 0
202
- },
203
- {
204
- param: "private_network",
205
- value: request.privateNetwork !== void 0 ? marshalEndpointPrivateNetworkDetails(
206
- request.privateNetwork
207
- ) : void 0
208
- }
209
- ])
210
- });
211
- const marshalCreateDeploymentRequest = (request, defaults) => ({
212
- accept_eula: request.acceptEula,
213
- endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)),
214
- max_size: request.maxSize,
215
- min_size: request.minSize,
216
- model_id: request.modelId,
217
- name: request.name || randomName("inference"),
218
- node_type_name: request.nodeTypeName,
219
- project_id: request.projectId ?? defaults.defaultProjectId,
220
- quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization) : void 0,
221
- tags: request.tags
222
- });
223
- const marshalCreateEndpointRequest = (request, defaults) => ({
224
- deployment_id: request.deploymentId,
225
- endpoint: marshalEndpointSpec(request.endpoint)
226
- });
227
- const marshalModelSource = (request, defaults) => ({
228
- url: request.url,
229
- ...sdkClient.resolveOneOf([{ param: "secret", value: request.secret }])
230
- });
231
- const marshalCreateModelRequest = (request, defaults) => ({
232
- name: request.name || randomName("model"),
233
- project_id: request.projectId ?? defaults.defaultProjectId,
234
- source: marshalModelSource(request.source)
235
- });
236
- const marshalUpdateDeploymentRequest = (request, defaults) => ({
237
- max_size: request.maxSize,
238
- min_size: request.minSize,
239
- model_id: request.modelId,
240
- name: request.name,
241
- quantization: request.quantization !== void 0 ? marshalDeploymentQuantization(request.quantization) : void 0,
242
- tags: request.tags
243
- });
244
- const marshalUpdateEndpointRequest = (request, defaults) => ({
245
- disable_auth: request.disableAuth
246
- });
247
- exports.marshalCreateDeploymentRequest = marshalCreateDeploymentRequest;
248
- exports.marshalCreateEndpointRequest = marshalCreateEndpointRequest;
249
- exports.marshalCreateModelRequest = marshalCreateModelRequest;
250
- exports.marshalUpdateDeploymentRequest = marshalUpdateDeploymentRequest;
251
- exports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest;
252
- exports.unmarshalDeployment = unmarshalDeployment;
253
- exports.unmarshalEndpoint = unmarshalEndpoint;
254
- exports.unmarshalListDeploymentsResponse = unmarshalListDeploymentsResponse;
255
- exports.unmarshalListModelsResponse = unmarshalListModelsResponse;
256
- exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;
257
- exports.unmarshalModel = unmarshalModel;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const CreateDeploymentRequest = {
4
- maxSize: {
5
- greaterThanOrEqual: 1,
6
- lessThanOrEqual: 50
7
- },
8
- minSize: {
9
- greaterThanOrEqual: 1,
10
- lessThanOrEqual: 50
11
- },
12
- name: {
13
- maxLength: 255,
14
- minLength: 1,
15
- pattern: /^[A-Za-z0-9-_]+$/
16
- },
17
- nodeTypeName: {
18
- maxLength: 64,
19
- minLength: 1
20
- }
21
- };
22
- const CreateModelRequest = {
23
- name: {
24
- maxLength: 255,
25
- minLength: 1,
26
- pattern: /^[A-Za-z0-9-_/.:]+$/
27
- }
28
- };
29
- const DeploymentQuantization = {
30
- bits: {
31
- lessThanOrEqual: 32
32
- }
33
- };
34
- const ListDeploymentsRequest = {
35
- name: {
36
- maxLength: 255,
37
- minLength: 1
38
- }
39
- };
40
- const ListModelsRequest = {
41
- name: {
42
- maxLength: 255,
43
- minLength: 1
44
- }
45
- };
46
- const UpdateDeploymentRequest = {
47
- maxSize: {
48
- greaterThanOrEqual: 1,
49
- lessThanOrEqual: 50
50
- },
51
- minSize: {
52
- greaterThanOrEqual: 1,
53
- lessThanOrEqual: 50
54
- },
55
- name: {
56
- maxLength: 255,
57
- minLength: 1
58
- }
59
- };
60
- exports.CreateDeploymentRequest = CreateDeploymentRequest;
61
- exports.CreateModelRequest = CreateModelRequest;
62
- exports.DeploymentQuantization = DeploymentQuantization;
63
- exports.ListDeploymentsRequest = ListDeploymentsRequest;
64
- exports.ListModelsRequest = ListModelsRequest;
65
- exports.UpdateDeploymentRequest = UpdateDeploymentRequest;
@@ -1,306 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class API extends sdkClient.API {
10
- /**
11
- * Locality of this API.
12
- * type ∈ {'zone','region','global','unspecified'}
13
- */
14
- static LOCALITY = sdkClient.toApiLocality({
15
- regions: ["fr-par"]
16
- });
17
- pageOfListDeployments = (request = {}) => this.client.fetch(
18
- {
19
- method: "GET",
20
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`,
21
- urlParams: sdkClient.urlParams(
22
- ["name", request.name],
23
- ["order_by", request.orderBy],
24
- ["organization_id", request.organizationId],
25
- ["page", request.page],
26
- [
27
- "page_size",
28
- request.pageSize ?? this.client.settings.defaultPageSize
29
- ],
30
- ["project_id", request.projectId],
31
- ["tags", request.tags]
32
- )
33
- },
34
- marshalling_gen.unmarshalListDeploymentsResponse
35
- );
36
- /**
37
- * List inference deployments. List all your inference deployments.
38
- *
39
- * @param request - The request {@link ListDeploymentsRequest}
40
- * @returns A Promise of ListDeploymentsResponse
41
- */
42
- listDeployments = (request = {}) => sdkClient.enrichForPagination("deployments", this.pageOfListDeployments, request);
43
- /**
44
- * Get a deployment. Get the deployment for the given ID.
45
- *
46
- * @param request - The request {@link GetDeploymentRequest}
47
- * @returns A Promise of Deployment
48
- */
49
- getDeployment = (request) => this.client.fetch(
50
- {
51
- method: "GET",
52
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${sdkClient.validatePathParam("deploymentId", request.deploymentId)}`
53
- },
54
- marshalling_gen.unmarshalDeployment
55
- );
56
- /**
57
- * Waits for {@link Deployment} to be in a final state.
58
- *
59
- * @param request - The request {@link GetDeploymentRequest}
60
- * @param options - The waiting options
61
- * @returns A Promise of Deployment
62
- */
63
- waitForDeployment = (request, options) => sdkClient.waitForResource(
64
- options?.stop ?? ((res) => Promise.resolve(
65
- !content_gen.DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status)
66
- )),
67
- this.getDeployment,
68
- request,
69
- options
70
- );
71
- /**
72
- * Create a deployment. Create a new inference deployment related to a specific model.
73
- *
74
- * @param request - The request {@link CreateDeploymentRequest}
75
- * @returns A Promise of Deployment
76
- */
77
- createDeployment = (request) => this.client.fetch(
78
- {
79
- body: JSON.stringify(
80
- marshalling_gen.marshalCreateDeploymentRequest(request, this.client.settings)
81
- ),
82
- headers: jsonContentHeaders,
83
- method: "POST",
84
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`
85
- },
86
- marshalling_gen.unmarshalDeployment
87
- );
88
- /**
89
- * Update a deployment. Update an existing inference deployment.
90
- *
91
- * @param request - The request {@link UpdateDeploymentRequest}
92
- * @returns A Promise of Deployment
93
- */
94
- updateDeployment = (request) => this.client.fetch(
95
- {
96
- body: JSON.stringify(
97
- marshalling_gen.marshalUpdateDeploymentRequest(request, this.client.settings)
98
- ),
99
- headers: jsonContentHeaders,
100
- method: "PATCH",
101
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${sdkClient.validatePathParam("deploymentId", request.deploymentId)}`
102
- },
103
- marshalling_gen.unmarshalDeployment
104
- );
105
- /**
106
- * Delete a deployment. Delete an existing inference deployment.
107
- *
108
- * @param request - The request {@link DeleteDeploymentRequest}
109
- * @returns A Promise of Deployment
110
- */
111
- deleteDeployment = (request) => this.client.fetch(
112
- {
113
- method: "DELETE",
114
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${sdkClient.validatePathParam("deploymentId", request.deploymentId)}`
115
- },
116
- marshalling_gen.unmarshalDeployment
117
- );
118
- /**
119
- * Get the CA certificate. Get the CA certificate used for the deployment of private endpoints.
120
- The CA certificate will be returned as a PEM file.
121
- *
122
- * @param request - The request {@link GetDeploymentCertificateRequest}
123
- * @returns A Promise of Blob
124
- */
125
- getDeploymentCertificate = (request) => this.client.fetch({
126
- method: "GET",
127
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${sdkClient.validatePathParam("deploymentId", request.deploymentId)}/certificate`,
128
- urlParams: sdkClient.urlParams(["dl", 1]),
129
- responseType: "blob"
130
- });
131
- /**
132
- * Create an endpoint. Create a new Endpoint related to a specific deployment.
133
- *
134
- * @param request - The request {@link CreateEndpointRequest}
135
- * @returns A Promise of Endpoint
136
- */
137
- createEndpoint = (request) => this.client.fetch(
138
- {
139
- body: JSON.stringify(
140
- marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings)
141
- ),
142
- headers: jsonContentHeaders,
143
- method: "POST",
144
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
145
- },
146
- marshalling_gen.unmarshalEndpoint
147
- );
148
- /**
149
- * Update an endpoint. Update an existing Endpoint.
150
- *
151
- * @param request - The request {@link UpdateEndpointRequest}
152
- * @returns A Promise of Endpoint
153
- */
154
- updateEndpoint = (request) => this.client.fetch(
155
- {
156
- body: JSON.stringify(
157
- marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings)
158
- ),
159
- headers: jsonContentHeaders,
160
- method: "PATCH",
161
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}`
162
- },
163
- marshalling_gen.unmarshalEndpoint
164
- );
165
- /**
166
- * Delete an endpoint. Delete an existing Endpoint.
167
- *
168
- * @param request - The request {@link DeleteEndpointRequest}
169
- */
170
- deleteEndpoint = (request) => this.client.fetch({
171
- method: "DELETE",
172
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${sdkClient.validatePathParam("endpointId", request.endpointId)}`
173
- });
174
- pageOfListDeploymentACLRules = (request) => this.client.fetch(
175
- {
176
- method: "GET",
177
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${sdkClient.validatePathParam("deploymentId", request.deploymentId)}/acls`,
178
- urlParams: sdkClient.urlParams(
179
- ["page", request.page],
180
- [
181
- "page_size",
182
- request.pageSize ?? this.client.settings.defaultPageSize
183
- ]
184
- )
185
- },
186
- marshalling_gen.unmarshalListDeploymentACLRulesResponse
187
- );
188
- /**
189
- * List your ACLs. List ACLs for a specific deployment.
190
- *
191
- * @param request - The request {@link ListDeploymentACLRulesRequest}
192
- * @returns A Promise of ListDeploymentACLRulesResponse
193
- */
194
- listDeploymentACLRules = (request) => sdkClient.enrichForPagination("rules", this.pageOfListDeploymentACLRules, request);
195
- /**
196
- * Add new ACLs. Add new ACL rules for a specific deployment.
197
- *
198
- * @param request - The request {@link AddDeploymentACLRulesRequest}
199
- * @returns A Promise of AddDeploymentACLRulesResponse
200
- */
201
- addDeploymentACLRules = (request) => this.client.fetch(
202
- {
203
- body: JSON.stringify(
204
- marshalling_gen.marshalAddDeploymentACLRulesRequest(request, this.client.settings)
205
- ),
206
- headers: jsonContentHeaders,
207
- method: "POST",
208
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${sdkClient.validatePathParam("deploymentId", request.deploymentId)}/acls`
209
- },
210
- marshalling_gen.unmarshalAddDeploymentACLRulesResponse
211
- );
212
- /**
213
- * Set new ACL. Set new ACL rules for a specific deployment.
214
- *
215
- * @param request - The request {@link SetDeploymentACLRulesRequest}
216
- * @returns A Promise of SetDeploymentACLRulesResponse
217
- */
218
- setDeploymentACLRules = (request) => this.client.fetch(
219
- {
220
- body: JSON.stringify(
221
- marshalling_gen.marshalSetDeploymentACLRulesRequest(request, this.client.settings)
222
- ),
223
- headers: jsonContentHeaders,
224
- method: "PUT",
225
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${sdkClient.validatePathParam("deploymentId", request.deploymentId)}/acls`
226
- },
227
- marshalling_gen.unmarshalSetDeploymentACLRulesResponse
228
- );
229
- /**
230
- * Delete an existing ACL.
231
- *
232
- * @param request - The request {@link DeleteDeploymentACLRuleRequest}
233
- */
234
- deleteDeploymentACLRule = (request) => this.client.fetch({
235
- method: "DELETE",
236
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
237
- });
238
- pageOfListModels = (request = {}) => this.client.fetch(
239
- {
240
- method: "GET",
241
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`,
242
- urlParams: sdkClient.urlParams(
243
- ["name", request.name],
244
- ["order_by", request.orderBy],
245
- ["page", request.page],
246
- [
247
- "page_size",
248
- request.pageSize ?? this.client.settings.defaultPageSize
249
- ],
250
- ["project_id", request.projectId],
251
- ["tags", request.tags]
252
- )
253
- },
254
- marshalling_gen.unmarshalListModelsResponse
255
- );
256
- /**
257
- * List models. List all available models.
258
- *
259
- * @param request - The request {@link ListModelsRequest}
260
- * @returns A Promise of ListModelsResponse
261
- */
262
- listModels = (request = {}) => sdkClient.enrichForPagination("models", this.pageOfListModels, request);
263
- /**
264
- * Get a model. Get the model for the given ID.
265
- *
266
- * @param request - The request {@link GetModelRequest}
267
- * @returns A Promise of Model
268
- */
269
- getModel = (request) => this.client.fetch(
270
- {
271
- method: "GET",
272
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${sdkClient.validatePathParam("modelId", request.modelId)}`
273
- },
274
- marshalling_gen.unmarshalModel
275
- );
276
- getModelEula = (request) => this.client.fetch(
277
- {
278
- method: "GET",
279
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${sdkClient.validatePathParam("modelId", request.modelId)}/eula`
280
- },
281
- marshalling_gen.unmarshalEula
282
- );
283
- pageOfListNodeTypes = (request) => this.client.fetch(
284
- {
285
- method: "GET",
286
- path: `/inference/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
287
- urlParams: sdkClient.urlParams(
288
- ["include_disabled_types", request.includeDisabledTypes],
289
- ["page", request.page],
290
- [
291
- "page_size",
292
- request.pageSize ?? this.client.settings.defaultPageSize
293
- ]
294
- )
295
- },
296
- marshalling_gen.unmarshalListNodeTypesResponse
297
- );
298
- /**
299
- * 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.
300
- *
301
- * @param request - The request {@link ListNodeTypesRequest}
302
- * @returns A Promise of ListNodeTypesResponse
303
- */
304
- listNodeTypes = (request) => sdkClient.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
305
- }
306
- exports.API = API;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const DEPLOYMENT_TRANSIENT_STATUSES = [
4
- "creating",
5
- "deploying",
6
- "deleting",
7
- "scaling"
8
- ];
9
- exports.DEPLOYMENT_TRANSIENT_STATUSES = DEPLOYMENT_TRANSIENT_STATUSES;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const api_gen = require("./api.gen.cjs");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const validationRules_gen = require("./validation-rules.gen.cjs");
7
- exports.API = api_gen.API;
8
- exports.DEPLOYMENT_TRANSIENT_STATUSES = content_gen.DEPLOYMENT_TRANSIENT_STATUSES;
9
- exports.marshalAddDeploymentACLRulesRequest = marshalling_gen.marshalAddDeploymentACLRulesRequest;
10
- exports.marshalCreateDeploymentRequest = marshalling_gen.marshalCreateDeploymentRequest;
11
- exports.marshalCreateEndpointRequest = marshalling_gen.marshalCreateEndpointRequest;
12
- exports.marshalSetDeploymentACLRulesRequest = marshalling_gen.marshalSetDeploymentACLRulesRequest;
13
- exports.marshalUpdateDeploymentRequest = marshalling_gen.marshalUpdateDeploymentRequest;
14
- exports.marshalUpdateEndpointRequest = marshalling_gen.marshalUpdateEndpointRequest;
15
- exports.unmarshalAddDeploymentACLRulesResponse = marshalling_gen.unmarshalAddDeploymentACLRulesResponse;
16
- exports.unmarshalDeployment = marshalling_gen.unmarshalDeployment;
17
- exports.unmarshalEndpoint = marshalling_gen.unmarshalEndpoint;
18
- exports.unmarshalEula = marshalling_gen.unmarshalEula;
19
- exports.unmarshalListDeploymentACLRulesResponse = marshalling_gen.unmarshalListDeploymentACLRulesResponse;
20
- exports.unmarshalListDeploymentsResponse = marshalling_gen.unmarshalListDeploymentsResponse;
21
- exports.unmarshalListModelsResponse = marshalling_gen.unmarshalListModelsResponse;
22
- exports.unmarshalListNodeTypesResponse = marshalling_gen.unmarshalListNodeTypesResponse;
23
- exports.unmarshalModel = marshalling_gen.unmarshalModel;
24
- exports.unmarshalSetDeploymentACLRulesResponse = marshalling_gen.unmarshalSetDeploymentACLRulesResponse;
25
- exports.ValidationRules = validationRules_gen;