beamlit 0.1.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/__init__.py +8 -0
- beamlit/api/__init__.py +1 -0
- beamlit/api/agents/__init__.py +0 -0
- beamlit/api/agents/create_agent.py +155 -0
- beamlit/api/agents/create_agent_release.py +146 -0
- beamlit/api/agents/delete_agent.py +146 -0
- beamlit/api/agents/delete_agent_deployment.py +163 -0
- beamlit/api/agents/delete_agent_deployment_history.py +172 -0
- beamlit/api/agents/get_agent.py +146 -0
- beamlit/api/agents/get_agent_deployment.py +163 -0
- beamlit/api/agents/get_agent_deployment_history.py +172 -0
- beamlit/api/agents/get_agent_deployment_logs.py +164 -0
- beamlit/api/agents/get_agent_deployment_metrics.py +159 -0
- beamlit/api/agents/get_agent_metrics.py +150 -0
- beamlit/api/agents/list_agent_deployment_history.py +164 -0
- beamlit/api/agents/list_agent_deployments.py +155 -0
- beamlit/api/agents/list_agents.py +127 -0
- beamlit/api/agents/put_agent_deployment.py +185 -0
- beamlit/api/agents/put_agent_deployment_history.py +198 -0
- beamlit/api/agents/update_agent.py +168 -0
- beamlit/api/authentication_providers/__init__.py +0 -0
- beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +184 -0
- beamlit/api/authentication_providers/list_models_for_authentication_provider.py +163 -0
- beamlit/api/authentication_providers/list_organizations_for_authentication_provider.py +163 -0
- beamlit/api/configurations/__init__.py +0 -0
- beamlit/api/configurations/get_configuration.py +122 -0
- beamlit/api/environments/__init__.py +0 -0
- beamlit/api/environments/create_environment.py +167 -0
- beamlit/api/environments/delete_environment.py +154 -0
- beamlit/api/environments/get_environment.py +154 -0
- beamlit/api/environments/get_environment_metrics.py +158 -0
- beamlit/api/environments/list_environments.py +139 -0
- beamlit/api/environments/update_environment.py +180 -0
- beamlit/api/functions/__init__.py +0 -0
- beamlit/api/functions/create_function.py +155 -0
- beamlit/api/functions/create_function_release.py +150 -0
- beamlit/api/functions/delete_function.py +146 -0
- beamlit/api/functions/delete_function_deployment.py +163 -0
- beamlit/api/functions/get_function.py +146 -0
- beamlit/api/functions/get_function_deployment.py +163 -0
- beamlit/api/functions/get_function_deployment_logs.py +164 -0
- beamlit/api/functions/get_function_deployment_metrics.py +159 -0
- beamlit/api/functions/get_function_metrics.py +150 -0
- beamlit/api/functions/list_function_deployments.py +155 -0
- beamlit/api/functions/list_functions.py +131 -0
- beamlit/api/functions/put_function_deployment.py +185 -0
- beamlit/api/functions/update_function.py +168 -0
- beamlit/api/history/__init__.py +0 -0
- beamlit/api/history/get_agents_history.py +155 -0
- beamlit/api/history/list_agents_history.py +131 -0
- beamlit/api/invitations/__init__.py +0 -0
- beamlit/api/invitations/list_all_pending_invitations.py +142 -0
- beamlit/api/locations/__init__.py +0 -0
- beamlit/api/locations/list_locations.py +139 -0
- beamlit/api/metrics/__init__.py +0 -0
- beamlit/api/metrics/get_metrics.py +130 -0
- beamlit/api/model_providers/__init__.py +0 -0
- beamlit/api/model_providers/create_model_provider.py +163 -0
- beamlit/api/model_providers/delete_model_provider.py +154 -0
- beamlit/api/model_providers/get_model_provider.py +154 -0
- beamlit/api/model_providers/list_model_providers.py +139 -0
- beamlit/api/model_providers/update_model_provider.py +176 -0
- beamlit/api/models/__init__.py +0 -0
- beamlit/api/models/create_model.py +168 -0
- beamlit/api/models/delete_model.py +154 -0
- beamlit/api/models/delete_model_deployment.py +171 -0
- beamlit/api/models/get_model.py +154 -0
- beamlit/api/models/get_model_deployment.py +171 -0
- beamlit/api/models/get_model_deployment_logs.py +168 -0
- beamlit/api/models/get_model_deployment_metrics.py +163 -0
- beamlit/api/models/get_model_metrics.py +154 -0
- beamlit/api/models/list_model_deployments.py +163 -0
- beamlit/api/models/list_models.py +135 -0
- beamlit/api/models/put_model_deployment.py +193 -0
- beamlit/api/models/release_model.py +154 -0
- beamlit/api/models/update_model.py +181 -0
- beamlit/api/policies/__init__.py +0 -0
- beamlit/api/policies/create_policy.py +167 -0
- beamlit/api/policies/delete_policy.py +154 -0
- beamlit/api/policies/get_policy.py +154 -0
- beamlit/api/policies/list_policies.py +139 -0
- beamlit/api/policies/update_policy.py +180 -0
- beamlit/api/service_accounts/__init__.py +0 -0
- beamlit/api/service_accounts/create_api_key_for_service_account.py +177 -0
- beamlit/api/service_accounts/create_workspace_service_account.py +168 -0
- beamlit/api/service_accounts/delete_api_key_for_service_account.py +104 -0
- beamlit/api/service_accounts/delete_workspace_service_account.py +158 -0
- beamlit/api/service_accounts/get_workspace_service_accounts.py +139 -0
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +163 -0
- beamlit/api/service_accounts/update_workspace_service_account.py +181 -0
- beamlit/api/store/__init__.py +0 -0
- beamlit/api/store/get_store_agent.py +146 -0
- beamlit/api/store/get_store_function.py +146 -0
- beamlit/api/store/list_store_agents.py +131 -0
- beamlit/api/store/list_store_functions.py +131 -0
- beamlit/api/workspaces/__init__.py +0 -0
- beamlit/api/workspaces/accept_workspace_invitation.py +161 -0
- beamlit/api/workspaces/create_worspace.py +163 -0
- beamlit/api/workspaces/decline_workspace_invitation.py +158 -0
- beamlit/api/workspaces/delete_workspace.py +154 -0
- beamlit/api/workspaces/get_workspace.py +154 -0
- beamlit/api/workspaces/invite_workspace_user.py +174 -0
- beamlit/api/workspaces/leave_workspace.py +161 -0
- beamlit/api/workspaces/list_workspace_users.py +139 -0
- beamlit/api/workspaces/list_workspaces.py +139 -0
- beamlit/api/workspaces/remove_workspace_user.py +101 -0
- beamlit/api/workspaces/update_workspace.py +176 -0
- beamlit/api/workspaces/update_workspace_user_role.py +187 -0
- beamlit/authentication/__init__.py +24 -0
- beamlit/authentication/apikey.py +14 -0
- beamlit/authentication/authentication.py +35 -0
- beamlit/authentication/credentials.py +165 -0
- beamlit/authentication/device_mode.py +115 -0
- beamlit/client.py +270 -0
- beamlit/errors.py +16 -0
- beamlit/models/__init__.py +189 -0
- beamlit/models/acl.py +149 -0
- beamlit/models/agent.py +151 -0
- beamlit/models/agent_chain.py +77 -0
- beamlit/models/agent_configuration.py +68 -0
- beamlit/models/agent_deployment.py +327 -0
- beamlit/models/agent_deployment_configuration.py +43 -0
- beamlit/models/agent_deployment_history.py +183 -0
- beamlit/models/agent_deployment_history_event.py +131 -0
- beamlit/models/agent_deployment_pod_template.py +43 -0
- beamlit/models/agent_release.py +68 -0
- beamlit/models/api_key.py +140 -0
- beamlit/models/authentication_provider_model.py +142 -0
- beamlit/models/authentication_provider_organization.py +86 -0
- beamlit/models/configuration.py +72 -0
- beamlit/models/continent.py +68 -0
- beamlit/models/country.py +68 -0
- beamlit/models/create_api_key_for_service_account_body.py +67 -0
- beamlit/models/create_workspace_service_account_body.py +69 -0
- beamlit/models/create_workspace_service_account_response_200.py +103 -0
- beamlit/models/delete_workspace_service_account_response_200.py +94 -0
- beamlit/models/deployment_configuration.py +68 -0
- beamlit/models/deployment_configurations.py +43 -0
- beamlit/models/deployment_serverless_config.py +129 -0
- beamlit/models/environment.py +162 -0
- beamlit/models/environment_metrics.py +75 -0
- beamlit/models/flavor.py +68 -0
- beamlit/models/function.py +151 -0
- beamlit/models/function_configuration.py +68 -0
- beamlit/models/function_deployment.py +327 -0
- beamlit/models/function_deployment_configuration.py +43 -0
- beamlit/models/function_deployment_pod_template.py +43 -0
- beamlit/models/function_kit.py +95 -0
- beamlit/models/function_provider_ref.py +68 -0
- beamlit/models/function_release.py +68 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +94 -0
- beamlit/models/invite_workspace_user_body.py +58 -0
- beamlit/models/labels.py +43 -0
- beamlit/models/labels_type_0.py +43 -0
- beamlit/models/location.py +120 -0
- beamlit/models/location_response.py +111 -0
- beamlit/models/metric.py +68 -0
- beamlit/models/metrics.py +111 -0
- beamlit/models/model.py +151 -0
- beamlit/models/model_deployment.py +283 -0
- beamlit/models/model_deployment_log.py +68 -0
- beamlit/models/model_deployment_metrics.py +170 -0
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/model_deployment_pod_template.py +43 -0
- beamlit/models/model_metrics.py +94 -0
- beamlit/models/model_provider.py +187 -0
- beamlit/models/model_provider_ref.py +68 -0
- beamlit/models/model_release.py +68 -0
- beamlit/models/model_with_deployments.py +174 -0
- beamlit/models/pending_invitation.py +122 -0
- beamlit/models/pending_invitation_accept.py +81 -0
- beamlit/models/pending_invitation_render.py +135 -0
- beamlit/models/pending_invitation_render_invited_by.py +86 -0
- beamlit/models/pending_invitation_render_workspace.py +68 -0
- beamlit/models/pending_invitation_workspace_details.py +70 -0
- beamlit/models/policy.py +216 -0
- beamlit/models/policy_location.py +68 -0
- beamlit/models/provider_config.py +101 -0
- beamlit/models/qps.py +59 -0
- beamlit/models/resource_deployment_log.py +68 -0
- beamlit/models/resource_deployment_metrics.py +172 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_metrics.py +94 -0
- beamlit/models/runtime.py +152 -0
- beamlit/models/runtime_readiness_probe.py +43 -0
- beamlit/models/runtime_resources.py +43 -0
- beamlit/models/serverless_config.py +122 -0
- beamlit/models/standard_fields_dynamo_db.py +86 -0
- beamlit/models/store_agent.py +165 -0
- beamlit/models/store_agent_configuration.py +95 -0
- beamlit/models/store_agent_labels.py +43 -0
- beamlit/models/store_configuration.py +149 -0
- beamlit/models/store_configuration_option.py +77 -0
- beamlit/models/store_function.py +207 -0
- beamlit/models/store_function_configuration.py +95 -0
- beamlit/models/store_function_kit.py +95 -0
- beamlit/models/store_function_labels.py +43 -0
- beamlit/models/store_function_parameter.py +86 -0
- beamlit/models/update_workspace_service_account_body.py +67 -0
- beamlit/models/update_workspace_service_account_response_200.py +94 -0
- beamlit/models/update_workspace_user_role_body.py +58 -0
- beamlit/models/workspace.py +126 -0
- beamlit/models/workspace_labels.py +43 -0
- beamlit/models/workspace_user.py +113 -0
- beamlit/py.typed +1 -0
- beamlit/types.py +46 -0
- beamlit-0.1.0.dist-info/METADATA +59 -0
- beamlit-0.1.0.dist-info/RECORD +211 -0
- beamlit-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,155 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, List, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import AuthenticatedClient, Client
|
8
|
+
from ...models.agent_deployment import AgentDeployment
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
agent_name: str,
|
14
|
+
) -> dict[str, Any]:
|
15
|
+
_kwargs: dict[str, Any] = {
|
16
|
+
"method": "get",
|
17
|
+
"url": f"/agents/{agent_name}/deployments",
|
18
|
+
}
|
19
|
+
|
20
|
+
return _kwargs
|
21
|
+
|
22
|
+
|
23
|
+
def _parse_response(
|
24
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
25
|
+
) -> Optional[List["AgentDeployment"]]:
|
26
|
+
if response.status_code == 200:
|
27
|
+
response_200 = []
|
28
|
+
_response_200 = response.json()
|
29
|
+
for response_200_item_data in _response_200:
|
30
|
+
response_200_item = AgentDeployment.from_dict(response_200_item_data)
|
31
|
+
|
32
|
+
response_200.append(response_200_item)
|
33
|
+
|
34
|
+
return response_200
|
35
|
+
if client.raise_on_unexpected_status:
|
36
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
37
|
+
else:
|
38
|
+
return None
|
39
|
+
|
40
|
+
|
41
|
+
def _build_response(
|
42
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
43
|
+
) -> Response[List["AgentDeployment"]]:
|
44
|
+
return Response(
|
45
|
+
status_code=HTTPStatus(response.status_code),
|
46
|
+
content=response.content,
|
47
|
+
headers=response.headers,
|
48
|
+
parsed=_parse_response(client=client, response=response),
|
49
|
+
)
|
50
|
+
|
51
|
+
|
52
|
+
def sync_detailed(
|
53
|
+
agent_name: str,
|
54
|
+
*,
|
55
|
+
client: AuthenticatedClient,
|
56
|
+
) -> Response[List["AgentDeployment"]]:
|
57
|
+
"""List all agent deployments
|
58
|
+
|
59
|
+
Args:
|
60
|
+
agent_name (str):
|
61
|
+
|
62
|
+
Raises:
|
63
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
64
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
65
|
+
|
66
|
+
Returns:
|
67
|
+
Response[List['AgentDeployment']]
|
68
|
+
"""
|
69
|
+
|
70
|
+
kwargs = _get_kwargs(
|
71
|
+
agent_name=agent_name,
|
72
|
+
)
|
73
|
+
|
74
|
+
response = client.get_httpx_client().request(
|
75
|
+
**kwargs,
|
76
|
+
)
|
77
|
+
|
78
|
+
return _build_response(client=client, response=response)
|
79
|
+
|
80
|
+
|
81
|
+
def sync(
|
82
|
+
agent_name: str,
|
83
|
+
*,
|
84
|
+
client: AuthenticatedClient,
|
85
|
+
) -> Optional[List["AgentDeployment"]]:
|
86
|
+
"""List all agent deployments
|
87
|
+
|
88
|
+
Args:
|
89
|
+
agent_name (str):
|
90
|
+
|
91
|
+
Raises:
|
92
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
93
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
List['AgentDeployment']
|
97
|
+
"""
|
98
|
+
|
99
|
+
return sync_detailed(
|
100
|
+
agent_name=agent_name,
|
101
|
+
client=client,
|
102
|
+
).parsed
|
103
|
+
|
104
|
+
|
105
|
+
async def asyncio_detailed(
|
106
|
+
agent_name: str,
|
107
|
+
*,
|
108
|
+
client: AuthenticatedClient,
|
109
|
+
) -> Response[List["AgentDeployment"]]:
|
110
|
+
"""List all agent deployments
|
111
|
+
|
112
|
+
Args:
|
113
|
+
agent_name (str):
|
114
|
+
|
115
|
+
Raises:
|
116
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
117
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
118
|
+
|
119
|
+
Returns:
|
120
|
+
Response[List['AgentDeployment']]
|
121
|
+
"""
|
122
|
+
|
123
|
+
kwargs = _get_kwargs(
|
124
|
+
agent_name=agent_name,
|
125
|
+
)
|
126
|
+
|
127
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
128
|
+
|
129
|
+
return _build_response(client=client, response=response)
|
130
|
+
|
131
|
+
|
132
|
+
async def asyncio(
|
133
|
+
agent_name: str,
|
134
|
+
*,
|
135
|
+
client: AuthenticatedClient,
|
136
|
+
) -> Optional[List["AgentDeployment"]]:
|
137
|
+
"""List all agent deployments
|
138
|
+
|
139
|
+
Args:
|
140
|
+
agent_name (str):
|
141
|
+
|
142
|
+
Raises:
|
143
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
144
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
145
|
+
|
146
|
+
Returns:
|
147
|
+
List['AgentDeployment']
|
148
|
+
"""
|
149
|
+
|
150
|
+
return (
|
151
|
+
await asyncio_detailed(
|
152
|
+
agent_name=agent_name,
|
153
|
+
client=client,
|
154
|
+
)
|
155
|
+
).parsed
|
@@ -0,0 +1,127 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, List, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import AuthenticatedClient, Client
|
8
|
+
from ...models.agent import Agent
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
13
|
+
_kwargs: dict[str, Any] = {
|
14
|
+
"method": "get",
|
15
|
+
"url": "/agents",
|
16
|
+
}
|
17
|
+
|
18
|
+
return _kwargs
|
19
|
+
|
20
|
+
|
21
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List["Agent"]]:
|
22
|
+
if response.status_code == 200:
|
23
|
+
response_200 = []
|
24
|
+
_response_200 = response.json()
|
25
|
+
for response_200_item_data in _response_200:
|
26
|
+
response_200_item = Agent.from_dict(response_200_item_data)
|
27
|
+
|
28
|
+
response_200.append(response_200_item)
|
29
|
+
|
30
|
+
return response_200
|
31
|
+
if client.raise_on_unexpected_status:
|
32
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
33
|
+
else:
|
34
|
+
return None
|
35
|
+
|
36
|
+
|
37
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List["Agent"]]:
|
38
|
+
return Response(
|
39
|
+
status_code=HTTPStatus(response.status_code),
|
40
|
+
content=response.content,
|
41
|
+
headers=response.headers,
|
42
|
+
parsed=_parse_response(client=client, response=response),
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
def sync_detailed(
|
47
|
+
*,
|
48
|
+
client: AuthenticatedClient,
|
49
|
+
) -> Response[List["Agent"]]:
|
50
|
+
"""List all agents
|
51
|
+
|
52
|
+
Raises:
|
53
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
54
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
55
|
+
|
56
|
+
Returns:
|
57
|
+
Response[List['Agent']]
|
58
|
+
"""
|
59
|
+
|
60
|
+
kwargs = _get_kwargs()
|
61
|
+
|
62
|
+
response = client.get_httpx_client().request(
|
63
|
+
**kwargs,
|
64
|
+
)
|
65
|
+
|
66
|
+
return _build_response(client=client, response=response)
|
67
|
+
|
68
|
+
|
69
|
+
def sync(
|
70
|
+
*,
|
71
|
+
client: AuthenticatedClient,
|
72
|
+
) -> Optional[List["Agent"]]:
|
73
|
+
"""List all agents
|
74
|
+
|
75
|
+
Raises:
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
78
|
+
|
79
|
+
Returns:
|
80
|
+
List['Agent']
|
81
|
+
"""
|
82
|
+
|
83
|
+
return sync_detailed(
|
84
|
+
client=client,
|
85
|
+
).parsed
|
86
|
+
|
87
|
+
|
88
|
+
async def asyncio_detailed(
|
89
|
+
*,
|
90
|
+
client: AuthenticatedClient,
|
91
|
+
) -> Response[List["Agent"]]:
|
92
|
+
"""List all agents
|
93
|
+
|
94
|
+
Raises:
|
95
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
96
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
97
|
+
|
98
|
+
Returns:
|
99
|
+
Response[List['Agent']]
|
100
|
+
"""
|
101
|
+
|
102
|
+
kwargs = _get_kwargs()
|
103
|
+
|
104
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
105
|
+
|
106
|
+
return _build_response(client=client, response=response)
|
107
|
+
|
108
|
+
|
109
|
+
async def asyncio(
|
110
|
+
*,
|
111
|
+
client: AuthenticatedClient,
|
112
|
+
) -> Optional[List["Agent"]]:
|
113
|
+
"""List all agents
|
114
|
+
|
115
|
+
Raises:
|
116
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
117
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
118
|
+
|
119
|
+
Returns:
|
120
|
+
List['Agent']
|
121
|
+
"""
|
122
|
+
|
123
|
+
return (
|
124
|
+
await asyncio_detailed(
|
125
|
+
client=client,
|
126
|
+
)
|
127
|
+
).parsed
|
@@ -0,0 +1,185 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import AuthenticatedClient, Client
|
8
|
+
from ...models.agent_deployment import AgentDeployment
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
agent_name: str,
|
14
|
+
environment_name: str,
|
15
|
+
*,
|
16
|
+
body: AgentDeployment,
|
17
|
+
) -> dict[str, Any]:
|
18
|
+
headers: dict[str, Any] = {}
|
19
|
+
|
20
|
+
_kwargs: dict[str, Any] = {
|
21
|
+
"method": "put",
|
22
|
+
"url": f"/agents/{agent_name}/deployments/{environment_name}",
|
23
|
+
}
|
24
|
+
|
25
|
+
_body = body.to_dict()
|
26
|
+
|
27
|
+
_kwargs["json"] = _body
|
28
|
+
headers["Content-Type"] = "application/json"
|
29
|
+
|
30
|
+
_kwargs["headers"] = headers
|
31
|
+
return _kwargs
|
32
|
+
|
33
|
+
|
34
|
+
def _parse_response(
|
35
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
36
|
+
) -> Optional[AgentDeployment]:
|
37
|
+
if response.status_code == 200:
|
38
|
+
response_200 = AgentDeployment.from_dict(response.json())
|
39
|
+
|
40
|
+
return response_200
|
41
|
+
if client.raise_on_unexpected_status:
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
43
|
+
else:
|
44
|
+
return None
|
45
|
+
|
46
|
+
|
47
|
+
def _build_response(
|
48
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
49
|
+
) -> Response[AgentDeployment]:
|
50
|
+
return Response(
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
52
|
+
content=response.content,
|
53
|
+
headers=response.headers,
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
55
|
+
)
|
56
|
+
|
57
|
+
|
58
|
+
def sync_detailed(
|
59
|
+
agent_name: str,
|
60
|
+
environment_name: str,
|
61
|
+
*,
|
62
|
+
client: AuthenticatedClient,
|
63
|
+
body: AgentDeployment,
|
64
|
+
) -> Response[AgentDeployment]:
|
65
|
+
"""Create or update agent deployment by environment name
|
66
|
+
|
67
|
+
Args:
|
68
|
+
agent_name (str):
|
69
|
+
environment_name (str):
|
70
|
+
body (AgentDeployment): Agent deployment configuration
|
71
|
+
|
72
|
+
Raises:
|
73
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
74
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
75
|
+
|
76
|
+
Returns:
|
77
|
+
Response[AgentDeployment]
|
78
|
+
"""
|
79
|
+
|
80
|
+
kwargs = _get_kwargs(
|
81
|
+
agent_name=agent_name,
|
82
|
+
environment_name=environment_name,
|
83
|
+
body=body,
|
84
|
+
)
|
85
|
+
|
86
|
+
response = client.get_httpx_client().request(
|
87
|
+
**kwargs,
|
88
|
+
)
|
89
|
+
|
90
|
+
return _build_response(client=client, response=response)
|
91
|
+
|
92
|
+
|
93
|
+
def sync(
|
94
|
+
agent_name: str,
|
95
|
+
environment_name: str,
|
96
|
+
*,
|
97
|
+
client: AuthenticatedClient,
|
98
|
+
body: AgentDeployment,
|
99
|
+
) -> Optional[AgentDeployment]:
|
100
|
+
"""Create or update agent deployment by environment name
|
101
|
+
|
102
|
+
Args:
|
103
|
+
agent_name (str):
|
104
|
+
environment_name (str):
|
105
|
+
body (AgentDeployment): Agent deployment configuration
|
106
|
+
|
107
|
+
Raises:
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
110
|
+
|
111
|
+
Returns:
|
112
|
+
AgentDeployment
|
113
|
+
"""
|
114
|
+
|
115
|
+
return sync_detailed(
|
116
|
+
agent_name=agent_name,
|
117
|
+
environment_name=environment_name,
|
118
|
+
client=client,
|
119
|
+
body=body,
|
120
|
+
).parsed
|
121
|
+
|
122
|
+
|
123
|
+
async def asyncio_detailed(
|
124
|
+
agent_name: str,
|
125
|
+
environment_name: str,
|
126
|
+
*,
|
127
|
+
client: AuthenticatedClient,
|
128
|
+
body: AgentDeployment,
|
129
|
+
) -> Response[AgentDeployment]:
|
130
|
+
"""Create or update agent deployment by environment name
|
131
|
+
|
132
|
+
Args:
|
133
|
+
agent_name (str):
|
134
|
+
environment_name (str):
|
135
|
+
body (AgentDeployment): Agent deployment configuration
|
136
|
+
|
137
|
+
Raises:
|
138
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
139
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
140
|
+
|
141
|
+
Returns:
|
142
|
+
Response[AgentDeployment]
|
143
|
+
"""
|
144
|
+
|
145
|
+
kwargs = _get_kwargs(
|
146
|
+
agent_name=agent_name,
|
147
|
+
environment_name=environment_name,
|
148
|
+
body=body,
|
149
|
+
)
|
150
|
+
|
151
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
152
|
+
|
153
|
+
return _build_response(client=client, response=response)
|
154
|
+
|
155
|
+
|
156
|
+
async def asyncio(
|
157
|
+
agent_name: str,
|
158
|
+
environment_name: str,
|
159
|
+
*,
|
160
|
+
client: AuthenticatedClient,
|
161
|
+
body: AgentDeployment,
|
162
|
+
) -> Optional[AgentDeployment]:
|
163
|
+
"""Create or update agent deployment by environment name
|
164
|
+
|
165
|
+
Args:
|
166
|
+
agent_name (str):
|
167
|
+
environment_name (str):
|
168
|
+
body (AgentDeployment): Agent deployment configuration
|
169
|
+
|
170
|
+
Raises:
|
171
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
172
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
173
|
+
|
174
|
+
Returns:
|
175
|
+
AgentDeployment
|
176
|
+
"""
|
177
|
+
|
178
|
+
return (
|
179
|
+
await asyncio_detailed(
|
180
|
+
agent_name=agent_name,
|
181
|
+
environment_name=environment_name,
|
182
|
+
client=client,
|
183
|
+
body=body,
|
184
|
+
)
|
185
|
+
).parsed
|
@@ -0,0 +1,198 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import AuthenticatedClient, Client
|
8
|
+
from ...models.agent_deployment_history import AgentDeploymentHistory
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
agent_name: str,
|
14
|
+
environment_name: str,
|
15
|
+
request_id: str,
|
16
|
+
*,
|
17
|
+
body: AgentDeploymentHistory,
|
18
|
+
) -> dict[str, Any]:
|
19
|
+
headers: dict[str, Any] = {}
|
20
|
+
|
21
|
+
_kwargs: dict[str, Any] = {
|
22
|
+
"method": "put",
|
23
|
+
"url": f"/agents/{agent_name}/deployments/{environment_name}/history/{request_id}",
|
24
|
+
}
|
25
|
+
|
26
|
+
_body = body.to_dict()
|
27
|
+
|
28
|
+
_kwargs["json"] = _body
|
29
|
+
headers["Content-Type"] = "application/json"
|
30
|
+
|
31
|
+
_kwargs["headers"] = headers
|
32
|
+
return _kwargs
|
33
|
+
|
34
|
+
|
35
|
+
def _parse_response(
|
36
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
37
|
+
) -> Optional[AgentDeploymentHistory]:
|
38
|
+
if response.status_code == 200:
|
39
|
+
response_200 = AgentDeploymentHistory.from_dict(response.json())
|
40
|
+
|
41
|
+
return response_200
|
42
|
+
if client.raise_on_unexpected_status:
|
43
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
44
|
+
else:
|
45
|
+
return None
|
46
|
+
|
47
|
+
|
48
|
+
def _build_response(
|
49
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
50
|
+
) -> Response[AgentDeploymentHistory]:
|
51
|
+
return Response(
|
52
|
+
status_code=HTTPStatus(response.status_code),
|
53
|
+
content=response.content,
|
54
|
+
headers=response.headers,
|
55
|
+
parsed=_parse_response(client=client, response=response),
|
56
|
+
)
|
57
|
+
|
58
|
+
|
59
|
+
def sync_detailed(
|
60
|
+
agent_name: str,
|
61
|
+
environment_name: str,
|
62
|
+
request_id: str,
|
63
|
+
*,
|
64
|
+
client: AuthenticatedClient,
|
65
|
+
body: AgentDeploymentHistory,
|
66
|
+
) -> Response[AgentDeploymentHistory]:
|
67
|
+
"""Update agent's history by request ID
|
68
|
+
|
69
|
+
Args:
|
70
|
+
agent_name (str):
|
71
|
+
environment_name (str):
|
72
|
+
request_id (str):
|
73
|
+
body (AgentDeploymentHistory): Agent deployment history
|
74
|
+
|
75
|
+
Raises:
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
78
|
+
|
79
|
+
Returns:
|
80
|
+
Response[AgentDeploymentHistory]
|
81
|
+
"""
|
82
|
+
|
83
|
+
kwargs = _get_kwargs(
|
84
|
+
agent_name=agent_name,
|
85
|
+
environment_name=environment_name,
|
86
|
+
request_id=request_id,
|
87
|
+
body=body,
|
88
|
+
)
|
89
|
+
|
90
|
+
response = client.get_httpx_client().request(
|
91
|
+
**kwargs,
|
92
|
+
)
|
93
|
+
|
94
|
+
return _build_response(client=client, response=response)
|
95
|
+
|
96
|
+
|
97
|
+
def sync(
|
98
|
+
agent_name: str,
|
99
|
+
environment_name: str,
|
100
|
+
request_id: str,
|
101
|
+
*,
|
102
|
+
client: AuthenticatedClient,
|
103
|
+
body: AgentDeploymentHistory,
|
104
|
+
) -> Optional[AgentDeploymentHistory]:
|
105
|
+
"""Update agent's history by request ID
|
106
|
+
|
107
|
+
Args:
|
108
|
+
agent_name (str):
|
109
|
+
environment_name (str):
|
110
|
+
request_id (str):
|
111
|
+
body (AgentDeploymentHistory): Agent deployment history
|
112
|
+
|
113
|
+
Raises:
|
114
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
115
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
116
|
+
|
117
|
+
Returns:
|
118
|
+
AgentDeploymentHistory
|
119
|
+
"""
|
120
|
+
|
121
|
+
return sync_detailed(
|
122
|
+
agent_name=agent_name,
|
123
|
+
environment_name=environment_name,
|
124
|
+
request_id=request_id,
|
125
|
+
client=client,
|
126
|
+
body=body,
|
127
|
+
).parsed
|
128
|
+
|
129
|
+
|
130
|
+
async def asyncio_detailed(
|
131
|
+
agent_name: str,
|
132
|
+
environment_name: str,
|
133
|
+
request_id: str,
|
134
|
+
*,
|
135
|
+
client: AuthenticatedClient,
|
136
|
+
body: AgentDeploymentHistory,
|
137
|
+
) -> Response[AgentDeploymentHistory]:
|
138
|
+
"""Update agent's history by request ID
|
139
|
+
|
140
|
+
Args:
|
141
|
+
agent_name (str):
|
142
|
+
environment_name (str):
|
143
|
+
request_id (str):
|
144
|
+
body (AgentDeploymentHistory): Agent deployment history
|
145
|
+
|
146
|
+
Raises:
|
147
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
148
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
149
|
+
|
150
|
+
Returns:
|
151
|
+
Response[AgentDeploymentHistory]
|
152
|
+
"""
|
153
|
+
|
154
|
+
kwargs = _get_kwargs(
|
155
|
+
agent_name=agent_name,
|
156
|
+
environment_name=environment_name,
|
157
|
+
request_id=request_id,
|
158
|
+
body=body,
|
159
|
+
)
|
160
|
+
|
161
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
162
|
+
|
163
|
+
return _build_response(client=client, response=response)
|
164
|
+
|
165
|
+
|
166
|
+
async def asyncio(
|
167
|
+
agent_name: str,
|
168
|
+
environment_name: str,
|
169
|
+
request_id: str,
|
170
|
+
*,
|
171
|
+
client: AuthenticatedClient,
|
172
|
+
body: AgentDeploymentHistory,
|
173
|
+
) -> Optional[AgentDeploymentHistory]:
|
174
|
+
"""Update agent's history by request ID
|
175
|
+
|
176
|
+
Args:
|
177
|
+
agent_name (str):
|
178
|
+
environment_name (str):
|
179
|
+
request_id (str):
|
180
|
+
body (AgentDeploymentHistory): Agent deployment history
|
181
|
+
|
182
|
+
Raises:
|
183
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
184
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
185
|
+
|
186
|
+
Returns:
|
187
|
+
AgentDeploymentHistory
|
188
|
+
"""
|
189
|
+
|
190
|
+
return (
|
191
|
+
await asyncio_detailed(
|
192
|
+
agent_name=agent_name,
|
193
|
+
environment_name=environment_name,
|
194
|
+
request_id=request_id,
|
195
|
+
client=client,
|
196
|
+
body=body,
|
197
|
+
)
|
198
|
+
).parsed
|