gcore 0.4.0__py3-none-any.whl → 0.6.0__py3-none-any.whl
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.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/_base_client.py +9 -2
- gcore/_client.py +9 -0
- gcore/_constants.py +2 -2
- gcore/_models.py +8 -5
- gcore/_version.py +1 -1
- gcore/pagination.py +192 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/__init__.py +14 -0
- gcore/resources/cloud/audit_logs.py +480 -0
- gcore/resources/cloud/baremetal/servers.py +2 -2
- gcore/resources/cloud/cloud.py +32 -0
- gcore/resources/cloud/file_shares/file_shares.py +64 -9
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +2 -2
- gcore/resources/cloud/inference/__init__.py +14 -0
- gcore/resources/cloud/inference/api_keys.py +621 -0
- gcore/resources/cloud/inference/deployments/deployments.py +66 -33
- gcore/resources/cloud/inference/deployments/logs.py +7 -7
- gcore/resources/cloud/inference/inference.py +37 -5
- gcore/resources/cloud/inference/models.py +16 -15
- gcore/resources/cloud/inference/registry_credentials.py +16 -16
- gcore/resources/cloud/inference/secrets.py +4 -5
- gcore/resources/cloud/instances/instances.py +2 -2
- gcore/resources/cloud/load_balancers/pools/members.py +22 -6
- gcore/resources/cloud/secrets.py +14 -224
- gcore/resources/cloud/tasks.py +30 -28
- gcore/resources/fastedge/__init__.py +103 -0
- gcore/resources/fastedge/apps/__init__.py +33 -0
- gcore/resources/fastedge/apps/apps.py +932 -0
- gcore/resources/fastedge/apps/logs.py +248 -0
- gcore/resources/fastedge/binaries.py +286 -0
- gcore/resources/fastedge/fastedge.py +327 -0
- gcore/resources/fastedge/kv_stores.py +523 -0
- gcore/resources/fastedge/secrets.py +687 -0
- gcore/resources/fastedge/statistics.py +347 -0
- gcore/resources/fastedge/templates.py +652 -0
- gcore/types/cloud/__init__.py +4 -28
- gcore/types/cloud/audit_log_entry.py +254 -0
- gcore/types/cloud/audit_log_list_params.py +158 -0
- gcore/types/cloud/baremetal/server_create_params.py +1 -1
- gcore/types/cloud/file_share_update_params.py +29 -3
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +1 -1
- gcore/types/cloud/inference/__init__.py +17 -8
- gcore/types/cloud/inference/api_key_create_params.py +21 -0
- gcore/types/cloud/inference/api_key_list_params.py +21 -0
- gcore/types/cloud/inference/api_key_update_params.py +16 -0
- gcore/types/cloud/inference/deployment_create_params.py +224 -7
- gcore/types/cloud/inference/deployment_update_params.py +24 -3
- gcore/types/cloud/inference/deployments/__init__.py +1 -0
- gcore/types/cloud/inference/{inference_log.py → deployments/inference_deployment_log.py} +3 -3
- gcore/types/cloud/inference/inference_api_key.py +24 -0
- gcore/types/cloud/inference/inference_api_key_create.py +27 -0
- gcore/types/cloud/inference/inference_deployment.py +266 -0
- gcore/types/cloud/inference/{inference_apikey_secret.py → inference_deployment_api_key.py} +2 -2
- gcore/types/cloud/inference/{mlcatalog_model_card.py → inference_model.py} +2 -2
- gcore/types/cloud/inference/{inference_registry_credential.py → inference_registry_credentials.py} +2 -2
- gcore/types/cloud/inference/{inference_registry_credential_full.py → inference_registry_credentials_create.py} +2 -2
- gcore/types/cloud/inference/inference_secret.py +10 -3
- gcore/types/cloud/inference/model_list_params.py +2 -4
- gcore/types/cloud/{container_probe.py → inference/probe.py} +9 -9
- gcore/types/cloud/{container_probe_config.py → inference/probe_config.py} +5 -5
- gcore/types/cloud/{container_probe_exec.py → inference/probe_exec.py} +3 -3
- gcore/types/cloud/{container_probe_http_get.py → inference/probe_http_get.py} +3 -3
- gcore/types/cloud/{container_probe_tcp_socket.py → inference/probe_tcp_socket.py} +3 -3
- gcore/types/cloud/inference/secret_create_params.py +10 -4
- gcore/types/cloud/inference/secret_replace_params.py +10 -4
- gcore/types/cloud/{region_capacity.py → inference_region_capacity.py} +10 -3
- gcore/types/cloud/{region_capacity_list.py → inference_region_capacity_list.py} +4 -4
- gcore/types/cloud/instance_create_params.py +1 -1
- gcore/types/cloud/load_balancer_create_params.py +14 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +14 -3
- gcore/types/cloud/load_balancers/pool_update_params.py +14 -3
- gcore/types/cloud/load_balancers/pools/member_add_params.py +14 -3
- gcore/types/cloud/member.py +12 -4
- gcore/types/cloud/task_list_params.py +15 -14
- gcore/types/fastedge/__init__.py +48 -0
- gcore/types/fastedge/app.py +81 -0
- gcore/types/fastedge/app_create_params.py +56 -0
- gcore/types/fastedge/app_list_params.py +50 -0
- gcore/types/fastedge/app_param.py +56 -0
- gcore/types/fastedge/app_replace_params.py +17 -0
- gcore/types/fastedge/app_short.py +60 -0
- gcore/types/fastedge/app_update_params.py +56 -0
- gcore/types/fastedge/apps/__init__.py +6 -0
- gcore/types/fastedge/apps/log.py +28 -0
- gcore/types/fastedge/apps/log_list_params.py +37 -0
- gcore/types/fastedge/binary.py +40 -0
- gcore/types/fastedge/binary_list_response.py +12 -0
- gcore/types/fastedge/binary_short.py +32 -0
- gcore/types/fastedge/call_status.py +24 -0
- gcore/types/fastedge/client.py +57 -0
- gcore/types/fastedge/duration_stats.py +30 -0
- gcore/types/fastedge/kv_store.py +33 -0
- gcore/types/fastedge/kv_store_create_params.py +23 -0
- gcore/types/fastedge/kv_store_get_response.py +10 -0
- gcore/types/fastedge/kv_store_list_params.py +12 -0
- gcore/types/fastedge/kv_store_list_response.py +15 -0
- gcore/types/fastedge/kv_store_replace_params.py +23 -0
- gcore/types/fastedge/kv_store_short.py +19 -0
- gcore/types/fastedge/kv_store_stats.py +26 -0
- gcore/types/fastedge/secret.py +29 -0
- gcore/types/fastedge/secret_create_params.py +27 -0
- gcore/types/fastedge/secret_create_response.py +12 -0
- gcore/types/fastedge/secret_delete_params.py +12 -0
- gcore/types/fastedge/secret_list_params.py +15 -0
- gcore/types/{cloud → fastedge}/secret_list_response.py +2 -6
- gcore/types/fastedge/secret_replace_params.py +27 -0
- gcore/types/fastedge/secret_short.py +21 -0
- gcore/types/fastedge/secret_update_params.py +27 -0
- gcore/types/fastedge/statistic_get_call_series_params.py +28 -0
- gcore/types/fastedge/statistic_get_call_series_response.py +12 -0
- gcore/types/fastedge/statistic_get_duration_series_params.py +28 -0
- gcore/types/fastedge/statistic_get_duration_series_response.py +12 -0
- gcore/types/fastedge/template.py +31 -0
- gcore/types/fastedge/template_create_params.py +30 -0
- gcore/types/fastedge/template_delete_params.py +12 -0
- gcore/types/fastedge/template_list_params.py +25 -0
- gcore/types/fastedge/template_parameter.py +22 -0
- gcore/types/fastedge/template_parameter_param.py +21 -0
- gcore/types/fastedge/template_replace_params.py +30 -0
- gcore/types/fastedge/template_short.py +27 -0
- {gcore-0.4.0.dist-info → gcore-0.6.0.dist-info}/METADATA +8 -7
- {gcore-0.4.0.dist-info → gcore-0.6.0.dist-info}/RECORD +124 -80
- gcore/types/cloud/aws_iam_data.py +0 -13
- gcore/types/cloud/aws_iam_data_param.py +0 -15
- gcore/types/cloud/capacity.py +0 -13
- gcore/types/cloud/container_probe_config_create_param.py +0 -17
- gcore/types/cloud/container_probe_create_param.py +0 -38
- gcore/types/cloud/container_probe_exec_create_param.py +0 -13
- gcore/types/cloud/container_probe_http_get_create_param.py +0 -25
- gcore/types/cloud/container_probe_tcp_socket_create_param.py +0 -12
- gcore/types/cloud/container_scale.py +0 -25
- gcore/types/cloud/container_scale_trigger_rate.py +0 -13
- gcore/types/cloud/container_scale_trigger_sqs.py +0 -33
- gcore/types/cloud/container_scale_trigger_threshold.py +0 -10
- gcore/types/cloud/container_scale_triggers.py +0 -36
- gcore/types/cloud/deploy_status.py +0 -13
- gcore/types/cloud/inference/container.py +0 -26
- gcore/types/cloud/inference/inference.py +0 -95
- gcore/types/cloud/inference/mlcatalog_order_by_choices.py +0 -7
- gcore/types/cloud/inference_probes.py +0 -19
- gcore/types/cloud/ingress_opts_out.py +0 -16
- gcore/types/cloud/ingress_opts_param.py +0 -18
- gcore/types/cloud/secret_create_params.py +0 -66
- {gcore-0.4.0.dist-info → gcore-0.6.0.dist-info}/WHEEL +0 -0
- {gcore-0.4.0.dist-info → gcore-0.6.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -28,9 +28,8 @@ from .....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
|
28
28
|
from ....._base_client import AsyncPaginator, make_request_options
|
|
29
29
|
from .....types.cloud.inference import deployment_list_params, deployment_create_params, deployment_update_params
|
|
30
30
|
from .....types.cloud.task_id_list import TaskIDList
|
|
31
|
-
from .....types.cloud.
|
|
32
|
-
from .....types.cloud.inference.
|
|
33
|
-
from .....types.cloud.inference.inference_apikey_secret import InferenceApikeySecret
|
|
31
|
+
from .....types.cloud.inference.inference_deployment import InferenceDeployment
|
|
32
|
+
from .....types.cloud.inference.inference_deployment_api_key import InferenceDeploymentAPIKey
|
|
34
33
|
|
|
35
34
|
__all__ = ["DeploymentsResource", "AsyncDeploymentsResource"]
|
|
36
35
|
|
|
@@ -68,12 +67,13 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
68
67
|
image: str,
|
|
69
68
|
listening_port: int,
|
|
70
69
|
name: str,
|
|
70
|
+
api_keys: List[str] | NotGiven = NOT_GIVEN,
|
|
71
71
|
auth_enabled: bool | NotGiven = NOT_GIVEN,
|
|
72
72
|
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
73
73
|
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
74
74
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
75
75
|
envs: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
76
|
-
ingress_opts: Optional[
|
|
76
|
+
ingress_opts: Optional[deployment_create_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
77
77
|
logging: Optional[deployment_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
78
78
|
probes: Optional[deployment_create_params.Probes] | NotGiven = NOT_GIVEN,
|
|
79
79
|
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -103,9 +103,15 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
103
103
|
|
|
104
104
|
name: Inference instance name.
|
|
105
105
|
|
|
106
|
+
api_keys: List of API keys for the inference instance. Multiple keys can be attached to
|
|
107
|
+
one deployment.If `auth_enabled` and `api_keys` are both specified, a
|
|
108
|
+
ValidationError will be raised.
|
|
109
|
+
|
|
106
110
|
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
107
111
|
`"Authorization": "Bearer ****\\**"` or `"X-Api-Key": "****\\**"` header is required
|
|
108
|
-
for the requests to the instance if enabled
|
|
112
|
+
for the requests to the instance if enabled. This field is deprecated and will
|
|
113
|
+
be removed in the future. Use `api_keys` field instead.If `auth_enabled` and
|
|
114
|
+
`api_keys` are both specified, a ValidationError will be raised.
|
|
109
115
|
|
|
110
116
|
command: Command to be executed when running a container from an image.
|
|
111
117
|
|
|
@@ -148,6 +154,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
148
154
|
"image": image,
|
|
149
155
|
"listening_port": listening_port,
|
|
150
156
|
"name": name,
|
|
157
|
+
"api_keys": api_keys,
|
|
151
158
|
"auth_enabled": auth_enabled,
|
|
152
159
|
"command": command,
|
|
153
160
|
"credentials_name": credentials_name,
|
|
@@ -171,6 +178,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
171
178
|
deployment_name: str,
|
|
172
179
|
*,
|
|
173
180
|
project_id: int | None = None,
|
|
181
|
+
api_keys: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
174
182
|
auth_enabled: bool | NotGiven = NOT_GIVEN,
|
|
175
183
|
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
176
184
|
containers: Optional[Iterable[deployment_update_params.Container]] | NotGiven = NOT_GIVEN,
|
|
@@ -179,7 +187,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
179
187
|
envs: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
180
188
|
flavor_name: str | NotGiven = NOT_GIVEN,
|
|
181
189
|
image: Optional[str] | NotGiven = NOT_GIVEN,
|
|
182
|
-
ingress_opts: Optional[
|
|
190
|
+
ingress_opts: Optional[deployment_update_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
183
191
|
listening_port: Optional[int] | NotGiven = NOT_GIVEN,
|
|
184
192
|
logging: Optional[deployment_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
185
193
|
probes: Optional[deployment_update_params.Probes] | NotGiven = NOT_GIVEN,
|
|
@@ -199,9 +207,16 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
199
207
|
|
|
200
208
|
deployment_name: Inference instance name.
|
|
201
209
|
|
|
210
|
+
api_keys: List of API keys for the inference instance. Multiple keys can be attached to
|
|
211
|
+
one deployment.If `auth_enabled` and `api_keys` are both specified, a
|
|
212
|
+
ValidationError will be raised.If `[]` is provided, the API keys will be removed
|
|
213
|
+
and auth will be disabled on the deployment.
|
|
214
|
+
|
|
202
215
|
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
203
216
|
`"Authorization": "Bearer ****\\**"` or `"X-Api-Key": "****\\**"` header is required
|
|
204
|
-
for the requests to the instance if enabled
|
|
217
|
+
for the requests to the instance if enabled. This field is deprecated and will
|
|
218
|
+
be removed in the future. Use `api_keys` field instead.If `auth_enabled` and
|
|
219
|
+
`api_keys` are both specified, a ValidationError will be raised.
|
|
205
220
|
|
|
206
221
|
command: Command to be executed when running a container from an image.
|
|
207
222
|
|
|
@@ -250,6 +265,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
250
265
|
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
251
266
|
body=maybe_transform(
|
|
252
267
|
{
|
|
268
|
+
"api_keys": api_keys,
|
|
253
269
|
"auth_enabled": auth_enabled,
|
|
254
270
|
"command": command,
|
|
255
271
|
"containers": containers,
|
|
@@ -284,7 +300,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
284
300
|
extra_query: Query | None = None,
|
|
285
301
|
extra_body: Body | None = None,
|
|
286
302
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
287
|
-
) -> SyncOffsetPage[
|
|
303
|
+
) -> SyncOffsetPage[InferenceDeployment]:
|
|
288
304
|
"""List inference deployments
|
|
289
305
|
|
|
290
306
|
Args:
|
|
@@ -309,7 +325,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
309
325
|
project_id = self._client._get_cloud_project_id_path_param()
|
|
310
326
|
return self._get_api_list(
|
|
311
327
|
f"/cloud/v3/inference/{project_id}/deployments",
|
|
312
|
-
page=SyncOffsetPage[
|
|
328
|
+
page=SyncOffsetPage[InferenceDeployment],
|
|
313
329
|
options=make_request_options(
|
|
314
330
|
extra_headers=extra_headers,
|
|
315
331
|
extra_query=extra_query,
|
|
@@ -323,7 +339,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
323
339
|
deployment_list_params.DeploymentListParams,
|
|
324
340
|
),
|
|
325
341
|
),
|
|
326
|
-
model=
|
|
342
|
+
model=InferenceDeployment,
|
|
327
343
|
)
|
|
328
344
|
|
|
329
345
|
def delete(
|
|
@@ -377,7 +393,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
377
393
|
extra_query: Query | None = None,
|
|
378
394
|
extra_body: Body | None = None,
|
|
379
395
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
380
|
-
) ->
|
|
396
|
+
) -> InferenceDeployment:
|
|
381
397
|
"""
|
|
382
398
|
Get inference deployment
|
|
383
399
|
|
|
@@ -403,7 +419,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
403
419
|
options=make_request_options(
|
|
404
420
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
405
421
|
),
|
|
406
|
-
cast_to=
|
|
422
|
+
cast_to=InferenceDeployment,
|
|
407
423
|
)
|
|
408
424
|
|
|
409
425
|
def get_api_key(
|
|
@@ -417,7 +433,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
417
433
|
extra_query: Query | None = None,
|
|
418
434
|
extra_body: Body | None = None,
|
|
419
435
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
420
|
-
) ->
|
|
436
|
+
) -> InferenceDeploymentAPIKey:
|
|
421
437
|
"""
|
|
422
438
|
Get inference deployment API key
|
|
423
439
|
|
|
@@ -443,7 +459,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
443
459
|
options=make_request_options(
|
|
444
460
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
445
461
|
),
|
|
446
|
-
cast_to=
|
|
462
|
+
cast_to=InferenceDeploymentAPIKey,
|
|
447
463
|
)
|
|
448
464
|
|
|
449
465
|
def start(
|
|
@@ -556,7 +572,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
556
572
|
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
557
573
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
558
574
|
envs: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
559
|
-
ingress_opts: Optional[
|
|
575
|
+
ingress_opts: Optional[deployment_create_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
560
576
|
logging: Optional[deployment_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
561
577
|
probes: Optional[deployment_create_params.Probes] | NotGiven = NOT_GIVEN,
|
|
562
578
|
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -567,7 +583,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
567
583
|
extra_headers: Headers | None = None,
|
|
568
584
|
extra_query: Query | None = None,
|
|
569
585
|
extra_body: Body | None = None,
|
|
570
|
-
) ->
|
|
586
|
+
) -> InferenceDeployment:
|
|
571
587
|
response = self.create(
|
|
572
588
|
project_id=project_id,
|
|
573
589
|
containers=containers,
|
|
@@ -622,7 +638,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
622
638
|
envs: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
623
639
|
flavor_name: str | NotGiven = NOT_GIVEN,
|
|
624
640
|
image: Optional[str] | NotGiven = NOT_GIVEN,
|
|
625
|
-
ingress_opts: Optional[
|
|
641
|
+
ingress_opts: Optional[deployment_update_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
626
642
|
listening_port: Optional[int] | NotGiven = NOT_GIVEN,
|
|
627
643
|
logging: Optional[deployment_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
628
644
|
probes: Optional[deployment_update_params.Probes] | NotGiven = NOT_GIVEN,
|
|
@@ -634,7 +650,7 @@ class DeploymentsResource(SyncAPIResource):
|
|
|
634
650
|
extra_headers: Headers | None = None,
|
|
635
651
|
extra_query: Query | None = None,
|
|
636
652
|
extra_body: Body | None = None,
|
|
637
|
-
) ->
|
|
653
|
+
) -> InferenceDeployment:
|
|
638
654
|
"""
|
|
639
655
|
Update inference deployment and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
640
656
|
"""
|
|
@@ -739,12 +755,13 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
739
755
|
image: str,
|
|
740
756
|
listening_port: int,
|
|
741
757
|
name: str,
|
|
758
|
+
api_keys: List[str] | NotGiven = NOT_GIVEN,
|
|
742
759
|
auth_enabled: bool | NotGiven = NOT_GIVEN,
|
|
743
760
|
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
744
761
|
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
745
762
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
746
763
|
envs: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
747
|
-
ingress_opts: Optional[
|
|
764
|
+
ingress_opts: Optional[deployment_create_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
748
765
|
logging: Optional[deployment_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
749
766
|
probes: Optional[deployment_create_params.Probes] | NotGiven = NOT_GIVEN,
|
|
750
767
|
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -774,9 +791,15 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
774
791
|
|
|
775
792
|
name: Inference instance name.
|
|
776
793
|
|
|
794
|
+
api_keys: List of API keys for the inference instance. Multiple keys can be attached to
|
|
795
|
+
one deployment.If `auth_enabled` and `api_keys` are both specified, a
|
|
796
|
+
ValidationError will be raised.
|
|
797
|
+
|
|
777
798
|
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
778
799
|
`"Authorization": "Bearer ****\\**"` or `"X-Api-Key": "****\\**"` header is required
|
|
779
|
-
for the requests to the instance if enabled
|
|
800
|
+
for the requests to the instance if enabled. This field is deprecated and will
|
|
801
|
+
be removed in the future. Use `api_keys` field instead.If `auth_enabled` and
|
|
802
|
+
`api_keys` are both specified, a ValidationError will be raised.
|
|
780
803
|
|
|
781
804
|
command: Command to be executed when running a container from an image.
|
|
782
805
|
|
|
@@ -819,6 +842,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
819
842
|
"image": image,
|
|
820
843
|
"listening_port": listening_port,
|
|
821
844
|
"name": name,
|
|
845
|
+
"api_keys": api_keys,
|
|
822
846
|
"auth_enabled": auth_enabled,
|
|
823
847
|
"command": command,
|
|
824
848
|
"credentials_name": credentials_name,
|
|
@@ -842,6 +866,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
842
866
|
deployment_name: str,
|
|
843
867
|
*,
|
|
844
868
|
project_id: int | None = None,
|
|
869
|
+
api_keys: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
845
870
|
auth_enabled: bool | NotGiven = NOT_GIVEN,
|
|
846
871
|
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
847
872
|
containers: Optional[Iterable[deployment_update_params.Container]] | NotGiven = NOT_GIVEN,
|
|
@@ -850,7 +875,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
850
875
|
envs: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
851
876
|
flavor_name: str | NotGiven = NOT_GIVEN,
|
|
852
877
|
image: Optional[str] | NotGiven = NOT_GIVEN,
|
|
853
|
-
ingress_opts: Optional[
|
|
878
|
+
ingress_opts: Optional[deployment_update_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
854
879
|
listening_port: Optional[int] | NotGiven = NOT_GIVEN,
|
|
855
880
|
logging: Optional[deployment_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
856
881
|
probes: Optional[deployment_update_params.Probes] | NotGiven = NOT_GIVEN,
|
|
@@ -870,9 +895,16 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
870
895
|
|
|
871
896
|
deployment_name: Inference instance name.
|
|
872
897
|
|
|
898
|
+
api_keys: List of API keys for the inference instance. Multiple keys can be attached to
|
|
899
|
+
one deployment.If `auth_enabled` and `api_keys` are both specified, a
|
|
900
|
+
ValidationError will be raised.If `[]` is provided, the API keys will be removed
|
|
901
|
+
and auth will be disabled on the deployment.
|
|
902
|
+
|
|
873
903
|
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
874
904
|
`"Authorization": "Bearer ****\\**"` or `"X-Api-Key": "****\\**"` header is required
|
|
875
|
-
for the requests to the instance if enabled
|
|
905
|
+
for the requests to the instance if enabled. This field is deprecated and will
|
|
906
|
+
be removed in the future. Use `api_keys` field instead.If `auth_enabled` and
|
|
907
|
+
`api_keys` are both specified, a ValidationError will be raised.
|
|
876
908
|
|
|
877
909
|
command: Command to be executed when running a container from an image.
|
|
878
910
|
|
|
@@ -921,6 +953,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
921
953
|
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
922
954
|
body=await async_maybe_transform(
|
|
923
955
|
{
|
|
956
|
+
"api_keys": api_keys,
|
|
924
957
|
"auth_enabled": auth_enabled,
|
|
925
958
|
"command": command,
|
|
926
959
|
"containers": containers,
|
|
@@ -955,7 +988,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
955
988
|
extra_query: Query | None = None,
|
|
956
989
|
extra_body: Body | None = None,
|
|
957
990
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
958
|
-
) -> AsyncPaginator[
|
|
991
|
+
) -> AsyncPaginator[InferenceDeployment, AsyncOffsetPage[InferenceDeployment]]:
|
|
959
992
|
"""List inference deployments
|
|
960
993
|
|
|
961
994
|
Args:
|
|
@@ -980,7 +1013,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
980
1013
|
project_id = self._client._get_cloud_project_id_path_param()
|
|
981
1014
|
return self._get_api_list(
|
|
982
1015
|
f"/cloud/v3/inference/{project_id}/deployments",
|
|
983
|
-
page=AsyncOffsetPage[
|
|
1016
|
+
page=AsyncOffsetPage[InferenceDeployment],
|
|
984
1017
|
options=make_request_options(
|
|
985
1018
|
extra_headers=extra_headers,
|
|
986
1019
|
extra_query=extra_query,
|
|
@@ -994,7 +1027,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
994
1027
|
deployment_list_params.DeploymentListParams,
|
|
995
1028
|
),
|
|
996
1029
|
),
|
|
997
|
-
model=
|
|
1030
|
+
model=InferenceDeployment,
|
|
998
1031
|
)
|
|
999
1032
|
|
|
1000
1033
|
async def delete(
|
|
@@ -1048,7 +1081,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1048
1081
|
extra_query: Query | None = None,
|
|
1049
1082
|
extra_body: Body | None = None,
|
|
1050
1083
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1051
|
-
) ->
|
|
1084
|
+
) -> InferenceDeployment:
|
|
1052
1085
|
"""
|
|
1053
1086
|
Get inference deployment
|
|
1054
1087
|
|
|
@@ -1074,7 +1107,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1074
1107
|
options=make_request_options(
|
|
1075
1108
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1076
1109
|
),
|
|
1077
|
-
cast_to=
|
|
1110
|
+
cast_to=InferenceDeployment,
|
|
1078
1111
|
)
|
|
1079
1112
|
|
|
1080
1113
|
async def get_api_key(
|
|
@@ -1088,7 +1121,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1088
1121
|
extra_query: Query | None = None,
|
|
1089
1122
|
extra_body: Body | None = None,
|
|
1090
1123
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1091
|
-
) ->
|
|
1124
|
+
) -> InferenceDeploymentAPIKey:
|
|
1092
1125
|
"""
|
|
1093
1126
|
Get inference deployment API key
|
|
1094
1127
|
|
|
@@ -1114,7 +1147,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1114
1147
|
options=make_request_options(
|
|
1115
1148
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1116
1149
|
),
|
|
1117
|
-
cast_to=
|
|
1150
|
+
cast_to=InferenceDeploymentAPIKey,
|
|
1118
1151
|
)
|
|
1119
1152
|
|
|
1120
1153
|
async def start(
|
|
@@ -1227,7 +1260,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1227
1260
|
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1228
1261
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1229
1262
|
envs: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
1230
|
-
ingress_opts: Optional[
|
|
1263
|
+
ingress_opts: Optional[deployment_create_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
1231
1264
|
logging: Optional[deployment_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
1232
1265
|
probes: Optional[deployment_create_params.Probes] | NotGiven = NOT_GIVEN,
|
|
1233
1266
|
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -1238,7 +1271,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1238
1271
|
extra_headers: Headers | None = None,
|
|
1239
1272
|
extra_query: Query | None = None,
|
|
1240
1273
|
extra_body: Body | None = None,
|
|
1241
|
-
) ->
|
|
1274
|
+
) -> InferenceDeployment:
|
|
1242
1275
|
response = await self.create(
|
|
1243
1276
|
project_id=project_id,
|
|
1244
1277
|
containers=containers,
|
|
@@ -1293,7 +1326,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1293
1326
|
envs: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
1294
1327
|
flavor_name: str | NotGiven = NOT_GIVEN,
|
|
1295
1328
|
image: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1296
|
-
ingress_opts: Optional[
|
|
1329
|
+
ingress_opts: Optional[deployment_update_params.IngressOpts] | NotGiven = NOT_GIVEN,
|
|
1297
1330
|
listening_port: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1298
1331
|
logging: Optional[deployment_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
1299
1332
|
probes: Optional[deployment_update_params.Probes] | NotGiven = NOT_GIVEN,
|
|
@@ -1305,7 +1338,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
|
|
|
1305
1338
|
extra_headers: Headers | None = None,
|
|
1306
1339
|
extra_query: Query | None = None,
|
|
1307
1340
|
extra_body: Body | None = None,
|
|
1308
|
-
) ->
|
|
1341
|
+
) -> InferenceDeployment:
|
|
1309
1342
|
"""
|
|
1310
1343
|
Update inference deployment and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1311
1344
|
"""
|
|
@@ -20,7 +20,7 @@ from ....._response import (
|
|
|
20
20
|
from .....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
21
21
|
from ....._base_client import AsyncPaginator, make_request_options
|
|
22
22
|
from .....types.cloud.inference.deployments import log_list_params
|
|
23
|
-
from .....types.cloud.inference.
|
|
23
|
+
from .....types.cloud.inference.deployments.inference_deployment_log import InferenceDeploymentLog
|
|
24
24
|
|
|
25
25
|
__all__ = ["LogsResource", "AsyncLogsResource"]
|
|
26
26
|
|
|
@@ -60,7 +60,7 @@ class LogsResource(SyncAPIResource):
|
|
|
60
60
|
extra_query: Query | None = None,
|
|
61
61
|
extra_body: Body | None = None,
|
|
62
62
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
63
|
-
) -> SyncOffsetPage[
|
|
63
|
+
) -> SyncOffsetPage[InferenceDeploymentLog]:
|
|
64
64
|
"""
|
|
65
65
|
Get inference deployment logs
|
|
66
66
|
|
|
@@ -92,7 +92,7 @@ class LogsResource(SyncAPIResource):
|
|
|
92
92
|
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
93
93
|
return self._get_api_list(
|
|
94
94
|
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/logs",
|
|
95
|
-
page=SyncOffsetPage[
|
|
95
|
+
page=SyncOffsetPage[InferenceDeploymentLog],
|
|
96
96
|
options=make_request_options(
|
|
97
97
|
extra_headers=extra_headers,
|
|
98
98
|
extra_query=extra_query,
|
|
@@ -108,7 +108,7 @@ class LogsResource(SyncAPIResource):
|
|
|
108
108
|
log_list_params.LogListParams,
|
|
109
109
|
),
|
|
110
110
|
),
|
|
111
|
-
model=
|
|
111
|
+
model=InferenceDeploymentLog,
|
|
112
112
|
)
|
|
113
113
|
|
|
114
114
|
|
|
@@ -147,7 +147,7 @@ class AsyncLogsResource(AsyncAPIResource):
|
|
|
147
147
|
extra_query: Query | None = None,
|
|
148
148
|
extra_body: Body | None = None,
|
|
149
149
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
150
|
-
) -> AsyncPaginator[
|
|
150
|
+
) -> AsyncPaginator[InferenceDeploymentLog, AsyncOffsetPage[InferenceDeploymentLog]]:
|
|
151
151
|
"""
|
|
152
152
|
Get inference deployment logs
|
|
153
153
|
|
|
@@ -179,7 +179,7 @@ class AsyncLogsResource(AsyncAPIResource):
|
|
|
179
179
|
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
180
180
|
return self._get_api_list(
|
|
181
181
|
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/logs",
|
|
182
|
-
page=AsyncOffsetPage[
|
|
182
|
+
page=AsyncOffsetPage[InferenceDeploymentLog],
|
|
183
183
|
options=make_request_options(
|
|
184
184
|
extra_headers=extra_headers,
|
|
185
185
|
extra_query=extra_query,
|
|
@@ -195,7 +195,7 @@ class AsyncLogsResource(AsyncAPIResource):
|
|
|
195
195
|
log_list_params.LogListParams,
|
|
196
196
|
),
|
|
197
197
|
),
|
|
198
|
-
model=
|
|
198
|
+
model=InferenceDeploymentLog,
|
|
199
199
|
)
|
|
200
200
|
|
|
201
201
|
|
|
@@ -28,6 +28,14 @@ from .secrets import (
|
|
|
28
28
|
SecretsResourceWithStreamingResponse,
|
|
29
29
|
AsyncSecretsResourceWithStreamingResponse,
|
|
30
30
|
)
|
|
31
|
+
from .api_keys import (
|
|
32
|
+
APIKeysResource,
|
|
33
|
+
AsyncAPIKeysResource,
|
|
34
|
+
APIKeysResourceWithRawResponse,
|
|
35
|
+
AsyncAPIKeysResourceWithRawResponse,
|
|
36
|
+
APIKeysResourceWithStreamingResponse,
|
|
37
|
+
AsyncAPIKeysResourceWithStreamingResponse,
|
|
38
|
+
)
|
|
31
39
|
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
32
40
|
from ...._compat import cached_property
|
|
33
41
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -54,7 +62,7 @@ from .deployments.deployments import (
|
|
|
54
62
|
DeploymentsResourceWithStreamingResponse,
|
|
55
63
|
AsyncDeploymentsResourceWithStreamingResponse,
|
|
56
64
|
)
|
|
57
|
-
from ....types.cloud.
|
|
65
|
+
from ....types.cloud.inference_region_capacity_list import InferenceRegionCapacityList
|
|
58
66
|
|
|
59
67
|
__all__ = ["InferenceResource", "AsyncInferenceResource"]
|
|
60
68
|
|
|
@@ -80,6 +88,10 @@ class InferenceResource(SyncAPIResource):
|
|
|
80
88
|
def secrets(self) -> SecretsResource:
|
|
81
89
|
return SecretsResource(self._client)
|
|
82
90
|
|
|
91
|
+
@cached_property
|
|
92
|
+
def api_keys(self) -> APIKeysResource:
|
|
93
|
+
return APIKeysResource(self._client)
|
|
94
|
+
|
|
83
95
|
@cached_property
|
|
84
96
|
def with_raw_response(self) -> InferenceResourceWithRawResponse:
|
|
85
97
|
"""
|
|
@@ -108,14 +120,14 @@ class InferenceResource(SyncAPIResource):
|
|
|
108
120
|
extra_query: Query | None = None,
|
|
109
121
|
extra_body: Body | None = None,
|
|
110
122
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
111
|
-
) ->
|
|
123
|
+
) -> InferenceRegionCapacityList:
|
|
112
124
|
"""Get inference capacity by region"""
|
|
113
125
|
return self._get(
|
|
114
126
|
"/cloud/v3/inference/capacity",
|
|
115
127
|
options=make_request_options(
|
|
116
128
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
117
129
|
),
|
|
118
|
-
cast_to=
|
|
130
|
+
cast_to=InferenceRegionCapacityList,
|
|
119
131
|
)
|
|
120
132
|
|
|
121
133
|
|
|
@@ -140,6 +152,10 @@ class AsyncInferenceResource(AsyncAPIResource):
|
|
|
140
152
|
def secrets(self) -> AsyncSecretsResource:
|
|
141
153
|
return AsyncSecretsResource(self._client)
|
|
142
154
|
|
|
155
|
+
@cached_property
|
|
156
|
+
def api_keys(self) -> AsyncAPIKeysResource:
|
|
157
|
+
return AsyncAPIKeysResource(self._client)
|
|
158
|
+
|
|
143
159
|
@cached_property
|
|
144
160
|
def with_raw_response(self) -> AsyncInferenceResourceWithRawResponse:
|
|
145
161
|
"""
|
|
@@ -168,14 +184,14 @@ class AsyncInferenceResource(AsyncAPIResource):
|
|
|
168
184
|
extra_query: Query | None = None,
|
|
169
185
|
extra_body: Body | None = None,
|
|
170
186
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
171
|
-
) ->
|
|
187
|
+
) -> InferenceRegionCapacityList:
|
|
172
188
|
"""Get inference capacity by region"""
|
|
173
189
|
return await self._get(
|
|
174
190
|
"/cloud/v3/inference/capacity",
|
|
175
191
|
options=make_request_options(
|
|
176
192
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
177
193
|
),
|
|
178
|
-
cast_to=
|
|
194
|
+
cast_to=InferenceRegionCapacityList,
|
|
179
195
|
)
|
|
180
196
|
|
|
181
197
|
|
|
@@ -207,6 +223,10 @@ class InferenceResourceWithRawResponse:
|
|
|
207
223
|
def secrets(self) -> SecretsResourceWithRawResponse:
|
|
208
224
|
return SecretsResourceWithRawResponse(self._inference.secrets)
|
|
209
225
|
|
|
226
|
+
@cached_property
|
|
227
|
+
def api_keys(self) -> APIKeysResourceWithRawResponse:
|
|
228
|
+
return APIKeysResourceWithRawResponse(self._inference.api_keys)
|
|
229
|
+
|
|
210
230
|
|
|
211
231
|
class AsyncInferenceResourceWithRawResponse:
|
|
212
232
|
def __init__(self, inference: AsyncInferenceResource) -> None:
|
|
@@ -236,6 +256,10 @@ class AsyncInferenceResourceWithRawResponse:
|
|
|
236
256
|
def secrets(self) -> AsyncSecretsResourceWithRawResponse:
|
|
237
257
|
return AsyncSecretsResourceWithRawResponse(self._inference.secrets)
|
|
238
258
|
|
|
259
|
+
@cached_property
|
|
260
|
+
def api_keys(self) -> AsyncAPIKeysResourceWithRawResponse:
|
|
261
|
+
return AsyncAPIKeysResourceWithRawResponse(self._inference.api_keys)
|
|
262
|
+
|
|
239
263
|
|
|
240
264
|
class InferenceResourceWithStreamingResponse:
|
|
241
265
|
def __init__(self, inference: InferenceResource) -> None:
|
|
@@ -265,6 +289,10 @@ class InferenceResourceWithStreamingResponse:
|
|
|
265
289
|
def secrets(self) -> SecretsResourceWithStreamingResponse:
|
|
266
290
|
return SecretsResourceWithStreamingResponse(self._inference.secrets)
|
|
267
291
|
|
|
292
|
+
@cached_property
|
|
293
|
+
def api_keys(self) -> APIKeysResourceWithStreamingResponse:
|
|
294
|
+
return APIKeysResourceWithStreamingResponse(self._inference.api_keys)
|
|
295
|
+
|
|
268
296
|
|
|
269
297
|
class AsyncInferenceResourceWithStreamingResponse:
|
|
270
298
|
def __init__(self, inference: AsyncInferenceResource) -> None:
|
|
@@ -293,3 +321,7 @@ class AsyncInferenceResourceWithStreamingResponse:
|
|
|
293
321
|
@cached_property
|
|
294
322
|
def secrets(self) -> AsyncSecretsResourceWithStreamingResponse:
|
|
295
323
|
return AsyncSecretsResourceWithStreamingResponse(self._inference.secrets)
|
|
324
|
+
|
|
325
|
+
@cached_property
|
|
326
|
+
def api_keys(self) -> AsyncAPIKeysResourceWithStreamingResponse:
|
|
327
|
+
return AsyncAPIKeysResourceWithStreamingResponse(self._inference.api_keys)
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
5
7
|
import httpx
|
|
6
8
|
|
|
7
9
|
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
@@ -16,9 +18,8 @@ from ...._response import (
|
|
|
16
18
|
)
|
|
17
19
|
from ....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
18
20
|
from ...._base_client import AsyncPaginator, make_request_options
|
|
19
|
-
from ....types.cloud.inference import
|
|
20
|
-
from ....types.cloud.inference.
|
|
21
|
-
from ....types.cloud.inference.mlcatalog_order_by_choices import MlcatalogOrderByChoices
|
|
21
|
+
from ....types.cloud.inference import model_list_params
|
|
22
|
+
from ....types.cloud.inference.inference_model import InferenceModel
|
|
22
23
|
|
|
23
24
|
__all__ = ["ModelsResource", "AsyncModelsResource"]
|
|
24
25
|
|
|
@@ -48,14 +49,14 @@ class ModelsResource(SyncAPIResource):
|
|
|
48
49
|
*,
|
|
49
50
|
limit: int | NotGiven = NOT_GIVEN,
|
|
50
51
|
offset: int | NotGiven = NOT_GIVEN,
|
|
51
|
-
order_by:
|
|
52
|
+
order_by: Literal["name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
|
|
52
53
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
53
54
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
54
55
|
extra_headers: Headers | None = None,
|
|
55
56
|
extra_query: Query | None = None,
|
|
56
57
|
extra_body: Body | None = None,
|
|
57
58
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
58
|
-
) -> SyncOffsetPage[
|
|
59
|
+
) -> SyncOffsetPage[InferenceModel]:
|
|
59
60
|
"""List models from catalog
|
|
60
61
|
|
|
61
62
|
Args:
|
|
@@ -78,7 +79,7 @@ class ModelsResource(SyncAPIResource):
|
|
|
78
79
|
"""
|
|
79
80
|
return self._get_api_list(
|
|
80
81
|
"/cloud/v3/inference/models",
|
|
81
|
-
page=SyncOffsetPage[
|
|
82
|
+
page=SyncOffsetPage[InferenceModel],
|
|
82
83
|
options=make_request_options(
|
|
83
84
|
extra_headers=extra_headers,
|
|
84
85
|
extra_query=extra_query,
|
|
@@ -93,7 +94,7 @@ class ModelsResource(SyncAPIResource):
|
|
|
93
94
|
model_list_params.ModelListParams,
|
|
94
95
|
),
|
|
95
96
|
),
|
|
96
|
-
model=
|
|
97
|
+
model=InferenceModel,
|
|
97
98
|
)
|
|
98
99
|
|
|
99
100
|
def get(
|
|
@@ -106,7 +107,7 @@ class ModelsResource(SyncAPIResource):
|
|
|
106
107
|
extra_query: Query | None = None,
|
|
107
108
|
extra_body: Body | None = None,
|
|
108
109
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
109
|
-
) ->
|
|
110
|
+
) -> InferenceModel:
|
|
110
111
|
"""
|
|
111
112
|
Get model from catalog
|
|
112
113
|
|
|
@@ -128,7 +129,7 @@ class ModelsResource(SyncAPIResource):
|
|
|
128
129
|
options=make_request_options(
|
|
129
130
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
130
131
|
),
|
|
131
|
-
cast_to=
|
|
132
|
+
cast_to=InferenceModel,
|
|
132
133
|
)
|
|
133
134
|
|
|
134
135
|
|
|
@@ -157,14 +158,14 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
|
157
158
|
*,
|
|
158
159
|
limit: int | NotGiven = NOT_GIVEN,
|
|
159
160
|
offset: int | NotGiven = NOT_GIVEN,
|
|
160
|
-
order_by:
|
|
161
|
+
order_by: Literal["name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
|
|
161
162
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
162
163
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
163
164
|
extra_headers: Headers | None = None,
|
|
164
165
|
extra_query: Query | None = None,
|
|
165
166
|
extra_body: Body | None = None,
|
|
166
167
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
167
|
-
) -> AsyncPaginator[
|
|
168
|
+
) -> AsyncPaginator[InferenceModel, AsyncOffsetPage[InferenceModel]]:
|
|
168
169
|
"""List models from catalog
|
|
169
170
|
|
|
170
171
|
Args:
|
|
@@ -187,7 +188,7 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
|
187
188
|
"""
|
|
188
189
|
return self._get_api_list(
|
|
189
190
|
"/cloud/v3/inference/models",
|
|
190
|
-
page=AsyncOffsetPage[
|
|
191
|
+
page=AsyncOffsetPage[InferenceModel],
|
|
191
192
|
options=make_request_options(
|
|
192
193
|
extra_headers=extra_headers,
|
|
193
194
|
extra_query=extra_query,
|
|
@@ -202,7 +203,7 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
|
202
203
|
model_list_params.ModelListParams,
|
|
203
204
|
),
|
|
204
205
|
),
|
|
205
|
-
model=
|
|
206
|
+
model=InferenceModel,
|
|
206
207
|
)
|
|
207
208
|
|
|
208
209
|
async def get(
|
|
@@ -215,7 +216,7 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
|
215
216
|
extra_query: Query | None = None,
|
|
216
217
|
extra_body: Body | None = None,
|
|
217
218
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
218
|
-
) ->
|
|
219
|
+
) -> InferenceModel:
|
|
219
220
|
"""
|
|
220
221
|
Get model from catalog
|
|
221
222
|
|
|
@@ -237,7 +238,7 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
|
237
238
|
options=make_request_options(
|
|
238
239
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
239
240
|
),
|
|
240
|
-
cast_to=
|
|
241
|
+
cast_to=InferenceModel,
|
|
241
242
|
)
|
|
242
243
|
|
|
243
244
|
|