blaxel 0.2.33__py3-none-any.whl → 0.2.35__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.
- blaxel/__init__.py +2 -2
- blaxel/core/__init__.py +2 -1
- blaxel/core/client/api/agents/create_agent.py +64 -19
- blaxel/core/client/api/agents/delete_agent.py +44 -15
- blaxel/core/client/api/agents/get_agent.py +43 -14
- blaxel/core/client/api/agents/list_agents.py +40 -11
- blaxel/core/client/api/agents/update_agent.py +60 -19
- blaxel/core/client/api/compute/create_sandbox.py +60 -23
- blaxel/core/client/api/compute/delete_sandbox.py +40 -19
- blaxel/core/client/api/compute/get_sandbox.py +39 -18
- blaxel/core/client/api/compute/list_sandboxes.py +40 -19
- blaxel/core/client/api/compute/update_sandbox.py +56 -23
- blaxel/core/client/api/configurations/get_configuration.py +16 -4
- blaxel/core/client/api/customdomains/create_custom_domain.py +12 -0
- blaxel/core/client/api/customdomains/list_custom_domains.py +16 -4
- blaxel/core/client/api/default/get_template.py +8 -4
- blaxel/core/client/api/functions/create_function.py +62 -19
- blaxel/core/client/api/functions/delete_function.py +46 -15
- blaxel/core/client/api/functions/get_function.py +45 -14
- blaxel/core/client/api/functions/list_functions.py +44 -15
- blaxel/core/client/api/functions/update_function.py +62 -19
- blaxel/core/client/api/images/cleanup_images.py +12 -12
- blaxel/core/client/api/images/delete_image.py +12 -8
- blaxel/core/client/api/images/delete_image_tag.py +12 -8
- blaxel/core/client/api/images/get_image.py +12 -8
- blaxel/core/client/api/images/list_images.py +12 -8
- blaxel/core/client/api/integrations/create_integration_connection.py +56 -23
- blaxel/core/client/api/integrations/delete_integration_connection.py +48 -19
- blaxel/core/client/api/integrations/get_integration.py +12 -8
- blaxel/core/client/api/integrations/get_integration_connection.py +44 -19
- blaxel/core/client/api/integrations/get_integration_connection_model.py +2 -2
- blaxel/core/client/api/integrations/list_integration_connections.py +36 -19
- blaxel/core/client/api/integrations/update_integration_connection.py +52 -19
- blaxel/core/client/api/jobs/create_job.py +20 -12
- blaxel/core/client/api/jobs/create_job_execution.py +22 -16
- blaxel/core/client/api/jobs/delete_job.py +12 -8
- blaxel/core/client/api/jobs/delete_job_execution.py +12 -8
- blaxel/core/client/api/jobs/get_job.py +24 -20
- blaxel/core/client/api/jobs/get_job_execution.py +8 -4
- blaxel/core/client/api/jobs/list_job_executions.py +8 -4
- blaxel/core/client/api/jobs/list_jobs.py +12 -8
- blaxel/core/client/api/jobs/update_job.py +20 -12
- blaxel/core/client/api/locations/list_locations.py +12 -8
- blaxel/core/client/api/{default → mcphub}/list_mcp_hub_definitions.py +20 -4
- blaxel/core/client/api/models/create_model.py +52 -23
- blaxel/core/client/api/models/delete_model.py +40 -19
- blaxel/core/client/api/models/get_model.py +40 -19
- blaxel/core/client/api/models/list_models.py +40 -19
- blaxel/core/client/api/models/update_model.py +52 -23
- blaxel/core/client/api/policies/create_policy.py +12 -8
- blaxel/core/client/api/policies/delete_policy.py +12 -8
- blaxel/core/client/api/policies/get_policy.py +12 -8
- blaxel/core/client/api/policies/list_policies.py +12 -8
- blaxel/core/client/api/policies/update_policy.py +12 -8
- blaxel/core/client/api/public_ipslist/list_public_ips.py +37 -5
- blaxel/core/client/api/sandboxhub/__init__.py +0 -0
- blaxel/core/client/api/{default → sandboxhub}/list_sandbox_hub_definitions.py +20 -4
- blaxel/core/client/api/service_accounts/create_api_key_for_service_account.py +12 -8
- blaxel/core/client/api/service_accounts/create_workspace_service_account.py +12 -8
- blaxel/core/client/api/service_accounts/delete_api_key_for_service_account.py +6 -4
- blaxel/core/client/api/service_accounts/delete_workspace_service_account.py +12 -8
- blaxel/core/client/api/service_accounts/get_workspace_service_accounts.py +12 -8
- blaxel/core/client/api/service_accounts/list_api_keys_for_service_account.py +12 -8
- blaxel/core/client/api/service_accounts/update_workspace_service_account.py +8 -8
- blaxel/core/client/api/templates/list_templates.py +12 -8
- blaxel/core/client/api/volume_templates/create_volume_template.py +8 -4
- blaxel/core/client/api/volume_templates/list_volume_templates.py +8 -4
- blaxel/core/client/api/volumes/create_volume.py +56 -23
- blaxel/core/client/api/volumes/delete_volume.py +44 -19
- blaxel/core/client/api/volumes/get_volume.py +40 -19
- blaxel/core/client/api/volumes/list_volumes.py +40 -19
- blaxel/core/client/api/workspaces/create_workspace.py +54 -23
- blaxel/core/client/api/workspaces/delete_workspace.py +42 -19
- blaxel/core/client/api/workspaces/get_workspace.py +42 -19
- blaxel/core/client/api/workspaces/invite_workspace_user.py +8 -4
- blaxel/core/client/api/workspaces/list_workspace_users.py +12 -8
- blaxel/core/client/api/workspaces/list_workspaces.py +36 -19
- blaxel/core/client/api/workspaces/update_workspace.py +50 -19
- blaxel/core/client/models/__init__.py +76 -146
- blaxel/core/client/models/agent.py +43 -47
- blaxel/core/client/models/agent_runtime.py +139 -0
- blaxel/core/client/models/agent_runtime_generation.py +18 -0
- blaxel/core/client/models/agent_spec.py +33 -110
- blaxel/core/client/models/api_key.py +5 -4
- blaxel/core/client/models/core_event.py +5 -5
- blaxel/core/client/models/create_api_key_for_service_account_body.py +2 -1
- blaxel/core/client/models/create_job_execution_request.py +1 -1
- blaxel/core/client/models/create_job_execution_response.py +13 -9
- blaxel/core/client/models/custom_domain.py +19 -36
- blaxel/core/client/models/custom_domain_metadata.py +4 -3
- blaxel/core/client/models/custom_domain_spec.py +14 -5
- blaxel/core/client/models/custom_domain_spec_status.py +19 -0
- blaxel/core/client/models/entrypoint.py +39 -13
- blaxel/core/client/models/{workspace_labels.py → entrypoint_args_item.py} +6 -6
- blaxel/core/client/models/entrypoint_env.py +3 -3
- blaxel/core/client/models/{job_metrics_executions_total.py → entrypoint_super_gateway_args_item.py} +6 -6
- blaxel/core/client/models/{spec_configuration.py → env.py} +17 -8
- blaxel/core/{sandbox/client/models/welcome_response.py → client/models/error.py} +26 -23
- blaxel/core/client/models/expiration_policy.py +30 -11
- blaxel/core/client/models/expiration_policy_action.py +17 -0
- blaxel/core/client/models/expiration_policy_type.py +19 -0
- blaxel/core/client/models/flavor.py +13 -5
- blaxel/core/client/models/flavor_type.py +18 -0
- blaxel/core/client/models/form.py +6 -6
- blaxel/core/client/models/function.py +43 -47
- blaxel/core/client/models/function_runtime.py +138 -0
- blaxel/core/client/models/function_runtime_generation.py +18 -0
- blaxel/core/client/models/function_spec.py +27 -73
- blaxel/core/client/models/function_spec_transport.py +18 -0
- blaxel/core/client/models/image.py +19 -36
- blaxel/core/client/models/integration_connection.py +25 -39
- blaxel/core/client/models/integration_connection_spec.py +8 -5
- blaxel/core/client/models/integration_connection_spec_config.py +1 -1
- blaxel/core/client/models/integration_connection_spec_secret.py +1 -1
- blaxel/core/client/models/integration_endpoint.py +41 -11
- blaxel/core/client/models/integration_endpoint_ignore_models_item.py +45 -0
- blaxel/core/client/models/{mcp_definition_entrypoint.py → integration_endpoint_models_item.py} +6 -6
- blaxel/core/client/models/job.py +43 -47
- blaxel/core/client/models/job_execution.py +30 -37
- blaxel/core/client/models/job_execution_metadata.py +3 -3
- blaxel/core/client/models/job_execution_spec.py +2 -2
- blaxel/core/client/models/job_execution_stats.py +5 -5
- blaxel/core/client/models/job_execution_status.py +24 -0
- blaxel/core/client/models/job_execution_task.py +12 -4
- blaxel/core/client/models/job_execution_task_metadata.py +1 -1
- blaxel/core/client/models/job_execution_task_spec.py +2 -2
- blaxel/core/client/models/job_execution_task_status.py +23 -0
- blaxel/core/client/models/job_runtime.py +172 -0
- blaxel/core/client/models/job_runtime_generation.py +18 -0
- blaxel/core/client/models/job_spec.py +20 -88
- blaxel/core/client/models/location_response.py +5 -5
- blaxel/core/client/models/mcp_definition.py +30 -17
- blaxel/core/client/models/{job_metrics_tasks_total.py → mcp_definition_categories_item.py} +6 -6
- blaxel/core/client/models/metadata.py +23 -17
- blaxel/core/client/models/metadata_labels.py +4 -1
- blaxel/core/client/models/model.py +43 -47
- blaxel/core/client/models/model_runtime.py +99 -0
- blaxel/core/client/models/model_runtime_type.py +34 -0
- blaxel/core/client/models/model_spec.py +12 -58
- blaxel/core/client/models/o_auth.py +23 -6
- blaxel/core/client/models/{form_oauth.py → o_auth_scope_item.py} +6 -6
- blaxel/core/client/models/pending_invitation_accept.py +2 -1
- blaxel/core/client/models/pending_invitation_workspace_details.py +27 -6
- blaxel/core/client/models/{metrics_request_total_per_code.py → pending_invitation_workspace_details_emails_item.py} +6 -6
- blaxel/core/client/models/policy.py +20 -36
- blaxel/core/client/models/policy_location.py +13 -5
- blaxel/core/client/models/policy_location_type.py +19 -0
- blaxel/core/client/models/policy_max_tokens.py +6 -6
- blaxel/core/client/models/policy_resource_type.py +20 -0
- blaxel/core/client/models/policy_spec.py +31 -10
- blaxel/core/client/models/policy_spec_type.py +19 -0
- blaxel/core/client/models/port.py +25 -15
- blaxel/core/client/models/port_protocol.py +19 -0
- blaxel/core/client/models/preview.py +19 -36
- blaxel/core/client/models/preview_metadata.py +12 -10
- blaxel/core/client/models/preview_token.py +19 -36
- blaxel/core/client/models/preview_token_metadata.py +8 -6
- blaxel/core/client/models/repository.py +2 -2
- blaxel/core/client/models/revision_configuration.py +3 -3
- blaxel/core/client/models/sandbox.py +45 -58
- blaxel/core/client/models/sandbox_definition.py +37 -22
- blaxel/core/client/models/sandbox_definition_categories_item.py +45 -0
- blaxel/core/client/models/sandbox_error.py +148 -0
- blaxel/core/client/models/sandbox_error_details.py +45 -0
- blaxel/core/client/models/sandbox_lifecycle.py +3 -2
- blaxel/core/client/models/sandbox_runtime.py +145 -0
- blaxel/core/client/models/sandbox_spec.py +33 -134
- blaxel/core/client/models/status.py +25 -0
- blaxel/core/client/models/template.py +8 -7
- blaxel/core/client/models/template_variable.py +5 -5
- blaxel/core/client/models/trigger.py +14 -6
- blaxel/core/client/models/trigger_configuration.py +7 -6
- blaxel/core/client/models/trigger_type.py +19 -0
- blaxel/core/client/models/volume.py +35 -47
- blaxel/core/client/models/volume_attachment.py +6 -4
- blaxel/core/client/models/volume_spec.py +7 -4
- blaxel/core/client/models/volume_state.py +3 -3
- blaxel/core/client/models/volume_template.py +19 -33
- blaxel/core/client/models/volume_template_state.py +12 -4
- blaxel/core/client/models/volume_template_state_status.py +19 -0
- blaxel/core/client/models/volume_template_version.py +12 -4
- blaxel/core/client/models/volume_template_version_status.py +19 -0
- blaxel/core/client/models/workspace.py +35 -25
- blaxel/core/client/models/workspace_runtime.py +3 -2
- blaxel/core/client/models/workspace_status.py +22 -0
- blaxel/core/common/__init__.py +1 -1
- blaxel/core/jobs/__init__.py +0 -1
- blaxel/core/sandbox/__init__.py +2 -0
- blaxel/core/sandbox/client/api/process/post_process.py +8 -4
- blaxel/core/sandbox/client/models/__init__.py +0 -2
- blaxel/core/sandbox/client/models/process_response.py +16 -0
- blaxel/core/sandbox/client/models/process_response_status.py +9 -0
- blaxel/core/sandbox/default/__init__.py +2 -0
- blaxel/core/sandbox/default/interpreter.py +5 -1
- blaxel/core/sandbox/default/preview.py +3 -1
- blaxel/core/sandbox/default/sandbox.py +85 -26
- blaxel/core/sandbox/sync/process.py +2 -1
- blaxel/core/sandbox/sync/sandbox.py +68 -23
- blaxel/core/sandbox/types.py +3 -0
- blaxel/core/tools/common.py +16 -2
- blaxel/core/volume/__init__.py +2 -2
- blaxel/core/volume/volume.py +227 -11
- blaxel/langgraph/tools.py +34 -2
- blaxel/openai/tools.py +33 -1
- {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/METADATA +3 -3
- {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/RECORD +209 -248
- blaxel/core/client/models/acl.py +0 -133
- blaxel/core/client/models/billable_time_metric.py +0 -89
- blaxel/core/client/models/core_spec.py +0 -194
- blaxel/core/client/models/core_spec_configurations.py +0 -77
- blaxel/core/client/models/histogram_bucket.py +0 -79
- blaxel/core/client/models/histogram_stats.py +0 -88
- blaxel/core/client/models/integration_model.py +0 -162
- blaxel/core/client/models/job_execution_config.py +0 -79
- blaxel/core/client/models/job_metrics.py +0 -262
- blaxel/core/client/models/jobs_chart_value.py +0 -70
- blaxel/core/client/models/jobs_network_chart.py +0 -102
- blaxel/core/client/models/jobs_success_failed_chart.py +0 -147
- blaxel/core/client/models/jobs_total.py +0 -88
- blaxel/core/client/models/last_n_requests_metric.py +0 -97
- blaxel/core/client/models/latency_metric.py +0 -148
- blaxel/core/client/models/logs_response.py +0 -63
- blaxel/core/client/models/logs_response_data.py +0 -99
- blaxel/core/client/models/mcp_definition_form.py +0 -45
- blaxel/core/client/models/memory_allocation_by_name.py +0 -70
- blaxel/core/client/models/memory_allocation_metric.py +0 -61
- blaxel/core/client/models/metric.py +0 -79
- blaxel/core/client/models/metrics.py +0 -273
- blaxel/core/client/models/metrics_models.py +0 -45
- blaxel/core/client/models/metrics_rps_per_code.py +0 -45
- blaxel/core/client/models/pod_template_spec.py +0 -45
- blaxel/core/client/models/request_duration_over_time_metric.py +0 -97
- blaxel/core/client/models/request_duration_over_time_metrics.py +0 -84
- blaxel/core/client/models/request_total_by_origin_metric.py +0 -129
- blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin.py +0 -45
- blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +0 -45
- blaxel/core/client/models/request_total_metric.py +0 -155
- blaxel/core/client/models/request_total_metric_request_total_per_code.py +0 -45
- blaxel/core/client/models/request_total_metric_rps_per_code.py +0 -45
- blaxel/core/client/models/request_total_response_data.py +0 -97
- blaxel/core/client/models/resource.py +0 -99
- blaxel/core/client/models/resource_log.py +0 -88
- blaxel/core/client/models/resource_log_chart.py +0 -133
- blaxel/core/client/models/resource_log_response.py +0 -83
- blaxel/core/client/models/resource_metrics.py +0 -618
- blaxel/core/client/models/resource_metrics_request_total_per_code.py +0 -45
- blaxel/core/client/models/resource_metrics_request_total_per_code_previous.py +0 -45
- blaxel/core/client/models/resource_metrics_rps_per_code.py +0 -45
- blaxel/core/client/models/resource_metrics_rps_per_code_previous.py +0 -45
- blaxel/core/client/models/resource_trace.py +0 -97
- blaxel/core/client/models/runtime.py +0 -317
- blaxel/core/client/models/runtime_configuration.py +0 -45
- blaxel/core/client/models/runtime_startup_probe.py +0 -45
- blaxel/core/client/models/sandbox_metrics.py +0 -88
- blaxel/core/client/models/serverless_config.py +0 -117
- blaxel/core/client/models/serverless_config_configuration.py +0 -45
- blaxel/core/client/models/start_sandbox.py +0 -98
- blaxel/core/client/models/stop_sandbox.py +0 -98
- blaxel/core/client/models/store_agent.py +0 -181
- blaxel/core/client/models/store_agent_labels.py +0 -45
- blaxel/core/client/models/store_configuration.py +0 -156
- blaxel/core/client/models/store_configuration_option.py +0 -79
- blaxel/core/client/models/time_to_first_token_over_time_metrics.py +0 -87
- blaxel/core/client/models/token_rate_metric.py +0 -106
- blaxel/core/client/models/token_rate_metrics.py +0 -124
- blaxel/core/client/models/token_total_metric.py +0 -112
- blaxel/core/client/models/trace_ids_response.py +0 -45
- blaxel/core/client/models/websocket_channel.py +0 -97
- blaxel/core/client/models/websocket_message.py +0 -106
- blaxel/core/sandbox/client/api/root/delete.py +0 -130
- blaxel/core/sandbox/client/api/root/get.py +0 -130
- blaxel/core/sandbox/client/api/root/options.py +0 -130
- blaxel/core/sandbox/client/api/root/patch.py +0 -130
- blaxel/core/sandbox/client/api/root/post.py +0 -130
- blaxel/core/sandbox/client/api/root/put.py +0 -130
- /blaxel/core/{sandbox/client/api/root → client/api/mcphub}/__init__.py +0 -0
- {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/WHEEL +0 -0
- {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from http import HTTPStatus
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Union
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import Client
|
|
8
|
+
from ...models.error import Error
|
|
8
9
|
from ...models.model import Model
|
|
9
10
|
from ...types import Response
|
|
10
11
|
|
|
@@ -32,18 +33,38 @@ def _get_kwargs(
|
|
|
32
33
|
return _kwargs
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
def _parse_response(*, client: Client, response: httpx.Response) -> Model | None:
|
|
36
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Union[Error, Model] | None:
|
|
36
37
|
if response.status_code == 200:
|
|
37
38
|
response_200 = Model.from_dict(response.json())
|
|
38
39
|
|
|
39
40
|
return response_200
|
|
41
|
+
if response.status_code == 400:
|
|
42
|
+
response_400 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_400
|
|
45
|
+
if response.status_code == 401:
|
|
46
|
+
response_401 = Error.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_401
|
|
49
|
+
if response.status_code == 403:
|
|
50
|
+
response_403 = Error.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_403
|
|
53
|
+
if response.status_code == 409:
|
|
54
|
+
response_409 = Error.from_dict(response.json())
|
|
55
|
+
|
|
56
|
+
return response_409
|
|
57
|
+
if response.status_code == 500:
|
|
58
|
+
response_500 = Error.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
return response_500
|
|
40
61
|
if client.raise_on_unexpected_status:
|
|
41
62
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
42
63
|
else:
|
|
43
64
|
return None
|
|
44
65
|
|
|
45
66
|
|
|
46
|
-
def _build_response(*, client: Client, response: httpx.Response) -> Response[Model]:
|
|
67
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Error, Model]]:
|
|
47
68
|
return Response(
|
|
48
69
|
status_code=HTTPStatus(response.status_code),
|
|
49
70
|
content=response.content,
|
|
@@ -56,20 +77,22 @@ def sync_detailed(
|
|
|
56
77
|
*,
|
|
57
78
|
client: Client,
|
|
58
79
|
body: Model,
|
|
59
|
-
) -> Response[Model]:
|
|
60
|
-
"""Create model
|
|
80
|
+
) -> Response[Union[Error, Model]]:
|
|
81
|
+
"""Create model endpoint
|
|
61
82
|
|
|
62
|
-
Creates a model.
|
|
83
|
+
Creates a new model gateway endpoint that proxies requests to an external LLM provider. Requires an
|
|
84
|
+
integration connection with valid API credentials for the target provider.
|
|
63
85
|
|
|
64
86
|
Args:
|
|
65
|
-
body (Model):
|
|
87
|
+
body (Model): Gateway endpoint to external LLM provider APIs (OpenAI, Anthropic, etc.)
|
|
88
|
+
with unified access control, credentials management, and usage tracking.
|
|
66
89
|
|
|
67
90
|
Raises:
|
|
68
91
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
69
92
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
70
93
|
|
|
71
94
|
Returns:
|
|
72
|
-
Response[Model]
|
|
95
|
+
Response[Union[Error, Model]]
|
|
73
96
|
"""
|
|
74
97
|
|
|
75
98
|
kwargs = _get_kwargs(
|
|
@@ -87,20 +110,22 @@ def sync(
|
|
|
87
110
|
*,
|
|
88
111
|
client: Client,
|
|
89
112
|
body: Model,
|
|
90
|
-
) -> Model | None:
|
|
91
|
-
"""Create model
|
|
113
|
+
) -> Union[Error, Model] | None:
|
|
114
|
+
"""Create model endpoint
|
|
92
115
|
|
|
93
|
-
Creates a model.
|
|
116
|
+
Creates a new model gateway endpoint that proxies requests to an external LLM provider. Requires an
|
|
117
|
+
integration connection with valid API credentials for the target provider.
|
|
94
118
|
|
|
95
119
|
Args:
|
|
96
|
-
body (Model):
|
|
120
|
+
body (Model): Gateway endpoint to external LLM provider APIs (OpenAI, Anthropic, etc.)
|
|
121
|
+
with unified access control, credentials management, and usage tracking.
|
|
97
122
|
|
|
98
123
|
Raises:
|
|
99
124
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
100
125
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
101
126
|
|
|
102
127
|
Returns:
|
|
103
|
-
Model
|
|
128
|
+
Union[Error, Model]
|
|
104
129
|
"""
|
|
105
130
|
|
|
106
131
|
return sync_detailed(
|
|
@@ -113,20 +138,22 @@ async def asyncio_detailed(
|
|
|
113
138
|
*,
|
|
114
139
|
client: Client,
|
|
115
140
|
body: Model,
|
|
116
|
-
) -> Response[Model]:
|
|
117
|
-
"""Create model
|
|
141
|
+
) -> Response[Union[Error, Model]]:
|
|
142
|
+
"""Create model endpoint
|
|
118
143
|
|
|
119
|
-
Creates a model.
|
|
144
|
+
Creates a new model gateway endpoint that proxies requests to an external LLM provider. Requires an
|
|
145
|
+
integration connection with valid API credentials for the target provider.
|
|
120
146
|
|
|
121
147
|
Args:
|
|
122
|
-
body (Model):
|
|
148
|
+
body (Model): Gateway endpoint to external LLM provider APIs (OpenAI, Anthropic, etc.)
|
|
149
|
+
with unified access control, credentials management, and usage tracking.
|
|
123
150
|
|
|
124
151
|
Raises:
|
|
125
152
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
126
153
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
127
154
|
|
|
128
155
|
Returns:
|
|
129
|
-
Response[Model]
|
|
156
|
+
Response[Union[Error, Model]]
|
|
130
157
|
"""
|
|
131
158
|
|
|
132
159
|
kwargs = _get_kwargs(
|
|
@@ -142,20 +169,22 @@ async def asyncio(
|
|
|
142
169
|
*,
|
|
143
170
|
client: Client,
|
|
144
171
|
body: Model,
|
|
145
|
-
) -> Model | None:
|
|
146
|
-
"""Create model
|
|
172
|
+
) -> Union[Error, Model] | None:
|
|
173
|
+
"""Create model endpoint
|
|
147
174
|
|
|
148
|
-
Creates a model.
|
|
175
|
+
Creates a new model gateway endpoint that proxies requests to an external LLM provider. Requires an
|
|
176
|
+
integration connection with valid API credentials for the target provider.
|
|
149
177
|
|
|
150
178
|
Args:
|
|
151
|
-
body (Model):
|
|
179
|
+
body (Model): Gateway endpoint to external LLM provider APIs (OpenAI, Anthropic, etc.)
|
|
180
|
+
with unified access control, credentials management, and usage tracking.
|
|
152
181
|
|
|
153
182
|
Raises:
|
|
154
183
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
155
184
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
156
185
|
|
|
157
186
|
Returns:
|
|
158
|
-
Model
|
|
187
|
+
Union[Error, Model]
|
|
159
188
|
"""
|
|
160
189
|
|
|
161
190
|
return (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from http import HTTPStatus
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Union
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import Client
|
|
8
|
+
from ...models.error import Error
|
|
8
9
|
from ...models.model import Model
|
|
9
10
|
from ...types import Response
|
|
10
11
|
|
|
@@ -20,18 +21,34 @@ def _get_kwargs(
|
|
|
20
21
|
return _kwargs
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
def _parse_response(*, client: Client, response: httpx.Response) -> Model | None:
|
|
24
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Union[Error, Model] | None:
|
|
24
25
|
if response.status_code == 200:
|
|
25
26
|
response_200 = Model.from_dict(response.json())
|
|
26
27
|
|
|
27
28
|
return response_200
|
|
29
|
+
if response.status_code == 401:
|
|
30
|
+
response_401 = Error.from_dict(response.json())
|
|
31
|
+
|
|
32
|
+
return response_401
|
|
33
|
+
if response.status_code == 403:
|
|
34
|
+
response_403 = Error.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_403
|
|
37
|
+
if response.status_code == 404:
|
|
38
|
+
response_404 = Error.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_404
|
|
41
|
+
if response.status_code == 500:
|
|
42
|
+
response_500 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_500
|
|
28
45
|
if client.raise_on_unexpected_status:
|
|
29
46
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
30
47
|
else:
|
|
31
48
|
return None
|
|
32
49
|
|
|
33
50
|
|
|
34
|
-
def _build_response(*, client: Client, response: httpx.Response) -> Response[Model]:
|
|
51
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Error, Model]]:
|
|
35
52
|
return Response(
|
|
36
53
|
status_code=HTTPStatus(response.status_code),
|
|
37
54
|
content=response.content,
|
|
@@ -44,10 +61,11 @@ def sync_detailed(
|
|
|
44
61
|
model_name: str,
|
|
45
62
|
*,
|
|
46
63
|
client: Client,
|
|
47
|
-
) -> Response[Model]:
|
|
48
|
-
"""Delete model
|
|
64
|
+
) -> Response[Union[Error, Model]]:
|
|
65
|
+
"""Delete model endpoint
|
|
49
66
|
|
|
50
|
-
|
|
67
|
+
Permanently deletes a model gateway endpoint. Any agents or applications using this endpoint will
|
|
68
|
+
need to be updated to use a different model.
|
|
51
69
|
|
|
52
70
|
Args:
|
|
53
71
|
model_name (str):
|
|
@@ -57,7 +75,7 @@ def sync_detailed(
|
|
|
57
75
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
58
76
|
|
|
59
77
|
Returns:
|
|
60
|
-
Response[Model]
|
|
78
|
+
Response[Union[Error, Model]]
|
|
61
79
|
"""
|
|
62
80
|
|
|
63
81
|
kwargs = _get_kwargs(
|
|
@@ -75,10 +93,11 @@ def sync(
|
|
|
75
93
|
model_name: str,
|
|
76
94
|
*,
|
|
77
95
|
client: Client,
|
|
78
|
-
) -> Model | None:
|
|
79
|
-
"""Delete model
|
|
96
|
+
) -> Union[Error, Model] | None:
|
|
97
|
+
"""Delete model endpoint
|
|
80
98
|
|
|
81
|
-
|
|
99
|
+
Permanently deletes a model gateway endpoint. Any agents or applications using this endpoint will
|
|
100
|
+
need to be updated to use a different model.
|
|
82
101
|
|
|
83
102
|
Args:
|
|
84
103
|
model_name (str):
|
|
@@ -88,7 +107,7 @@ def sync(
|
|
|
88
107
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
89
108
|
|
|
90
109
|
Returns:
|
|
91
|
-
Model
|
|
110
|
+
Union[Error, Model]
|
|
92
111
|
"""
|
|
93
112
|
|
|
94
113
|
return sync_detailed(
|
|
@@ -101,10 +120,11 @@ async def asyncio_detailed(
|
|
|
101
120
|
model_name: str,
|
|
102
121
|
*,
|
|
103
122
|
client: Client,
|
|
104
|
-
) -> Response[Model]:
|
|
105
|
-
"""Delete model
|
|
123
|
+
) -> Response[Union[Error, Model]]:
|
|
124
|
+
"""Delete model endpoint
|
|
106
125
|
|
|
107
|
-
|
|
126
|
+
Permanently deletes a model gateway endpoint. Any agents or applications using this endpoint will
|
|
127
|
+
need to be updated to use a different model.
|
|
108
128
|
|
|
109
129
|
Args:
|
|
110
130
|
model_name (str):
|
|
@@ -114,7 +134,7 @@ async def asyncio_detailed(
|
|
|
114
134
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
115
135
|
|
|
116
136
|
Returns:
|
|
117
|
-
Response[Model]
|
|
137
|
+
Response[Union[Error, Model]]
|
|
118
138
|
"""
|
|
119
139
|
|
|
120
140
|
kwargs = _get_kwargs(
|
|
@@ -130,10 +150,11 @@ async def asyncio(
|
|
|
130
150
|
model_name: str,
|
|
131
151
|
*,
|
|
132
152
|
client: Client,
|
|
133
|
-
) -> Model | None:
|
|
134
|
-
"""Delete model
|
|
153
|
+
) -> Union[Error, Model] | None:
|
|
154
|
+
"""Delete model endpoint
|
|
135
155
|
|
|
136
|
-
|
|
156
|
+
Permanently deletes a model gateway endpoint. Any agents or applications using this endpoint will
|
|
157
|
+
need to be updated to use a different model.
|
|
137
158
|
|
|
138
159
|
Args:
|
|
139
160
|
model_name (str):
|
|
@@ -143,7 +164,7 @@ async def asyncio(
|
|
|
143
164
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
144
165
|
|
|
145
166
|
Returns:
|
|
146
|
-
Model
|
|
167
|
+
Union[Error, Model]
|
|
147
168
|
"""
|
|
148
169
|
|
|
149
170
|
return (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from http import HTTPStatus
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Union
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import Client
|
|
8
|
+
from ...models.error import Error
|
|
8
9
|
from ...models.model import Model
|
|
9
10
|
from ...types import Response
|
|
10
11
|
|
|
@@ -20,18 +21,34 @@ def _get_kwargs(
|
|
|
20
21
|
return _kwargs
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
def _parse_response(*, client: Client, response: httpx.Response) -> Model | None:
|
|
24
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Union[Error, Model] | None:
|
|
24
25
|
if response.status_code == 200:
|
|
25
26
|
response_200 = Model.from_dict(response.json())
|
|
26
27
|
|
|
27
28
|
return response_200
|
|
29
|
+
if response.status_code == 401:
|
|
30
|
+
response_401 = Error.from_dict(response.json())
|
|
31
|
+
|
|
32
|
+
return response_401
|
|
33
|
+
if response.status_code == 403:
|
|
34
|
+
response_403 = Error.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_403
|
|
37
|
+
if response.status_code == 404:
|
|
38
|
+
response_404 = Error.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_404
|
|
41
|
+
if response.status_code == 500:
|
|
42
|
+
response_500 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_500
|
|
28
45
|
if client.raise_on_unexpected_status:
|
|
29
46
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
30
47
|
else:
|
|
31
48
|
return None
|
|
32
49
|
|
|
33
50
|
|
|
34
|
-
def _build_response(*, client: Client, response: httpx.Response) -> Response[Model]:
|
|
51
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Error, Model]]:
|
|
35
52
|
return Response(
|
|
36
53
|
status_code=HTTPStatus(response.status_code),
|
|
37
54
|
content=response.content,
|
|
@@ -44,10 +61,11 @@ def sync_detailed(
|
|
|
44
61
|
model_name: str,
|
|
45
62
|
*,
|
|
46
63
|
client: Client,
|
|
47
|
-
) -> Response[Model]:
|
|
48
|
-
"""Get model
|
|
64
|
+
) -> Response[Union[Error, Model]]:
|
|
65
|
+
"""Get model endpoint
|
|
49
66
|
|
|
50
|
-
Returns a model
|
|
67
|
+
Returns detailed information about a model gateway endpoint including its provider configuration,
|
|
68
|
+
integration connection, and usage status.
|
|
51
69
|
|
|
52
70
|
Args:
|
|
53
71
|
model_name (str):
|
|
@@ -57,7 +75,7 @@ def sync_detailed(
|
|
|
57
75
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
58
76
|
|
|
59
77
|
Returns:
|
|
60
|
-
Response[Model]
|
|
78
|
+
Response[Union[Error, Model]]
|
|
61
79
|
"""
|
|
62
80
|
|
|
63
81
|
kwargs = _get_kwargs(
|
|
@@ -75,10 +93,11 @@ def sync(
|
|
|
75
93
|
model_name: str,
|
|
76
94
|
*,
|
|
77
95
|
client: Client,
|
|
78
|
-
) -> Model | None:
|
|
79
|
-
"""Get model
|
|
96
|
+
) -> Union[Error, Model] | None:
|
|
97
|
+
"""Get model endpoint
|
|
80
98
|
|
|
81
|
-
Returns a model
|
|
99
|
+
Returns detailed information about a model gateway endpoint including its provider configuration,
|
|
100
|
+
integration connection, and usage status.
|
|
82
101
|
|
|
83
102
|
Args:
|
|
84
103
|
model_name (str):
|
|
@@ -88,7 +107,7 @@ def sync(
|
|
|
88
107
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
89
108
|
|
|
90
109
|
Returns:
|
|
91
|
-
Model
|
|
110
|
+
Union[Error, Model]
|
|
92
111
|
"""
|
|
93
112
|
|
|
94
113
|
return sync_detailed(
|
|
@@ -101,10 +120,11 @@ async def asyncio_detailed(
|
|
|
101
120
|
model_name: str,
|
|
102
121
|
*,
|
|
103
122
|
client: Client,
|
|
104
|
-
) -> Response[Model]:
|
|
105
|
-
"""Get model
|
|
123
|
+
) -> Response[Union[Error, Model]]:
|
|
124
|
+
"""Get model endpoint
|
|
106
125
|
|
|
107
|
-
Returns a model
|
|
126
|
+
Returns detailed information about a model gateway endpoint including its provider configuration,
|
|
127
|
+
integration connection, and usage status.
|
|
108
128
|
|
|
109
129
|
Args:
|
|
110
130
|
model_name (str):
|
|
@@ -114,7 +134,7 @@ async def asyncio_detailed(
|
|
|
114
134
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
115
135
|
|
|
116
136
|
Returns:
|
|
117
|
-
Response[Model]
|
|
137
|
+
Response[Union[Error, Model]]
|
|
118
138
|
"""
|
|
119
139
|
|
|
120
140
|
kwargs = _get_kwargs(
|
|
@@ -130,10 +150,11 @@ async def asyncio(
|
|
|
130
150
|
model_name: str,
|
|
131
151
|
*,
|
|
132
152
|
client: Client,
|
|
133
|
-
) -> Model | None:
|
|
134
|
-
"""Get model
|
|
153
|
+
) -> Union[Error, Model] | None:
|
|
154
|
+
"""Get model endpoint
|
|
135
155
|
|
|
136
|
-
Returns a model
|
|
156
|
+
Returns detailed information about a model gateway endpoint including its provider configuration,
|
|
157
|
+
integration connection, and usage status.
|
|
137
158
|
|
|
138
159
|
Args:
|
|
139
160
|
model_name (str):
|
|
@@ -143,7 +164,7 @@ async def asyncio(
|
|
|
143
164
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
144
165
|
|
|
145
166
|
Returns:
|
|
146
|
-
Model
|
|
167
|
+
Union[Error, Model]
|
|
147
168
|
"""
|
|
148
169
|
|
|
149
170
|
return (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from http import HTTPStatus
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Union
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import Client
|
|
8
|
+
from ...models.error import Error
|
|
8
9
|
from ...models.model import Model
|
|
9
10
|
from ...types import Response
|
|
10
11
|
|
|
@@ -18,7 +19,9 @@ def _get_kwargs() -> dict[str, Any]:
|
|
|
18
19
|
return _kwargs
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
def _parse_response(
|
|
22
|
+
def _parse_response(
|
|
23
|
+
*, client: Client, response: httpx.Response
|
|
24
|
+
) -> Union[Error, list["Model"]] | None:
|
|
22
25
|
if response.status_code == 200:
|
|
23
26
|
response_200 = []
|
|
24
27
|
_response_200 = response.json()
|
|
@@ -28,13 +31,27 @@ def _parse_response(*, client: Client, response: httpx.Response) -> list["Model"
|
|
|
28
31
|
response_200.append(response_200_item)
|
|
29
32
|
|
|
30
33
|
return response_200
|
|
34
|
+
if response.status_code == 401:
|
|
35
|
+
response_401 = Error.from_dict(response.json())
|
|
36
|
+
|
|
37
|
+
return response_401
|
|
38
|
+
if response.status_code == 403:
|
|
39
|
+
response_403 = Error.from_dict(response.json())
|
|
40
|
+
|
|
41
|
+
return response_403
|
|
42
|
+
if response.status_code == 500:
|
|
43
|
+
response_500 = Error.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_500
|
|
31
46
|
if client.raise_on_unexpected_status:
|
|
32
47
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
33
48
|
else:
|
|
34
49
|
return None
|
|
35
50
|
|
|
36
51
|
|
|
37
|
-
def _build_response(
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: Client, response: httpx.Response
|
|
54
|
+
) -> Response[Union[Error, list["Model"]]]:
|
|
38
55
|
return Response(
|
|
39
56
|
status_code=HTTPStatus(response.status_code),
|
|
40
57
|
content=response.content,
|
|
@@ -46,17 +63,18 @@ def _build_response(*, client: Client, response: httpx.Response) -> Response[lis
|
|
|
46
63
|
def sync_detailed(
|
|
47
64
|
*,
|
|
48
65
|
client: Client,
|
|
49
|
-
) -> Response[list["Model"]]:
|
|
50
|
-
"""List
|
|
66
|
+
) -> Response[Union[Error, list["Model"]]]:
|
|
67
|
+
"""List model endpoints
|
|
51
68
|
|
|
52
|
-
Returns
|
|
69
|
+
Returns all model gateway endpoints configured in the workspace. Each model represents a proxy to an
|
|
70
|
+
external LLM provider (OpenAI, Anthropic, etc.) with unified access control.
|
|
53
71
|
|
|
54
72
|
Raises:
|
|
55
73
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
56
74
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
57
75
|
|
|
58
76
|
Returns:
|
|
59
|
-
Response[list['Model']]
|
|
77
|
+
Response[Union[Error, list['Model']]]
|
|
60
78
|
"""
|
|
61
79
|
|
|
62
80
|
kwargs = _get_kwargs()
|
|
@@ -71,17 +89,18 @@ def sync_detailed(
|
|
|
71
89
|
def sync(
|
|
72
90
|
*,
|
|
73
91
|
client: Client,
|
|
74
|
-
) -> list["Model"] | None:
|
|
75
|
-
"""List
|
|
92
|
+
) -> Union[Error, list["Model"]] | None:
|
|
93
|
+
"""List model endpoints
|
|
76
94
|
|
|
77
|
-
Returns
|
|
95
|
+
Returns all model gateway endpoints configured in the workspace. Each model represents a proxy to an
|
|
96
|
+
external LLM provider (OpenAI, Anthropic, etc.) with unified access control.
|
|
78
97
|
|
|
79
98
|
Raises:
|
|
80
99
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
81
100
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
101
|
|
|
83
102
|
Returns:
|
|
84
|
-
list['Model']
|
|
103
|
+
Union[Error, list['Model']]
|
|
85
104
|
"""
|
|
86
105
|
|
|
87
106
|
return sync_detailed(
|
|
@@ -92,17 +111,18 @@ def sync(
|
|
|
92
111
|
async def asyncio_detailed(
|
|
93
112
|
*,
|
|
94
113
|
client: Client,
|
|
95
|
-
) -> Response[list["Model"]]:
|
|
96
|
-
"""List
|
|
114
|
+
) -> Response[Union[Error, list["Model"]]]:
|
|
115
|
+
"""List model endpoints
|
|
97
116
|
|
|
98
|
-
Returns
|
|
117
|
+
Returns all model gateway endpoints configured in the workspace. Each model represents a proxy to an
|
|
118
|
+
external LLM provider (OpenAI, Anthropic, etc.) with unified access control.
|
|
99
119
|
|
|
100
120
|
Raises:
|
|
101
121
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
102
122
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
103
123
|
|
|
104
124
|
Returns:
|
|
105
|
-
Response[list['Model']]
|
|
125
|
+
Response[Union[Error, list['Model']]]
|
|
106
126
|
"""
|
|
107
127
|
|
|
108
128
|
kwargs = _get_kwargs()
|
|
@@ -115,17 +135,18 @@ async def asyncio_detailed(
|
|
|
115
135
|
async def asyncio(
|
|
116
136
|
*,
|
|
117
137
|
client: Client,
|
|
118
|
-
) -> list["Model"] | None:
|
|
119
|
-
"""List
|
|
138
|
+
) -> Union[Error, list["Model"]] | None:
|
|
139
|
+
"""List model endpoints
|
|
120
140
|
|
|
121
|
-
Returns
|
|
141
|
+
Returns all model gateway endpoints configured in the workspace. Each model represents a proxy to an
|
|
142
|
+
external LLM provider (OpenAI, Anthropic, etc.) with unified access control.
|
|
122
143
|
|
|
123
144
|
Raises:
|
|
124
145
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
125
146
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
126
147
|
|
|
127
148
|
Returns:
|
|
128
|
-
list['Model']
|
|
149
|
+
Union[Error, list['Model']]
|
|
129
150
|
"""
|
|
130
151
|
|
|
131
152
|
return (
|