beamlit 0.0.18__py3-none-any.whl → 0.0.20__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/__init__.py +4 -0
- beamlit/agents/chat.py +87 -0
- beamlit/agents/decorator.py +147 -0
- beamlit/api/agents/create_agent.py +14 -9
- beamlit/api/agents/delete_agent_history.py +159 -0
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → agents/get_agent_environment_logs.py} +30 -42
- beamlit/api/{authentication_providers/get_model_with_repo_for_authentication_provider.py → agents/get_agent_history.py} +43 -68
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +185 -0
- beamlit/api/agents/update_agent.py +14 -9
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/create_function.py +14 -9
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/functions/update_function.py +14 -9
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/create_integration_connection.py +167 -0
- beamlit/api/integrations/delete_integration_connection.py +158 -0
- beamlit/api/integrations/get_integration.py +97 -0
- beamlit/api/integrations/get_integration_connection.py +154 -0
- beamlit/api/integrations/get_integration_connection_model.py +97 -0
- beamlit/api/integrations/get_integration_model.py +97 -0
- beamlit/api/integrations/list_integration_connection_models.py +97 -0
- beamlit/api/integrations/list_integration_connections.py +139 -0
- beamlit/api/integrations/list_integration_models.py +97 -0
- beamlit/api/integrations/update_integration_connection.py +180 -0
- beamlit/api/invitations/list_all_pending_invitations.py +11 -11
- beamlit/api/locations/list_locations.py +11 -11
- beamlit/api/model_providers/list_model_providers.py +11 -11
- beamlit/api/models/get_model_deployment_logs.py +11 -11
- beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → models/get_model_environment_logs.py} +30 -38
- beamlit/api/models/list_model_deployments.py +11 -11
- beamlit/api/models/list_models.py +11 -11
- beamlit/api/policies/list_policies.py +11 -11
- beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
- beamlit/api/store/list_store_agents.py +11 -11
- beamlit/api/store/list_store_functions.py +11 -11
- beamlit/api/workspaces/list_workspace_users.py +11 -11
- beamlit/api/workspaces/list_workspaces.py +11 -11
- beamlit/authentication/__init__.py +29 -8
- beamlit/authentication/apikey.py +8 -2
- beamlit/authentication/authentication.py +66 -3
- beamlit/authentication/clientcredentials.py +108 -0
- beamlit/authentication/credentials.py +22 -8
- beamlit/authentication/device_mode.py +23 -13
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +183 -0
- beamlit/common/logger.py +29 -0
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +156 -0
- beamlit/common/utils.py +15 -0
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/functions/github/__init__.py +3 -0
- beamlit/functions/github/github.py +21 -0
- beamlit/functions/github/kit/__init__.py +7 -0
- beamlit/functions/github/kit/pull_request.py +51 -0
- beamlit/functions/math/__init__.py +3 -0
- beamlit/functions/math/math.py +40 -0
- beamlit/functions/search/__init__.py +3 -0
- beamlit/functions/search/search.py +15 -0
- beamlit/models/__init__.py +24 -0
- beamlit/models/acl.py +4 -2
- beamlit/models/agent.py +5 -3
- beamlit/models/agent_chain.py +4 -2
- beamlit/models/agent_configuration.py +4 -2
- beamlit/models/agent_deployment.py +41 -28
- beamlit/models/agent_deployment_configuration.py +4 -2
- beamlit/models/agent_deployment_configuration_type_0.py +43 -0
- beamlit/models/agent_deployment_history.py +7 -5
- beamlit/models/agent_deployment_history_event.py +11 -9
- beamlit/models/agent_deployment_pod_template.py +4 -2
- beamlit/models/agent_deployment_pod_template_type_0.py +43 -0
- beamlit/models/agent_history.py +165 -0
- beamlit/models/agent_history_event.py +131 -0
- beamlit/models/agent_metadata.py +144 -0
- beamlit/models/agent_release.py +4 -2
- beamlit/models/agent_spec.py +248 -0
- beamlit/models/agent_with_deployments.py +176 -0
- beamlit/models/api_key.py +4 -2
- beamlit/models/authentication_provider_model.py +8 -6
- beamlit/models/authentication_provider_organization.py +4 -2
- beamlit/models/configuration.py +12 -10
- beamlit/models/continent.py +4 -2
- beamlit/models/core_spec.py +185 -0
- beamlit/models/country.py +4 -2
- beamlit/models/create_api_key_for_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_response_200.py +4 -2
- beamlit/models/delete_workspace_service_account_response_200.py +4 -2
- beamlit/models/deployment_configuration.py +4 -2
- beamlit/models/deployment_configurations.py +22 -7
- beamlit/models/deployment_serverless_config.py +4 -2
- beamlit/models/deployment_serverless_config_type_0.py +220 -0
- beamlit/models/environment.py +9 -7
- beamlit/models/environment_metrics.py +26 -5
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +11 -9
- beamlit/models/function.py +5 -3
- beamlit/models/function_configuration.py +4 -2
- beamlit/models/function_deployment.py +33 -20
- beamlit/models/function_deployment_configuration.py +4 -2
- beamlit/models/function_deployment_configuration_type_0.py +43 -0
- beamlit/models/function_deployment_pod_template.py +4 -2
- beamlit/models/function_deployment_pod_template_type_0.py +43 -0
- beamlit/models/function_kit.py +7 -5
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +4 -2
- beamlit/models/function_release.py +4 -2
- beamlit/models/function_spec.py +246 -0
- beamlit/models/function_with_deployments.py +176 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +4 -2
- beamlit/models/increase_and_rate_metric.py +104 -0
- beamlit/models/integration.py +198 -0
- beamlit/models/integration_config.py +45 -0
- beamlit/models/integration_connection.py +198 -0
- beamlit/models/integration_connection_config.py +45 -0
- beamlit/models/integration_connection_secret.py +61 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +144 -0
- beamlit/models/integration_secret.py +61 -0
- beamlit/models/invite_workspace_user_body.py +4 -2
- beamlit/models/labels_type_0.py +4 -2
- beamlit/models/location.py +7 -5
- beamlit/models/location_response.py +7 -5
- beamlit/models/metadata.py +135 -0
- beamlit/models/{labels.py → metadata_labels.py} +5 -5
- beamlit/models/metric.py +4 -2
- beamlit/models/metrics.py +68 -25
- beamlit/models/model.py +5 -3
- beamlit/models/model_deployment.py +27 -14
- beamlit/models/model_deployment_log.py +4 -2
- beamlit/models/model_deployment_metrics.py +11 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/model_deployment_pod_template.py +4 -2
- beamlit/models/model_deployment_pod_template_type_0.py +43 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +8 -6
- beamlit/models/model_provider.py +13 -11
- beamlit/models/model_provider_ref.py +4 -2
- beamlit/models/model_release.py +4 -2
- beamlit/models/model_spec.py +194 -0
- beamlit/models/model_with_deployments.py +8 -6
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +4 -2
- beamlit/models/pending_invitation_accept.py +5 -3
- beamlit/models/pending_invitation_render.py +7 -5
- beamlit/models/pending_invitation_render_invited_by.py +4 -2
- beamlit/models/pending_invitation_render_workspace.py +4 -2
- beamlit/models/pending_invitation_workspace_details.py +8 -6
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +22 -20
- beamlit/models/policy_location.py +11 -9
- beamlit/models/policy_spec.py +125 -0
- beamlit/models/provider_config.py +9 -16
- beamlit/models/qps.py +4 -2
- beamlit/models/resource_deployment_log.py +4 -2
- beamlit/models/resource_deployment_metrics.py +119 -9
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_environment_metrics.py +210 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +79 -0
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_log.py +68 -0
- beamlit/models/resource_metrics.py +44 -6
- beamlit/models/runtime.py +25 -23
- beamlit/models/runtime_readiness_probe.py +4 -2
- beamlit/models/runtime_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_resources.py +4 -2
- beamlit/models/runtime_type_0.py +111 -0
- beamlit/models/runtime_type_0_readiness_probe.py +43 -0
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_type_0_resources.py +59 -0
- beamlit/models/serverless_config.py +4 -2
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +4 -2
- beamlit/models/store_agent.py +8 -6
- beamlit/models/store_agent_configuration.py +4 -2
- beamlit/models/store_agent_labels.py +4 -2
- beamlit/models/store_agent_labels_type_0.py +43 -0
- beamlit/models/store_configuration.py +18 -16
- beamlit/models/store_configuration_option.py +4 -2
- beamlit/models/store_function.py +14 -12
- beamlit/models/store_function_configuration.py +4 -2
- beamlit/models/store_function_kit.py +7 -5
- beamlit/models/store_function_labels.py +4 -2
- beamlit/models/store_function_labels_type_0.py +43 -0
- beamlit/models/store_function_parameter.py +11 -9
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +4 -2
- beamlit/models/update_workspace_service_account_response_200.py +4 -2
- beamlit/models/update_workspace_user_role_body.py +4 -2
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +5 -3
- beamlit/models/workspace_labels.py +4 -2
- beamlit/models/workspace_user.py +4 -2
- beamlit/run.py +49 -0
- beamlit/serve/app.py +78 -0
- beamlit/serve/middlewares/__init__.py +4 -0
- beamlit/serve/middlewares/accesslog.py +14 -0
- beamlit/serve/middlewares/processtime.py +12 -0
- {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/METADATA +11 -2
- beamlit-0.0.20.dist-info/RECORD +301 -0
- beamlit-0.0.18.dist-info/RECORD +0 -211
- /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
- {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,151 @@
|
|
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_history import AgentHistory
|
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}/history",
|
18
|
+
}
|
19
|
+
|
20
|
+
return _kwargs
|
21
|
+
|
22
|
+
|
23
|
+
def _parse_response(
|
24
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
25
|
+
) -> Optional[List["AgentHistory"]]:
|
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 = AgentHistory.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["AgentHistory"]]:
|
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["AgentHistory"]]:
|
57
|
+
"""
|
58
|
+
Args:
|
59
|
+
agent_name (str):
|
60
|
+
|
61
|
+
Raises:
|
62
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
63
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
64
|
+
|
65
|
+
Returns:
|
66
|
+
Response[List['AgentHistory']]
|
67
|
+
"""
|
68
|
+
|
69
|
+
kwargs = _get_kwargs(
|
70
|
+
agent_name=agent_name,
|
71
|
+
)
|
72
|
+
|
73
|
+
response = client.get_httpx_client().request(
|
74
|
+
**kwargs,
|
75
|
+
)
|
76
|
+
|
77
|
+
return _build_response(client=client, response=response)
|
78
|
+
|
79
|
+
|
80
|
+
def sync(
|
81
|
+
agent_name: str,
|
82
|
+
*,
|
83
|
+
client: AuthenticatedClient,
|
84
|
+
) -> Optional[List["AgentHistory"]]:
|
85
|
+
"""
|
86
|
+
Args:
|
87
|
+
agent_name (str):
|
88
|
+
|
89
|
+
Raises:
|
90
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
91
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
92
|
+
|
93
|
+
Returns:
|
94
|
+
List['AgentHistory']
|
95
|
+
"""
|
96
|
+
|
97
|
+
return sync_detailed(
|
98
|
+
agent_name=agent_name,
|
99
|
+
client=client,
|
100
|
+
).parsed
|
101
|
+
|
102
|
+
|
103
|
+
async def asyncio_detailed(
|
104
|
+
agent_name: str,
|
105
|
+
*,
|
106
|
+
client: AuthenticatedClient,
|
107
|
+
) -> Response[List["AgentHistory"]]:
|
108
|
+
"""
|
109
|
+
Args:
|
110
|
+
agent_name (str):
|
111
|
+
|
112
|
+
Raises:
|
113
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
114
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
115
|
+
|
116
|
+
Returns:
|
117
|
+
Response[List['AgentHistory']]
|
118
|
+
"""
|
119
|
+
|
120
|
+
kwargs = _get_kwargs(
|
121
|
+
agent_name=agent_name,
|
122
|
+
)
|
123
|
+
|
124
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
125
|
+
|
126
|
+
return _build_response(client=client, response=response)
|
127
|
+
|
128
|
+
|
129
|
+
async def asyncio(
|
130
|
+
agent_name: str,
|
131
|
+
*,
|
132
|
+
client: AuthenticatedClient,
|
133
|
+
) -> Optional[List["AgentHistory"]]:
|
134
|
+
"""
|
135
|
+
Args:
|
136
|
+
agent_name (str):
|
137
|
+
|
138
|
+
Raises:
|
139
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
140
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
141
|
+
|
142
|
+
Returns:
|
143
|
+
List['AgentHistory']
|
144
|
+
"""
|
145
|
+
|
146
|
+
return (
|
147
|
+
await asyncio_detailed(
|
148
|
+
agent_name=agent_name,
|
149
|
+
client=client,
|
150
|
+
)
|
151
|
+
).parsed
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from http import HTTPStatus
|
2
|
-
from typing import Any,
|
2
|
+
from typing import Any, Optional, Union
|
3
3
|
|
4
4
|
import httpx
|
5
5
|
|
@@ -18,7 +18,7 @@ def _get_kwargs() -> dict[str, Any]:
|
|
18
18
|
return _kwargs
|
19
19
|
|
20
20
|
|
21
|
-
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[
|
21
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list["Agent"]]:
|
22
22
|
if response.status_code == 200:
|
23
23
|
response_200 = []
|
24
24
|
_response_200 = response.json()
|
@@ -34,7 +34,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
|
|
34
34
|
return None
|
35
35
|
|
36
36
|
|
37
|
-
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[
|
37
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list["Agent"]]:
|
38
38
|
return Response(
|
39
39
|
status_code=HTTPStatus(response.status_code),
|
40
40
|
content=response.content,
|
@@ -46,7 +46,7 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt
|
|
46
46
|
def sync_detailed(
|
47
47
|
*,
|
48
48
|
client: AuthenticatedClient,
|
49
|
-
) -> Response[
|
49
|
+
) -> Response[list["Agent"]]:
|
50
50
|
"""List all agents
|
51
51
|
|
52
52
|
Raises:
|
@@ -54,7 +54,7 @@ def sync_detailed(
|
|
54
54
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
55
55
|
|
56
56
|
Returns:
|
57
|
-
Response[
|
57
|
+
Response[list['Agent']]
|
58
58
|
"""
|
59
59
|
|
60
60
|
kwargs = _get_kwargs()
|
@@ -69,7 +69,7 @@ def sync_detailed(
|
|
69
69
|
def sync(
|
70
70
|
*,
|
71
71
|
client: AuthenticatedClient,
|
72
|
-
) -> Optional[
|
72
|
+
) -> Optional[list["Agent"]]:
|
73
73
|
"""List all agents
|
74
74
|
|
75
75
|
Raises:
|
@@ -77,7 +77,7 @@ def sync(
|
|
77
77
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
78
78
|
|
79
79
|
Returns:
|
80
|
-
|
80
|
+
list['Agent']
|
81
81
|
"""
|
82
82
|
|
83
83
|
return sync_detailed(
|
@@ -88,7 +88,7 @@ def sync(
|
|
88
88
|
async def asyncio_detailed(
|
89
89
|
*,
|
90
90
|
client: AuthenticatedClient,
|
91
|
-
) -> Response[
|
91
|
+
) -> Response[list["Agent"]]:
|
92
92
|
"""List all agents
|
93
93
|
|
94
94
|
Raises:
|
@@ -96,7 +96,7 @@ async def asyncio_detailed(
|
|
96
96
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
97
97
|
|
98
98
|
Returns:
|
99
|
-
Response[
|
99
|
+
Response[list['Agent']]
|
100
100
|
"""
|
101
101
|
|
102
102
|
kwargs = _get_kwargs()
|
@@ -109,7 +109,7 @@ async def asyncio_detailed(
|
|
109
109
|
async def asyncio(
|
110
110
|
*,
|
111
111
|
client: AuthenticatedClient,
|
112
|
-
) -> Optional[
|
112
|
+
) -> Optional[list["Agent"]]:
|
113
113
|
"""List all agents
|
114
114
|
|
115
115
|
Raises:
|
@@ -117,7 +117,7 @@ async def asyncio(
|
|
117
117
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
118
118
|
|
119
119
|
Returns:
|
120
|
-
|
120
|
+
list['Agent']
|
121
121
|
"""
|
122
122
|
|
123
123
|
return (
|
@@ -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_history import AgentHistory
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
agent_name: str,
|
14
|
+
request_id: str,
|
15
|
+
*,
|
16
|
+
body: AgentHistory,
|
17
|
+
) -> dict[str, Any]:
|
18
|
+
headers: dict[str, Any] = {}
|
19
|
+
|
20
|
+
_kwargs: dict[str, Any] = {
|
21
|
+
"method": "put",
|
22
|
+
"url": f"/agents/{agent_name}/history/{request_id}",
|
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[AgentHistory]:
|
37
|
+
if response.status_code == 200:
|
38
|
+
response_200 = AgentHistory.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[AgentHistory]:
|
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
|
+
request_id: str,
|
61
|
+
*,
|
62
|
+
client: AuthenticatedClient,
|
63
|
+
body: AgentHistory,
|
64
|
+
) -> Response[AgentHistory]:
|
65
|
+
"""Update agent's history by request ID
|
66
|
+
|
67
|
+
Args:
|
68
|
+
agent_name (str):
|
69
|
+
request_id (str):
|
70
|
+
body (AgentHistory): Agent deployment history
|
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[AgentHistory]
|
78
|
+
"""
|
79
|
+
|
80
|
+
kwargs = _get_kwargs(
|
81
|
+
agent_name=agent_name,
|
82
|
+
request_id=request_id,
|
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
|
+
request_id: str,
|
96
|
+
*,
|
97
|
+
client: AuthenticatedClient,
|
98
|
+
body: AgentHistory,
|
99
|
+
) -> Optional[AgentHistory]:
|
100
|
+
"""Update agent's history by request ID
|
101
|
+
|
102
|
+
Args:
|
103
|
+
agent_name (str):
|
104
|
+
request_id (str):
|
105
|
+
body (AgentHistory): Agent deployment history
|
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
|
+
AgentHistory
|
113
|
+
"""
|
114
|
+
|
115
|
+
return sync_detailed(
|
116
|
+
agent_name=agent_name,
|
117
|
+
request_id=request_id,
|
118
|
+
client=client,
|
119
|
+
body=body,
|
120
|
+
).parsed
|
121
|
+
|
122
|
+
|
123
|
+
async def asyncio_detailed(
|
124
|
+
agent_name: str,
|
125
|
+
request_id: str,
|
126
|
+
*,
|
127
|
+
client: AuthenticatedClient,
|
128
|
+
body: AgentHistory,
|
129
|
+
) -> Response[AgentHistory]:
|
130
|
+
"""Update agent's history by request ID
|
131
|
+
|
132
|
+
Args:
|
133
|
+
agent_name (str):
|
134
|
+
request_id (str):
|
135
|
+
body (AgentHistory): Agent deployment history
|
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[AgentHistory]
|
143
|
+
"""
|
144
|
+
|
145
|
+
kwargs = _get_kwargs(
|
146
|
+
agent_name=agent_name,
|
147
|
+
request_id=request_id,
|
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
|
+
request_id: str,
|
159
|
+
*,
|
160
|
+
client: AuthenticatedClient,
|
161
|
+
body: AgentHistory,
|
162
|
+
) -> Optional[AgentHistory]:
|
163
|
+
"""Update agent's history by request ID
|
164
|
+
|
165
|
+
Args:
|
166
|
+
agent_name (str):
|
167
|
+
request_id (str):
|
168
|
+
body (AgentHistory): Agent deployment history
|
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
|
+
AgentHistory
|
176
|
+
"""
|
177
|
+
|
178
|
+
return (
|
179
|
+
await asyncio_detailed(
|
180
|
+
agent_name=agent_name,
|
181
|
+
request_id=request_id,
|
182
|
+
client=client,
|
183
|
+
body=body,
|
184
|
+
)
|
185
|
+
).parsed
|
@@ -6,13 +6,14 @@ import httpx
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import AuthenticatedClient, Client
|
8
8
|
from ...models.agent import Agent
|
9
|
+
from ...models.agent_with_deployments import AgentWithDeployments
|
9
10
|
from ...types import Response
|
10
11
|
|
11
12
|
|
12
13
|
def _get_kwargs(
|
13
14
|
agent_name: str,
|
14
15
|
*,
|
15
|
-
body:
|
16
|
+
body: AgentWithDeployments,
|
16
17
|
) -> dict[str, Any]:
|
17
18
|
headers: dict[str, Any] = {}
|
18
19
|
|
@@ -54,13 +55,14 @@ def sync_detailed(
|
|
54
55
|
agent_name: str,
|
55
56
|
*,
|
56
57
|
client: AuthenticatedClient,
|
57
|
-
body:
|
58
|
+
body: AgentWithDeployments,
|
58
59
|
) -> Response[Agent]:
|
59
60
|
"""Update agent by name
|
60
61
|
|
61
62
|
Args:
|
62
63
|
agent_name (str):
|
63
|
-
body (
|
64
|
+
body (AgentWithDeployments): Logical object representing an agent but with deployment
|
65
|
+
definition inside
|
64
66
|
|
65
67
|
Raises:
|
66
68
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -86,13 +88,14 @@ def sync(
|
|
86
88
|
agent_name: str,
|
87
89
|
*,
|
88
90
|
client: AuthenticatedClient,
|
89
|
-
body:
|
91
|
+
body: AgentWithDeployments,
|
90
92
|
) -> Optional[Agent]:
|
91
93
|
"""Update agent by name
|
92
94
|
|
93
95
|
Args:
|
94
96
|
agent_name (str):
|
95
|
-
body (
|
97
|
+
body (AgentWithDeployments): Logical object representing an agent but with deployment
|
98
|
+
definition inside
|
96
99
|
|
97
100
|
Raises:
|
98
101
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -113,13 +116,14 @@ async def asyncio_detailed(
|
|
113
116
|
agent_name: str,
|
114
117
|
*,
|
115
118
|
client: AuthenticatedClient,
|
116
|
-
body:
|
119
|
+
body: AgentWithDeployments,
|
117
120
|
) -> Response[Agent]:
|
118
121
|
"""Update agent by name
|
119
122
|
|
120
123
|
Args:
|
121
124
|
agent_name (str):
|
122
|
-
body (
|
125
|
+
body (AgentWithDeployments): Logical object representing an agent but with deployment
|
126
|
+
definition inside
|
123
127
|
|
124
128
|
Raises:
|
125
129
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -143,13 +147,14 @@ async def asyncio(
|
|
143
147
|
agent_name: str,
|
144
148
|
*,
|
145
149
|
client: AuthenticatedClient,
|
146
|
-
body:
|
150
|
+
body: AgentWithDeployments,
|
147
151
|
) -> Optional[Agent]:
|
148
152
|
"""Update agent by name
|
149
153
|
|
150
154
|
Args:
|
151
155
|
agent_name (str):
|
152
|
-
body (
|
156
|
+
body (AgentWithDeployments): Logical object representing an agent but with deployment
|
157
|
+
definition inside
|
153
158
|
|
154
159
|
Raises:
|
155
160
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from http import HTTPStatus
|
2
|
-
from typing import Any,
|
2
|
+
from typing import Any, Optional, Union
|
3
3
|
|
4
4
|
import httpx
|
5
5
|
|
@@ -20,7 +20,7 @@ def _get_kwargs() -> dict[str, Any]:
|
|
20
20
|
|
21
21
|
def _parse_response(
|
22
22
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
23
|
-
) -> Optional[
|
23
|
+
) -> Optional[list["Environment"]]:
|
24
24
|
if response.status_code == 200:
|
25
25
|
response_200 = []
|
26
26
|
_response_200 = response.json()
|
@@ -38,7 +38,7 @@ def _parse_response(
|
|
38
38
|
|
39
39
|
def _build_response(
|
40
40
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
41
|
-
) -> Response[
|
41
|
+
) -> Response[list["Environment"]]:
|
42
42
|
return Response(
|
43
43
|
status_code=HTTPStatus(response.status_code),
|
44
44
|
content=response.content,
|
@@ -50,7 +50,7 @@ def _build_response(
|
|
50
50
|
def sync_detailed(
|
51
51
|
*,
|
52
52
|
client: AuthenticatedClient,
|
53
|
-
) -> Response[
|
53
|
+
) -> Response[list["Environment"]]:
|
54
54
|
"""List environments
|
55
55
|
|
56
56
|
Returns a list of all environments in the workspace.
|
@@ -60,7 +60,7 @@ def sync_detailed(
|
|
60
60
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
61
61
|
|
62
62
|
Returns:
|
63
|
-
Response[
|
63
|
+
Response[list['Environment']]
|
64
64
|
"""
|
65
65
|
|
66
66
|
kwargs = _get_kwargs()
|
@@ -75,7 +75,7 @@ def sync_detailed(
|
|
75
75
|
def sync(
|
76
76
|
*,
|
77
77
|
client: AuthenticatedClient,
|
78
|
-
) -> Optional[
|
78
|
+
) -> Optional[list["Environment"]]:
|
79
79
|
"""List environments
|
80
80
|
|
81
81
|
Returns a list of all environments in the workspace.
|
@@ -85,7 +85,7 @@ def sync(
|
|
85
85
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
86
86
|
|
87
87
|
Returns:
|
88
|
-
|
88
|
+
list['Environment']
|
89
89
|
"""
|
90
90
|
|
91
91
|
return sync_detailed(
|
@@ -96,7 +96,7 @@ def sync(
|
|
96
96
|
async def asyncio_detailed(
|
97
97
|
*,
|
98
98
|
client: AuthenticatedClient,
|
99
|
-
) -> Response[
|
99
|
+
) -> Response[list["Environment"]]:
|
100
100
|
"""List environments
|
101
101
|
|
102
102
|
Returns a list of all environments in the workspace.
|
@@ -106,7 +106,7 @@ async def asyncio_detailed(
|
|
106
106
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
107
107
|
|
108
108
|
Returns:
|
109
|
-
Response[
|
109
|
+
Response[list['Environment']]
|
110
110
|
"""
|
111
111
|
|
112
112
|
kwargs = _get_kwargs()
|
@@ -119,7 +119,7 @@ async def asyncio_detailed(
|
|
119
119
|
async def asyncio(
|
120
120
|
*,
|
121
121
|
client: AuthenticatedClient,
|
122
|
-
) -> Optional[
|
122
|
+
) -> Optional[list["Environment"]]:
|
123
123
|
"""List environments
|
124
124
|
|
125
125
|
Returns a list of all environments in the workspace.
|
@@ -129,7 +129,7 @@ async def asyncio(
|
|
129
129
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
130
130
|
|
131
131
|
Returns:
|
132
|
-
|
132
|
+
list['Environment']
|
133
133
|
"""
|
134
134
|
|
135
135
|
return (
|
@@ -6,12 +6,13 @@ import httpx
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import AuthenticatedClient, Client
|
8
8
|
from ...models.function import Function
|
9
|
+
from ...models.function_with_deployments import FunctionWithDeployments
|
9
10
|
from ...types import Response
|
10
11
|
|
11
12
|
|
12
13
|
def _get_kwargs(
|
13
14
|
*,
|
14
|
-
body:
|
15
|
+
body: FunctionWithDeployments,
|
15
16
|
) -> dict[str, Any]:
|
16
17
|
headers: dict[str, Any] = {}
|
17
18
|
|
@@ -52,12 +53,13 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt
|
|
52
53
|
def sync_detailed(
|
53
54
|
*,
|
54
55
|
client: AuthenticatedClient,
|
55
|
-
body:
|
56
|
+
body: FunctionWithDeployments,
|
56
57
|
) -> Response[Function]:
|
57
58
|
"""Create function
|
58
59
|
|
59
60
|
Args:
|
60
|
-
body (
|
61
|
+
body (FunctionWithDeployments): Logical object representing a function but with deployment
|
62
|
+
definition inside
|
61
63
|
|
62
64
|
Raises:
|
63
65
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -81,12 +83,13 @@ def sync_detailed(
|
|
81
83
|
def sync(
|
82
84
|
*,
|
83
85
|
client: AuthenticatedClient,
|
84
|
-
body:
|
86
|
+
body: FunctionWithDeployments,
|
85
87
|
) -> Optional[Function]:
|
86
88
|
"""Create function
|
87
89
|
|
88
90
|
Args:
|
89
|
-
body (
|
91
|
+
body (FunctionWithDeployments): Logical object representing a function but with deployment
|
92
|
+
definition inside
|
90
93
|
|
91
94
|
Raises:
|
92
95
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -105,12 +108,13 @@ def sync(
|
|
105
108
|
async def asyncio_detailed(
|
106
109
|
*,
|
107
110
|
client: AuthenticatedClient,
|
108
|
-
body:
|
111
|
+
body: FunctionWithDeployments,
|
109
112
|
) -> Response[Function]:
|
110
113
|
"""Create function
|
111
114
|
|
112
115
|
Args:
|
113
|
-
body (
|
116
|
+
body (FunctionWithDeployments): Logical object representing a function but with deployment
|
117
|
+
definition inside
|
114
118
|
|
115
119
|
Raises:
|
116
120
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -132,12 +136,13 @@ async def asyncio_detailed(
|
|
132
136
|
async def asyncio(
|
133
137
|
*,
|
134
138
|
client: AuthenticatedClient,
|
135
|
-
body:
|
139
|
+
body: FunctionWithDeployments,
|
136
140
|
) -> Optional[Function]:
|
137
141
|
"""Create function
|
138
142
|
|
139
143
|
Args:
|
140
|
-
body (
|
144
|
+
body (FunctionWithDeployments): Logical object representing a function but with deployment
|
145
|
+
definition inside
|
141
146
|
|
142
147
|
Raises:
|
143
148
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|