beamlit 0.0.19__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.19.dist-info → beamlit-0.0.20.dist-info}/METADATA +11 -2
- beamlit-0.0.20.dist-info/RECORD +301 -0
- beamlit-0.0.19.dist-info/RECORD +0 -211
- /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
- {beamlit-0.0.19.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,131 @@
|
|
1
|
+
from typing import Any, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="AgentHistoryEvent")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class AgentHistoryEvent:
|
13
|
+
"""Agent deployment history event
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
end (Union[Unset, str]): End time
|
17
|
+
error (Union[Unset, str]): Error message
|
18
|
+
name (Union[Unset, str]): Name of the function or agent
|
19
|
+
parameters (Union[Unset, str]): Parameters
|
20
|
+
start (Union[Unset, str]): Start time
|
21
|
+
status (Union[Unset, str]): Status, eg: running, success, failed
|
22
|
+
sub_function (Union[Unset, str]): Function used in kit if a kit was used
|
23
|
+
took (Union[Unset, int]): Number of milliseconds it took to complete the event
|
24
|
+
type (Union[Unset, str]): Type, one of function or agent
|
25
|
+
"""
|
26
|
+
|
27
|
+
end: Union[Unset, str] = UNSET
|
28
|
+
error: Union[Unset, str] = UNSET
|
29
|
+
name: Union[Unset, str] = UNSET
|
30
|
+
parameters: Union[Unset, str] = UNSET
|
31
|
+
start: Union[Unset, str] = UNSET
|
32
|
+
status: Union[Unset, str] = UNSET
|
33
|
+
sub_function: Union[Unset, str] = UNSET
|
34
|
+
took: Union[Unset, int] = UNSET
|
35
|
+
type: Union[Unset, str] = UNSET
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
37
|
+
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
39
|
+
end = self.end
|
40
|
+
|
41
|
+
error = self.error
|
42
|
+
|
43
|
+
name = self.name
|
44
|
+
|
45
|
+
parameters = self.parameters
|
46
|
+
|
47
|
+
start = self.start
|
48
|
+
|
49
|
+
status = self.status
|
50
|
+
|
51
|
+
sub_function = self.sub_function
|
52
|
+
|
53
|
+
took = self.took
|
54
|
+
|
55
|
+
type = self.type
|
56
|
+
|
57
|
+
field_dict: dict[str, Any] = {}
|
58
|
+
field_dict.update(self.additional_properties)
|
59
|
+
field_dict.update({})
|
60
|
+
if end is not UNSET:
|
61
|
+
field_dict["end"] = end
|
62
|
+
if error is not UNSET:
|
63
|
+
field_dict["error"] = error
|
64
|
+
if name is not UNSET:
|
65
|
+
field_dict["name"] = name
|
66
|
+
if parameters is not UNSET:
|
67
|
+
field_dict["parameters"] = parameters
|
68
|
+
if start is not UNSET:
|
69
|
+
field_dict["start"] = start
|
70
|
+
if status is not UNSET:
|
71
|
+
field_dict["status"] = status
|
72
|
+
if sub_function is not UNSET:
|
73
|
+
field_dict["sub_function"] = sub_function
|
74
|
+
if took is not UNSET:
|
75
|
+
field_dict["took"] = took
|
76
|
+
if type is not UNSET:
|
77
|
+
field_dict["type"] = type
|
78
|
+
|
79
|
+
return field_dict
|
80
|
+
|
81
|
+
@classmethod
|
82
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
83
|
+
d = src_dict.copy()
|
84
|
+
end = d.pop("end", UNSET)
|
85
|
+
|
86
|
+
error = d.pop("error", UNSET)
|
87
|
+
|
88
|
+
name = d.pop("name", UNSET)
|
89
|
+
|
90
|
+
parameters = d.pop("parameters", UNSET)
|
91
|
+
|
92
|
+
start = d.pop("start", UNSET)
|
93
|
+
|
94
|
+
status = d.pop("status", UNSET)
|
95
|
+
|
96
|
+
sub_function = d.pop("sub_function", UNSET)
|
97
|
+
|
98
|
+
took = d.pop("took", UNSET)
|
99
|
+
|
100
|
+
type = d.pop("type", UNSET)
|
101
|
+
|
102
|
+
agent_history_event = cls(
|
103
|
+
end=end,
|
104
|
+
error=error,
|
105
|
+
name=name,
|
106
|
+
parameters=parameters,
|
107
|
+
start=start,
|
108
|
+
status=status,
|
109
|
+
sub_function=sub_function,
|
110
|
+
took=took,
|
111
|
+
type=type,
|
112
|
+
)
|
113
|
+
|
114
|
+
agent_history_event.additional_properties = d
|
115
|
+
return agent_history_event
|
116
|
+
|
117
|
+
@property
|
118
|
+
def additional_keys(self) -> list[str]:
|
119
|
+
return list(self.additional_properties.keys())
|
120
|
+
|
121
|
+
def __getitem__(self, key: str) -> Any:
|
122
|
+
return self.additional_properties[key]
|
123
|
+
|
124
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
125
|
+
self.additional_properties[key] = value
|
126
|
+
|
127
|
+
def __delitem__(self, key: str) -> None:
|
128
|
+
del self.additional_properties[key]
|
129
|
+
|
130
|
+
def __contains__(self, key: str) -> bool:
|
131
|
+
return key in self.additional_properties
|
@@ -0,0 +1,144 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.metadata_labels import MetadataLabels
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="AgentMetadata")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class AgentMetadata:
|
17
|
+
"""Agent metadata
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
21
|
+
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
22
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
23
|
+
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
24
|
+
display_name (Union[Unset, str]): Model display name
|
25
|
+
labels (Union[Unset, MetadataLabels]): Labels
|
26
|
+
name (Union[Unset, str]): Model name
|
27
|
+
workspace (Union[Unset, str]): Workspace name
|
28
|
+
environment (Union[Unset, str]): Environment name
|
29
|
+
"""
|
30
|
+
|
31
|
+
created_at: Union[Unset, str] = UNSET
|
32
|
+
updated_at: Union[Unset, str] = UNSET
|
33
|
+
created_by: Union[Unset, str] = UNSET
|
34
|
+
updated_by: Union[Unset, str] = UNSET
|
35
|
+
display_name: Union[Unset, str] = UNSET
|
36
|
+
labels: Union[Unset, "MetadataLabels"] = UNSET
|
37
|
+
name: Union[Unset, str] = UNSET
|
38
|
+
workspace: Union[Unset, str] = UNSET
|
39
|
+
environment: Union[Unset, str] = UNSET
|
40
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
41
|
+
|
42
|
+
def to_dict(self) -> dict[str, Any]:
|
43
|
+
created_at = self.created_at
|
44
|
+
|
45
|
+
updated_at = self.updated_at
|
46
|
+
|
47
|
+
created_by = self.created_by
|
48
|
+
|
49
|
+
updated_by = self.updated_by
|
50
|
+
|
51
|
+
display_name = self.display_name
|
52
|
+
|
53
|
+
labels: Union[Unset, Dict[str, Any]] = UNSET
|
54
|
+
if not isinstance(self.labels, Unset):
|
55
|
+
labels = self.labels.to_dict()
|
56
|
+
|
57
|
+
name = self.name
|
58
|
+
|
59
|
+
workspace = self.workspace
|
60
|
+
|
61
|
+
environment = self.environment
|
62
|
+
|
63
|
+
field_dict: dict[str, Any] = {}
|
64
|
+
field_dict.update(self.additional_properties)
|
65
|
+
field_dict.update({})
|
66
|
+
if created_at is not UNSET:
|
67
|
+
field_dict["createdAt"] = created_at
|
68
|
+
if updated_at is not UNSET:
|
69
|
+
field_dict["updatedAt"] = updated_at
|
70
|
+
if created_by is not UNSET:
|
71
|
+
field_dict["createdBy"] = created_by
|
72
|
+
if updated_by is not UNSET:
|
73
|
+
field_dict["updatedBy"] = updated_by
|
74
|
+
if display_name is not UNSET:
|
75
|
+
field_dict["displayName"] = display_name
|
76
|
+
if labels is not UNSET:
|
77
|
+
field_dict["labels"] = labels
|
78
|
+
if name is not UNSET:
|
79
|
+
field_dict["name"] = name
|
80
|
+
if workspace is not UNSET:
|
81
|
+
field_dict["workspace"] = workspace
|
82
|
+
if environment is not UNSET:
|
83
|
+
field_dict["environment"] = environment
|
84
|
+
|
85
|
+
return field_dict
|
86
|
+
|
87
|
+
@classmethod
|
88
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
89
|
+
from ..models.metadata_labels import MetadataLabels
|
90
|
+
|
91
|
+
d = src_dict.copy()
|
92
|
+
created_at = d.pop("createdAt", UNSET)
|
93
|
+
|
94
|
+
updated_at = d.pop("updatedAt", UNSET)
|
95
|
+
|
96
|
+
created_by = d.pop("createdBy", UNSET)
|
97
|
+
|
98
|
+
updated_by = d.pop("updatedBy", UNSET)
|
99
|
+
|
100
|
+
display_name = d.pop("displayName", UNSET)
|
101
|
+
|
102
|
+
_labels = d.pop("labels", UNSET)
|
103
|
+
labels: Union[Unset, MetadataLabels]
|
104
|
+
if isinstance(_labels, Unset):
|
105
|
+
labels = UNSET
|
106
|
+
else:
|
107
|
+
labels = MetadataLabels.from_dict(_labels)
|
108
|
+
|
109
|
+
name = d.pop("name", UNSET)
|
110
|
+
|
111
|
+
workspace = d.pop("workspace", UNSET)
|
112
|
+
|
113
|
+
environment = d.pop("environment", UNSET)
|
114
|
+
|
115
|
+
agent_metadata = cls(
|
116
|
+
created_at=created_at,
|
117
|
+
updated_at=updated_at,
|
118
|
+
created_by=created_by,
|
119
|
+
updated_by=updated_by,
|
120
|
+
display_name=display_name,
|
121
|
+
labels=labels,
|
122
|
+
name=name,
|
123
|
+
workspace=workspace,
|
124
|
+
environment=environment,
|
125
|
+
)
|
126
|
+
|
127
|
+
agent_metadata.additional_properties = d
|
128
|
+
return agent_metadata
|
129
|
+
|
130
|
+
@property
|
131
|
+
def additional_keys(self) -> list[str]:
|
132
|
+
return list(self.additional_properties.keys())
|
133
|
+
|
134
|
+
def __getitem__(self, key: str) -> Any:
|
135
|
+
return self.additional_properties[key]
|
136
|
+
|
137
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
138
|
+
self.additional_properties[key] = value
|
139
|
+
|
140
|
+
def __delitem__(self, key: str) -> None:
|
141
|
+
del self.additional_properties[key]
|
142
|
+
|
143
|
+
def __contains__(self, key: str) -> bool:
|
144
|
+
return key in self.additional_properties
|
beamlit/models/agent_release.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -37,7 +37,9 @@ class AgentRelease:
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
41
43
|
d = src_dict.copy()
|
42
44
|
from_ = d.pop("from", UNSET)
|
43
45
|
|
@@ -0,0 +1,248 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.agent_chain import AgentChain
|
10
|
+
from ..models.flavor import Flavor
|
11
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
12
|
+
from ..models.runtime import Runtime
|
13
|
+
from ..models.serverless_config import ServerlessConfig
|
14
|
+
from ..models.spec_configuration import SpecConfiguration
|
15
|
+
|
16
|
+
|
17
|
+
T = TypeVar("T", bound="AgentSpec")
|
18
|
+
|
19
|
+
|
20
|
+
@_attrs_define
|
21
|
+
class AgentSpec:
|
22
|
+
"""Agent specification
|
23
|
+
|
24
|
+
Attributes:
|
25
|
+
configurations (Union[Unset, SpecConfiguration]): Agent configuration, this is a key value storage. In your
|
26
|
+
agent you can retrieve the value with config[key]
|
27
|
+
enabled (Union[Unset, bool]): Enable or disable the agent
|
28
|
+
flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
|
29
|
+
integration_connections (Union[Unset, List[str]]):
|
30
|
+
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
31
|
+
policies (Union[Unset, List[str]]):
|
32
|
+
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
33
|
+
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
34
|
+
agent_chain (Union[Unset, List['AgentChain']]): Agent chain
|
35
|
+
description (Union[Unset, str]): Agent description
|
36
|
+
functions (Union[Unset, List[str]]):
|
37
|
+
model (Union[Unset, str]): Model name
|
38
|
+
store_id (Union[Unset, str]): Store id
|
39
|
+
"""
|
40
|
+
|
41
|
+
configurations: Union[Unset, "SpecConfiguration"] = UNSET
|
42
|
+
enabled: Union[Unset, bool] = UNSET
|
43
|
+
flavors: Union[Unset, List["Flavor"]] = UNSET
|
44
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
45
|
+
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
46
|
+
policies: Union[Unset, List[str]] = UNSET
|
47
|
+
runtime: Union[Unset, "Runtime"] = UNSET
|
48
|
+
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
49
|
+
agent_chain: Union[Unset, List["AgentChain"]] = UNSET
|
50
|
+
description: Union[Unset, str] = UNSET
|
51
|
+
functions: Union[Unset, List[str]] = UNSET
|
52
|
+
model: Union[Unset, str] = UNSET
|
53
|
+
store_id: Union[Unset, str] = UNSET
|
54
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
55
|
+
|
56
|
+
def to_dict(self) -> dict[str, Any]:
|
57
|
+
configurations: Union[Unset, Dict[str, Any]] = UNSET
|
58
|
+
if not isinstance(self.configurations, Unset):
|
59
|
+
configurations = self.configurations.to_dict()
|
60
|
+
|
61
|
+
enabled = self.enabled
|
62
|
+
|
63
|
+
flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
|
64
|
+
if not isinstance(self.flavors, Unset):
|
65
|
+
flavors = []
|
66
|
+
for componentsschemas_flavors_item_data in self.flavors:
|
67
|
+
componentsschemas_flavors_item = (
|
68
|
+
componentsschemas_flavors_item_data.to_dict()
|
69
|
+
)
|
70
|
+
flavors.append(componentsschemas_flavors_item)
|
71
|
+
|
72
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
73
|
+
if not isinstance(self.integration_connections, Unset):
|
74
|
+
integration_connections = self.integration_connections
|
75
|
+
|
76
|
+
pod_template: Union[Unset, Dict[str, Any]] = UNSET
|
77
|
+
if not isinstance(self.pod_template, Unset):
|
78
|
+
pod_template = self.pod_template.to_dict()
|
79
|
+
|
80
|
+
policies: Union[Unset, List[str]] = UNSET
|
81
|
+
if not isinstance(self.policies, Unset):
|
82
|
+
policies = self.policies
|
83
|
+
|
84
|
+
runtime: Union[Unset, Dict[str, Any]] = UNSET
|
85
|
+
if not isinstance(self.runtime, Unset):
|
86
|
+
runtime = self.runtime.to_dict()
|
87
|
+
|
88
|
+
serverless_config: Union[Unset, Dict[str, Any]] = UNSET
|
89
|
+
if not isinstance(self.serverless_config, Unset):
|
90
|
+
serverless_config = self.serverless_config.to_dict()
|
91
|
+
|
92
|
+
agent_chain: Union[Unset, List[Dict[str, Any]]] = UNSET
|
93
|
+
if not isinstance(self.agent_chain, Unset):
|
94
|
+
agent_chain = []
|
95
|
+
for componentsschemas_agent_chains_item_data in self.agent_chain:
|
96
|
+
componentsschemas_agent_chains_item = (
|
97
|
+
componentsschemas_agent_chains_item_data.to_dict()
|
98
|
+
)
|
99
|
+
agent_chain.append(componentsschemas_agent_chains_item)
|
100
|
+
|
101
|
+
description = self.description
|
102
|
+
|
103
|
+
functions: Union[Unset, List[str]] = UNSET
|
104
|
+
if not isinstance(self.functions, Unset):
|
105
|
+
functions = self.functions
|
106
|
+
|
107
|
+
model = self.model
|
108
|
+
|
109
|
+
store_id = self.store_id
|
110
|
+
|
111
|
+
field_dict: dict[str, Any] = {}
|
112
|
+
field_dict.update(self.additional_properties)
|
113
|
+
field_dict.update({})
|
114
|
+
if configurations is not UNSET:
|
115
|
+
field_dict["configurations"] = configurations
|
116
|
+
if enabled is not UNSET:
|
117
|
+
field_dict["enabled"] = enabled
|
118
|
+
if flavors is not UNSET:
|
119
|
+
field_dict["flavors"] = flavors
|
120
|
+
if integration_connections is not UNSET:
|
121
|
+
field_dict["integrationConnections"] = integration_connections
|
122
|
+
if pod_template is not UNSET:
|
123
|
+
field_dict["podTemplate"] = pod_template
|
124
|
+
if policies is not UNSET:
|
125
|
+
field_dict["policies"] = policies
|
126
|
+
if runtime is not UNSET:
|
127
|
+
field_dict["runtime"] = runtime
|
128
|
+
if serverless_config is not UNSET:
|
129
|
+
field_dict["serverlessConfig"] = serverless_config
|
130
|
+
if agent_chain is not UNSET:
|
131
|
+
field_dict["agentChain"] = agent_chain
|
132
|
+
if description is not UNSET:
|
133
|
+
field_dict["description"] = description
|
134
|
+
if functions is not UNSET:
|
135
|
+
field_dict["functions"] = functions
|
136
|
+
if model is not UNSET:
|
137
|
+
field_dict["model"] = model
|
138
|
+
if store_id is not UNSET:
|
139
|
+
field_dict["storeId"] = store_id
|
140
|
+
|
141
|
+
return field_dict
|
142
|
+
|
143
|
+
@classmethod
|
144
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
145
|
+
from ..models.agent_chain import AgentChain
|
146
|
+
from ..models.flavor import Flavor
|
147
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
148
|
+
from ..models.runtime import Runtime
|
149
|
+
from ..models.serverless_config import ServerlessConfig
|
150
|
+
from ..models.spec_configuration import SpecConfiguration
|
151
|
+
|
152
|
+
d = src_dict.copy()
|
153
|
+
_configurations = d.pop("configurations", UNSET)
|
154
|
+
configurations: Union[Unset, SpecConfiguration]
|
155
|
+
if isinstance(_configurations, Unset):
|
156
|
+
configurations = UNSET
|
157
|
+
else:
|
158
|
+
configurations = SpecConfiguration.from_dict(_configurations)
|
159
|
+
|
160
|
+
enabled = d.pop("enabled", UNSET)
|
161
|
+
|
162
|
+
flavors = []
|
163
|
+
_flavors = d.pop("flavors", UNSET)
|
164
|
+
for componentsschemas_flavors_item_data in _flavors or []:
|
165
|
+
componentsschemas_flavors_item = Flavor.from_dict(
|
166
|
+
componentsschemas_flavors_item_data
|
167
|
+
)
|
168
|
+
|
169
|
+
flavors.append(componentsschemas_flavors_item)
|
170
|
+
|
171
|
+
integration_connections = cast(
|
172
|
+
List[str], d.pop("integrationConnections", UNSET)
|
173
|
+
)
|
174
|
+
|
175
|
+
_pod_template = d.pop("podTemplate", UNSET)
|
176
|
+
pod_template: Union[Unset, PodTemplateSpec]
|
177
|
+
if isinstance(_pod_template, Unset):
|
178
|
+
pod_template = UNSET
|
179
|
+
else:
|
180
|
+
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
181
|
+
|
182
|
+
policies = cast(List[str], d.pop("policies", UNSET))
|
183
|
+
|
184
|
+
_runtime = d.pop("runtime", UNSET)
|
185
|
+
runtime: Union[Unset, Runtime]
|
186
|
+
if isinstance(_runtime, Unset):
|
187
|
+
runtime = UNSET
|
188
|
+
else:
|
189
|
+
runtime = Runtime.from_dict(_runtime)
|
190
|
+
|
191
|
+
_serverless_config = d.pop("serverlessConfig", UNSET)
|
192
|
+
serverless_config: Union[Unset, ServerlessConfig]
|
193
|
+
if isinstance(_serverless_config, Unset):
|
194
|
+
serverless_config = UNSET
|
195
|
+
else:
|
196
|
+
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
197
|
+
|
198
|
+
agent_chain = []
|
199
|
+
_agent_chain = d.pop("agentChain", UNSET)
|
200
|
+
for componentsschemas_agent_chains_item_data in _agent_chain or []:
|
201
|
+
componentsschemas_agent_chains_item = AgentChain.from_dict(
|
202
|
+
componentsschemas_agent_chains_item_data
|
203
|
+
)
|
204
|
+
|
205
|
+
agent_chain.append(componentsschemas_agent_chains_item)
|
206
|
+
|
207
|
+
description = d.pop("description", UNSET)
|
208
|
+
|
209
|
+
functions = cast(List[str], d.pop("functions", UNSET))
|
210
|
+
|
211
|
+
model = d.pop("model", UNSET)
|
212
|
+
|
213
|
+
store_id = d.pop("storeId", UNSET)
|
214
|
+
|
215
|
+
agent_spec = cls(
|
216
|
+
configurations=configurations,
|
217
|
+
enabled=enabled,
|
218
|
+
flavors=flavors,
|
219
|
+
integration_connections=integration_connections,
|
220
|
+
pod_template=pod_template,
|
221
|
+
policies=policies,
|
222
|
+
runtime=runtime,
|
223
|
+
serverless_config=serverless_config,
|
224
|
+
agent_chain=agent_chain,
|
225
|
+
description=description,
|
226
|
+
functions=functions,
|
227
|
+
model=model,
|
228
|
+
store_id=store_id,
|
229
|
+
)
|
230
|
+
|
231
|
+
agent_spec.additional_properties = d
|
232
|
+
return agent_spec
|
233
|
+
|
234
|
+
@property
|
235
|
+
def additional_keys(self) -> list[str]:
|
236
|
+
return list(self.additional_properties.keys())
|
237
|
+
|
238
|
+
def __getitem__(self, key: str) -> Any:
|
239
|
+
return self.additional_properties[key]
|
240
|
+
|
241
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
242
|
+
self.additional_properties[key] = value
|
243
|
+
|
244
|
+
def __delitem__(self, key: str) -> None:
|
245
|
+
del self.additional_properties[key]
|
246
|
+
|
247
|
+
def __contains__(self, key: str) -> bool:
|
248
|
+
return key in self.additional_properties
|