beamlit 0.0.24rc20__py3-none-any.whl → 0.0.24rc21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. beamlit/agents/chat.py +37 -11
  2. beamlit/agents/decorator.py +97 -65
  3. beamlit/api/agents/create_agent.py +9 -14
  4. beamlit/api/agents/delete_agent.py +22 -1
  5. beamlit/api/agents/delete_agent_history.py +2 -6
  6. beamlit/api/agents/get_agent.py +22 -1
  7. beamlit/api/agents/get_agent_environment_logs.py +11 -11
  8. beamlit/api/agents/get_agent_history.py +2 -6
  9. beamlit/api/agents/get_agent_metrics.py +22 -1
  10. beamlit/api/agents/list_agent_history.py +11 -11
  11. beamlit/api/agents/list_agents.py +36 -4
  12. beamlit/api/agents/put_agent_history.py +2 -6
  13. beamlit/api/agents/update_agent.py +9 -14
  14. beamlit/api/functions/create_function.py +9 -14
  15. beamlit/api/functions/delete_function.py +22 -1
  16. beamlit/api/functions/get_function.py +22 -1
  17. beamlit/api/functions/get_function_environment_logs.py +11 -11
  18. beamlit/api/functions/get_function_metrics.py +22 -1
  19. beamlit/api/functions/list_functions.py +36 -4
  20. beamlit/api/functions/update_function.py +9 -14
  21. beamlit/api/history/get_agents_history.py +12 -12
  22. beamlit/api/history/list_agents_history.py +12 -12
  23. beamlit/api/integrations/get_integration_connection.py +16 -12
  24. beamlit/api/integrations/get_integration_connection_model.py +8 -1
  25. beamlit/api/integrations/get_integration_model.py +8 -1
  26. beamlit/api/locations/list_locations.py +12 -12
  27. beamlit/api/models/create_model.py +13 -14
  28. beamlit/api/models/delete_model.py +22 -1
  29. beamlit/api/models/get_model.py +22 -1
  30. beamlit/api/models/get_model_environment_logs.py +11 -11
  31. beamlit/api/models/get_model_metrics.py +38 -13
  32. beamlit/api/models/list_models.py +36 -4
  33. beamlit/api/models/update_model.py +13 -14
  34. beamlit/api/privateclusters/__init__.py +0 -0
  35. beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
  36. beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
  37. beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
  38. beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
  39. beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
  40. beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
  41. beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
  42. beamlit/authentication/device_mode.py +3 -9
  43. beamlit/common/generate.py +47 -34
  44. beamlit/common/settings.py +29 -27
  45. beamlit/deploy/deploy.py +101 -342
  46. beamlit/deploy/format.py +70 -0
  47. beamlit/deploy/parser.py +175 -0
  48. beamlit/functions/decorator.py +8 -11
  49. beamlit/models/__init__.py +64 -78
  50. beamlit/models/acl.py +4 -22
  51. beamlit/models/agent.py +34 -95
  52. beamlit/models/agent_history.py +7 -5
  53. beamlit/models/agent_history_event.py +11 -9
  54. beamlit/models/agent_metadata.py +5 -3
  55. beamlit/models/agent_spec.py +54 -45
  56. beamlit/models/api_key.py +14 -14
  57. beamlit/models/configuration.py +11 -0
  58. beamlit/models/core_spec.py +45 -32
  59. beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
  60. beamlit/models/environment.py +33 -105
  61. beamlit/models/environment_metadata.py +146 -0
  62. beamlit/models/environment_spec.py +8 -6
  63. beamlit/models/function.py +34 -95
  64. beamlit/models/function_metadata.py +5 -3
  65. beamlit/models/function_spec.py +53 -40
  66. beamlit/models/integration_connection.py +31 -137
  67. beamlit/models/integration_connection_spec.py +6 -4
  68. beamlit/models/metadata.py +5 -3
  69. beamlit/models/metadata_labels.py +4 -2
  70. beamlit/models/model.py +33 -94
  71. beamlit/models/model_metadata.py +5 -3
  72. beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
  73. beamlit/models/model_provider.py +27 -43
  74. beamlit/models/model_spec.py +45 -32
  75. beamlit/models/owner_fields.py +4 -2
  76. beamlit/models/pending_invitation.py +14 -14
  77. beamlit/models/pod_template_spec.py +4 -2
  78. beamlit/models/policy.py +33 -159
  79. beamlit/models/policy_spec.py +24 -28
  80. beamlit/models/private_cluster.py +183 -0
  81. beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
  82. beamlit/models/resource_deployment_metrics.py +0 -108
  83. beamlit/models/resource_environment_metrics.py +143 -71
  84. beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
  85. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
  86. beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
  87. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
  88. beamlit/models/resource_log.py +4 -2
  89. beamlit/models/runtime.py +20 -2
  90. beamlit/models/serverless_config.py +28 -21
  91. beamlit/models/spec_configuration.py +7 -5
  92. beamlit/models/store_agent.py +14 -14
  93. beamlit/models/store_function.py +14 -14
  94. beamlit/models/time_fields.py +4 -2
  95. beamlit/models/websocket_channel.py +4 -2
  96. beamlit/models/workspace.py +23 -14
  97. beamlit/run.py +0 -1
  98. beamlit/serve/app.py +1 -0
  99. beamlit/serve/middlewares/accesslog.py +3 -1
  100. {beamlit-0.0.24rc20.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
  101. beamlit-0.0.24rc21.dist-info/RECORD +243 -0
  102. beamlit/api/agents/delete_agent_deployment.py +0 -163
  103. beamlit/api/agents/delete_agent_deployment_history.py +0 -172
  104. beamlit/api/agents/get_agent_deployment_history.py +0 -172
  105. beamlit/api/agents/get_agent_deployment_logs.py +0 -164
  106. beamlit/api/agents/list_agent_deployment_history.py +0 -164
  107. beamlit/api/agents/put_agent_deployment.py +0 -185
  108. beamlit/api/agents/put_agent_deployment_history.py +0 -198
  109. beamlit/api/functions/delete_function_deployment.py +0 -163
  110. beamlit/api/functions/get_function_deployment.py +0 -163
  111. beamlit/api/functions/get_function_deployment_logs.py +0 -164
  112. beamlit/api/functions/get_function_deployment_metrics.py +0 -159
  113. beamlit/api/functions/put_function_deployment.py +0 -185
  114. beamlit/api/models/delete_model_deployment.py +0 -171
  115. beamlit/api/models/get_model_deployment.py +0 -171
  116. beamlit/api/models/get_model_deployment_logs.py +0 -168
  117. beamlit/api/models/get_model_deployment_metrics.py +0 -163
  118. beamlit/api/models/put_model_deployment.py +0 -193
  119. beamlit/models/agent_configuration.py +0 -70
  120. beamlit/models/agent_deployment.py +0 -340
  121. beamlit/models/agent_deployment_configuration.py +0 -45
  122. beamlit/models/agent_deployment_configuration_type_0.py +0 -43
  123. beamlit/models/agent_deployment_history.py +0 -185
  124. beamlit/models/agent_deployment_history_event.py +0 -133
  125. beamlit/models/agent_deployment_pod_template.py +0 -45
  126. beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
  127. beamlit/models/agent_with_deployments.py +0 -176
  128. beamlit/models/authentication_provider_model.py +0 -144
  129. beamlit/models/authentication_provider_organization.py +0 -88
  130. beamlit/models/deployment_configuration.py +0 -70
  131. beamlit/models/deployment_configurations.py +0 -58
  132. beamlit/models/deployment_serverless_config.py +0 -131
  133. beamlit/models/deployment_serverless_config_type_0.py +0 -220
  134. beamlit/models/function_configuration.py +0 -70
  135. beamlit/models/function_deployment.py +0 -340
  136. beamlit/models/function_deployment_configuration.py +0 -45
  137. beamlit/models/function_deployment_configuration_type_0.py +0 -43
  138. beamlit/models/function_deployment_pod_template.py +0 -45
  139. beamlit/models/function_deployment_pod_template_type_0.py +0 -43
  140. beamlit/models/function_with_deployments.py +0 -176
  141. beamlit/models/integration.py +0 -198
  142. beamlit/models/integration_config.py +0 -45
  143. beamlit/models/integration_secret.py +0 -61
  144. beamlit/models/labels_type_0.py +0 -45
  145. beamlit/models/location.py +0 -122
  146. beamlit/models/model_deployment.py +0 -296
  147. beamlit/models/model_deployment_log.py +0 -70
  148. beamlit/models/model_deployment_metrics.py +0 -172
  149. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
  150. beamlit/models/model_deployment_pod_template.py +0 -45
  151. beamlit/models/model_deployment_pod_template_type_0.py +0 -43
  152. beamlit/models/model_metrics.py +0 -96
  153. beamlit/models/model_with_deployments.py +0 -176
  154. beamlit/models/resource_deployment_log.py +0 -70
  155. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
  156. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
  157. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
  158. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
  159. beamlit/models/runtime_readiness_probe_type_0.py +0 -43
  160. beamlit/models/runtime_type_0.py +0 -111
  161. beamlit/models/runtime_type_0_readiness_probe.py +0 -43
  162. beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
  163. beamlit/models/runtime_type_0_resources.py +0 -59
  164. beamlit/models/standard_fields_dynamo_db.py +0 -88
  165. beamlit/models/store_agent_configuration.py +0 -97
  166. beamlit/models/store_agent_labels_type_0.py +0 -43
  167. beamlit/models/store_function_configuration.py +0 -97
  168. beamlit/models/store_function_labels_type_0.py +0 -43
  169. beamlit-0.0.24rc20.dist-info/RECORD +0 -303
  170. {beamlit-0.0.24rc20.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
beamlit/models/agent.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -6,7 +6,8 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
- from ..models.labels_type_0 import LabelsType0
9
+ from ..models.agent_spec import AgentSpec
10
+ from ..models.environment_metadata import EnvironmentMetadata
10
11
 
11
12
 
12
13
  T = TypeVar("T", bound="Agent")
@@ -14,123 +15,61 @@ T = TypeVar("T", bound="Agent")
14
15
 
15
16
  @_attrs_define
16
17
  class Agent:
17
- """Agent parent of AgentDeployment
18
+ """Agent
18
19
 
19
20
  Attributes:
20
- created_at (Union[Unset, str]): The date and time when the resource was created
21
- created_by (Union[Unset, str]): The user or service account who created the resource
22
- updated_at (Union[Unset, str]): The date and time when the resource was updated
23
- updated_by (Union[Unset, str]): The user or service account who updated the resource
24
- display_name (Union[Unset, str]): Agent display name
25
- labels (Union['LabelsType0', None, Unset]): Labels
26
- name (Union[Unset, str]): Agent name
27
- workspace (Union[Unset, str]): Workspace name
21
+ metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
22
+ spec (Union[Unset, AgentSpec]): Agent specification
28
23
  """
29
24
 
30
- created_at: Union[Unset, str] = UNSET
31
- created_by: Union[Unset, str] = UNSET
32
- updated_at: Union[Unset, str] = UNSET
33
- updated_by: Union[Unset, str] = UNSET
34
- display_name: Union[Unset, str] = UNSET
35
- labels: Union["LabelsType0", None, Unset] = UNSET
36
- name: Union[Unset, str] = UNSET
37
- workspace: Union[Unset, str] = UNSET
25
+ metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
26
+ spec: Union[Unset, "AgentSpec"] = UNSET
38
27
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
28
 
40
29
  def to_dict(self) -> dict[str, Any]:
41
- from ..models.labels_type_0 import LabelsType0
30
+ metadata: Union[Unset, dict[str, Any]] = UNSET
31
+ if not isinstance(self.metadata, Unset):
32
+ metadata = self.metadata.to_dict()
42
33
 
43
- created_at = self.created_at
44
-
45
- created_by = self.created_by
46
-
47
- updated_at = self.updated_at
48
-
49
- updated_by = self.updated_by
50
-
51
- display_name = self.display_name
52
-
53
- labels: Union[None, Unset, dict[str, Any]]
54
- if isinstance(self.labels, Unset):
55
- labels = UNSET
56
- elif isinstance(self.labels, LabelsType0):
57
- labels = self.labels.to_dict()
58
- else:
59
- labels = self.labels
60
-
61
- name = self.name
62
-
63
- workspace = self.workspace
34
+ spec: Union[Unset, dict[str, Any]] = UNSET
35
+ if not isinstance(self.spec, Unset):
36
+ spec = self.spec.to_dict()
64
37
 
65
38
  field_dict: dict[str, Any] = {}
66
39
  field_dict.update(self.additional_properties)
67
40
  field_dict.update({})
68
- if created_at is not UNSET:
69
- field_dict["created_at"] = created_at
70
- if created_by is not UNSET:
71
- field_dict["created_by"] = created_by
72
- if updated_at is not UNSET:
73
- field_dict["updated_at"] = updated_at
74
- if updated_by is not UNSET:
75
- field_dict["updated_by"] = updated_by
76
- if display_name is not UNSET:
77
- field_dict["display_name"] = display_name
78
- if labels is not UNSET:
79
- field_dict["labels"] = labels
80
- if name is not UNSET:
81
- field_dict["name"] = name
82
- if workspace is not UNSET:
83
- field_dict["workspace"] = workspace
41
+ if metadata is not UNSET:
42
+ field_dict["metadata"] = metadata
43
+ if spec is not UNSET:
44
+ field_dict["spec"] = spec
84
45
 
85
46
  return field_dict
86
47
 
87
48
  @classmethod
88
49
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
89
- from ..models.labels_type_0 import LabelsType0
50
+ from ..models.agent_spec import AgentSpec
51
+ from ..models.environment_metadata import EnvironmentMetadata
90
52
 
91
53
  if not src_dict:
92
54
  return None
93
55
  d = src_dict.copy()
94
- created_at = d.pop("created_at", UNSET)
95
-
96
- created_by = d.pop("created_by", UNSET)
97
-
98
- updated_at = d.pop("updated_at", UNSET)
99
-
100
- updated_by = d.pop("updated_by", UNSET)
101
-
102
- display_name = d.pop("display_name", UNSET)
103
-
104
- def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
105
- if data is None:
106
- return data
107
- if isinstance(data, Unset):
108
- return data
109
- try:
110
- if not isinstance(data, dict):
111
- raise TypeError()
112
- componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
113
-
114
- return componentsschemas_labels_type_0
115
- except: # noqa: E722
116
- pass
117
- return cast(Union["LabelsType0", None, Unset], data)
118
-
119
- labels = _parse_labels(d.pop("labels", UNSET))
120
-
121
- name = d.pop("name", UNSET)
56
+ _metadata = d.pop("metadata", UNSET)
57
+ metadata: Union[Unset, EnvironmentMetadata]
58
+ if isinstance(_metadata, Unset):
59
+ metadata = UNSET
60
+ else:
61
+ metadata = EnvironmentMetadata.from_dict(_metadata)
122
62
 
123
- workspace = d.pop("workspace", UNSET)
63
+ _spec = d.pop("spec", UNSET)
64
+ spec: Union[Unset, AgentSpec]
65
+ if isinstance(_spec, Unset):
66
+ spec = UNSET
67
+ else:
68
+ spec = AgentSpec.from_dict(_spec)
124
69
 
125
70
  agent = cls(
126
- created_at=created_at,
127
- created_by=created_by,
128
- updated_at=updated_at,
129
- updated_by=updated_by,
130
- display_name=display_name,
131
- labels=labels,
132
- name=name,
133
- workspace=workspace,
71
+ metadata=metadata,
72
+ spec=spec,
134
73
  )
135
74
 
136
75
  agent.additional_properties = d
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -22,7 +22,7 @@ class AgentHistory:
22
22
  agent (Union[Unset, str]): Agent name
23
23
  end (Union[Unset, str]): End time
24
24
  environment (Union[Unset, str]): Environment name
25
- events (Union[Unset, List['AgentHistoryEvent']]): Events
25
+ events (Union[Unset, list['AgentHistoryEvent']]): Events
26
26
  request_id (Union[Unset, str]): Request ID
27
27
  start (Union[Unset, str]): Start time
28
28
  status (Union[Unset, str]): Status, eg: running, success, failed
@@ -35,7 +35,7 @@ class AgentHistory:
35
35
  agent: Union[Unset, str] = UNSET
36
36
  end: Union[Unset, str] = UNSET
37
37
  environment: Union[Unset, str] = UNSET
38
- events: Union[Unset, List["AgentHistoryEvent"]] = UNSET
38
+ events: Union[Unset, list["AgentHistoryEvent"]] = UNSET
39
39
  request_id: Union[Unset, str] = UNSET
40
40
  start: Union[Unset, str] = UNSET
41
41
  status: Union[Unset, str] = UNSET
@@ -54,7 +54,7 @@ class AgentHistory:
54
54
 
55
55
  environment = self.environment
56
56
 
57
- events: Union[Unset, List[Dict[str, Any]]] = UNSET
57
+ events: Union[Unset, list[dict[str, Any]]] = UNSET
58
58
  if not isinstance(self.events, Unset):
59
59
  events = []
60
60
  for events_item_data in self.events:
@@ -100,9 +100,11 @@ class AgentHistory:
100
100
  return field_dict
101
101
 
102
102
  @classmethod
103
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
103
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
104
104
  from ..models.agent_history_event import AgentHistoryEvent
105
105
 
106
+ if not src_dict:
107
+ return None
106
108
  d = src_dict.copy()
107
109
  created_at = d.pop("createdAt", UNSET)
108
110
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union
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
@@ -21,7 +21,7 @@ class AgentHistoryEvent:
21
21
  status (Union[Unset, str]): Status, eg: running, success, failed
22
22
  sub_function (Union[Unset, str]): Function used in kit if a kit was used
23
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
24
+ type_ (Union[Unset, str]): Type, one of function or agent
25
25
  """
26
26
 
27
27
  end: Union[Unset, str] = UNSET
@@ -32,7 +32,7 @@ class AgentHistoryEvent:
32
32
  status: Union[Unset, str] = UNSET
33
33
  sub_function: Union[Unset, str] = UNSET
34
34
  took: Union[Unset, int] = UNSET
35
- type: Union[Unset, str] = UNSET
35
+ type_: Union[Unset, str] = UNSET
36
36
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
37
 
38
38
  def to_dict(self) -> dict[str, Any]:
@@ -52,7 +52,7 @@ class AgentHistoryEvent:
52
52
 
53
53
  took = self.took
54
54
 
55
- type = self.type
55
+ type_ = self.type_
56
56
 
57
57
  field_dict: dict[str, Any] = {}
58
58
  field_dict.update(self.additional_properties)
@@ -73,13 +73,15 @@ class AgentHistoryEvent:
73
73
  field_dict["sub_function"] = sub_function
74
74
  if took is not UNSET:
75
75
  field_dict["took"] = took
76
- if type is not UNSET:
77
- field_dict["type"] = type
76
+ if type_ is not UNSET:
77
+ field_dict["type"] = type_
78
78
 
79
79
  return field_dict
80
80
 
81
81
  @classmethod
82
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
82
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
83
+ if not src_dict:
84
+ return None
83
85
  d = src_dict.copy()
84
86
  end = d.pop("end", UNSET)
85
87
 
@@ -97,7 +99,7 @@ class AgentHistoryEvent:
97
99
 
98
100
  took = d.pop("took", UNSET)
99
101
 
100
- type = d.pop("type", UNSET)
102
+ type_ = d.pop("type", UNSET)
101
103
 
102
104
  agent_history_event = cls(
103
105
  end=end,
@@ -108,7 +110,7 @@ class AgentHistoryEvent:
108
110
  status=status,
109
111
  sub_function=sub_function,
110
112
  took=took,
111
- type=type,
113
+ type_=type_,
112
114
  )
113
115
 
114
116
  agent_history_event.additional_properties = d
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -50,7 +50,7 @@ class AgentMetadata:
50
50
 
51
51
  display_name = self.display_name
52
52
 
53
- labels: Union[Unset, Dict[str, Any]] = UNSET
53
+ labels: Union[Unset, dict[str, Any]] = UNSET
54
54
  if not isinstance(self.labels, Unset):
55
55
  labels = self.labels.to_dict()
56
56
 
@@ -85,9 +85,11 @@ class AgentMetadata:
85
85
  return field_dict
86
86
 
87
87
  @classmethod
88
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
88
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
89
89
  from ..models.metadata_labels import MetadataLabels
90
90
 
91
+ if not src_dict:
92
+ return None
91
93
  d = src_dict.copy()
92
94
  created_at = d.pop("createdAt", UNSET)
93
95
 
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -7,11 +7,12 @@ from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
9
  from ..models.agent_chain import AgentChain
10
+ from ..models.core_spec_configurations import CoreSpecConfigurations
10
11
  from ..models.flavor import Flavor
12
+ from ..models.model_private_cluster import ModelPrivateCluster
11
13
  from ..models.pod_template_spec import PodTemplateSpec
12
14
  from ..models.runtime import Runtime
13
15
  from ..models.serverless_config import ServerlessConfig
14
- from ..models.spec_configuration import SpecConfiguration
15
16
 
16
17
 
17
18
  T = TypeVar("T", bound="AgentSpec")
@@ -22,85 +23,86 @@ class AgentSpec:
22
23
  """Agent specification
23
24
 
24
25
  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]
26
+ configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
27
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]]):
28
+ flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
29
+ integration_connections (Union[Unset, list[str]]):
30
30
  pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
31
- policies (Union[Unset, List[str]]):
31
+ policies (Union[Unset, list[str]]):
32
+ private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
32
33
  runtime (Union[Unset, Runtime]): Set of configurations for a deployment
33
34
  serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
34
- agent_chain (Union[Unset, List['AgentChain']]): Agent chain
35
+ agent_chain (Union[Unset, list['AgentChain']]): Agent chain
35
36
  description (Union[Unset, str]): Agent description
36
- functions (Union[Unset, List[str]]):
37
+ functions (Union[Unset, list[str]]):
37
38
  model (Union[Unset, str]): Model name
38
39
  store_id (Union[Unset, str]): Store id
39
40
  """
40
41
 
41
- configurations: Union[Unset, "SpecConfiguration"] = UNSET
42
+ configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
42
43
  enabled: Union[Unset, bool] = UNSET
43
- flavors: Union[Unset, List["Flavor"]] = UNSET
44
- integration_connections: Union[Unset, List[str]] = UNSET
44
+ flavors: Union[Unset, list["Flavor"]] = UNSET
45
+ integration_connections: Union[Unset, list[str]] = UNSET
45
46
  pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
46
- policies: Union[Unset, List[str]] = UNSET
47
+ policies: Union[Unset, list[str]] = UNSET
48
+ private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
47
49
  runtime: Union[Unset, "Runtime"] = UNSET
48
50
  serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
49
- agent_chain: Union[Unset, List["AgentChain"]] = UNSET
51
+ agent_chain: Union[Unset, list["AgentChain"]] = UNSET
50
52
  description: Union[Unset, str] = UNSET
51
- functions: Union[Unset, List[str]] = UNSET
53
+ functions: Union[Unset, list[str]] = UNSET
52
54
  model: Union[Unset, str] = UNSET
53
55
  store_id: Union[Unset, str] = UNSET
54
56
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
55
57
 
56
58
  def to_dict(self) -> dict[str, Any]:
57
- configurations: Union[Unset, Dict[str, Any]] = UNSET
59
+ configurations: Union[Unset, dict[str, Any]] = UNSET
58
60
  if not isinstance(self.configurations, Unset):
59
61
  configurations = self.configurations.to_dict()
60
62
 
61
63
  enabled = self.enabled
62
64
 
63
- flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
65
+ flavors: Union[Unset, list[dict[str, Any]]] = UNSET
64
66
  if not isinstance(self.flavors, Unset):
65
67
  flavors = []
66
68
  for componentsschemas_flavors_item_data in self.flavors:
67
- componentsschemas_flavors_item = (
68
- componentsschemas_flavors_item_data.to_dict()
69
- )
69
+ componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
70
70
  flavors.append(componentsschemas_flavors_item)
71
71
 
72
- integration_connections: Union[Unset, List[str]] = UNSET
72
+ integration_connections: Union[Unset, list[str]] = UNSET
73
73
  if not isinstance(self.integration_connections, Unset):
74
74
  integration_connections = self.integration_connections
75
75
 
76
- pod_template: Union[Unset, Dict[str, Any]] = UNSET
76
+ pod_template: Union[Unset, dict[str, Any]] = UNSET
77
77
  if not isinstance(self.pod_template, Unset):
78
78
  pod_template = self.pod_template.to_dict()
79
79
 
80
- policies: Union[Unset, List[str]] = UNSET
80
+ policies: Union[Unset, list[str]] = UNSET
81
81
  if not isinstance(self.policies, Unset):
82
82
  policies = self.policies
83
83
 
84
- runtime: Union[Unset, Dict[str, Any]] = UNSET
84
+ private_clusters: Union[Unset, dict[str, Any]] = UNSET
85
+ if not isinstance(self.private_clusters, Unset):
86
+ private_clusters = self.private_clusters.to_dict()
87
+
88
+ runtime: Union[Unset, dict[str, Any]] = UNSET
85
89
  if not isinstance(self.runtime, Unset):
86
90
  runtime = self.runtime.to_dict()
87
91
 
88
- serverless_config: Union[Unset, Dict[str, Any]] = UNSET
92
+ serverless_config: Union[Unset, dict[str, Any]] = UNSET
89
93
  if not isinstance(self.serverless_config, Unset):
90
94
  serverless_config = self.serverless_config.to_dict()
91
95
 
92
- agent_chain: Union[Unset, List[Dict[str, Any]]] = UNSET
96
+ agent_chain: Union[Unset, list[dict[str, Any]]] = UNSET
93
97
  if not isinstance(self.agent_chain, Unset):
94
98
  agent_chain = []
95
99
  for componentsschemas_agent_chains_item_data in self.agent_chain:
96
- componentsschemas_agent_chains_item = (
97
- componentsschemas_agent_chains_item_data.to_dict()
98
- )
100
+ componentsschemas_agent_chains_item = componentsschemas_agent_chains_item_data.to_dict()
99
101
  agent_chain.append(componentsschemas_agent_chains_item)
100
102
 
101
103
  description = self.description
102
104
 
103
- functions: Union[Unset, List[str]] = UNSET
105
+ functions: Union[Unset, list[str]] = UNSET
104
106
  if not isinstance(self.functions, Unset):
105
107
  functions = self.functions
106
108
 
@@ -123,6 +125,8 @@ class AgentSpec:
123
125
  field_dict["podTemplate"] = pod_template
124
126
  if policies is not UNSET:
125
127
  field_dict["policies"] = policies
128
+ if private_clusters is not UNSET:
129
+ field_dict["privateClusters"] = private_clusters
126
130
  if runtime is not UNSET:
127
131
  field_dict["runtime"] = runtime
128
132
  if serverless_config is not UNSET:
@@ -141,36 +145,35 @@ class AgentSpec:
141
145
  return field_dict
142
146
 
143
147
  @classmethod
144
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
148
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
145
149
  from ..models.agent_chain import AgentChain
150
+ from ..models.core_spec_configurations import CoreSpecConfigurations
146
151
  from ..models.flavor import Flavor
152
+ from ..models.model_private_cluster import ModelPrivateCluster
147
153
  from ..models.pod_template_spec import PodTemplateSpec
148
154
  from ..models.runtime import Runtime
149
155
  from ..models.serverless_config import ServerlessConfig
150
- from ..models.spec_configuration import SpecConfiguration
151
156
 
157
+ if not src_dict:
158
+ return None
152
159
  d = src_dict.copy()
153
160
  _configurations = d.pop("configurations", UNSET)
154
- configurations: Union[Unset, SpecConfiguration]
161
+ configurations: Union[Unset, CoreSpecConfigurations]
155
162
  if isinstance(_configurations, Unset):
156
163
  configurations = UNSET
157
164
  else:
158
- configurations = SpecConfiguration.from_dict(_configurations)
165
+ configurations = CoreSpecConfigurations.from_dict(_configurations)
159
166
 
160
167
  enabled = d.pop("enabled", UNSET)
161
168
 
162
169
  flavors = []
163
170
  _flavors = d.pop("flavors", UNSET)
164
171
  for componentsschemas_flavors_item_data in _flavors or []:
165
- componentsschemas_flavors_item = Flavor.from_dict(
166
- componentsschemas_flavors_item_data
167
- )
172
+ componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
168
173
 
169
174
  flavors.append(componentsschemas_flavors_item)
170
175
 
171
- integration_connections = cast(
172
- List[str], d.pop("integrationConnections", UNSET)
173
- )
176
+ integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
174
177
 
175
178
  _pod_template = d.pop("podTemplate", UNSET)
176
179
  pod_template: Union[Unset, PodTemplateSpec]
@@ -179,7 +182,14 @@ class AgentSpec:
179
182
  else:
180
183
  pod_template = PodTemplateSpec.from_dict(_pod_template)
181
184
 
182
- policies = cast(List[str], d.pop("policies", UNSET))
185
+ policies = cast(list[str], d.pop("policies", UNSET))
186
+
187
+ _private_clusters = d.pop("privateClusters", UNSET)
188
+ private_clusters: Union[Unset, ModelPrivateCluster]
189
+ if isinstance(_private_clusters, Unset):
190
+ private_clusters = UNSET
191
+ else:
192
+ private_clusters = ModelPrivateCluster.from_dict(_private_clusters)
183
193
 
184
194
  _runtime = d.pop("runtime", UNSET)
185
195
  runtime: Union[Unset, Runtime]
@@ -198,15 +208,13 @@ class AgentSpec:
198
208
  agent_chain = []
199
209
  _agent_chain = d.pop("agentChain", UNSET)
200
210
  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
- )
211
+ componentsschemas_agent_chains_item = AgentChain.from_dict(componentsschemas_agent_chains_item_data)
204
212
 
205
213
  agent_chain.append(componentsschemas_agent_chains_item)
206
214
 
207
215
  description = d.pop("description", UNSET)
208
216
 
209
- functions = cast(List[str], d.pop("functions", UNSET))
217
+ functions = cast(list[str], d.pop("functions", UNSET))
210
218
 
211
219
  model = d.pop("model", UNSET)
212
220
 
@@ -219,6 +227,7 @@ class AgentSpec:
219
227
  integration_connections=integration_connections,
220
228
  pod_template=pod_template,
221
229
  policies=policies,
230
+ private_clusters=private_clusters,
222
231
  runtime=runtime,
223
232
  serverless_config=serverless_config,
224
233
  agent_chain=agent_chain,
beamlit/models/api_key.py CHANGED
@@ -14,8 +14,8 @@ class ApiKey:
14
14
 
15
15
  Attributes:
16
16
  created_at (Union[Unset, str]): The date and time when the resource was created
17
- created_by (Union[Unset, str]): The user or service account who created the resource
18
17
  updated_at (Union[Unset, str]): The date and time when the resource was updated
18
+ created_by (Union[Unset, str]): The user or service account who created the resource
19
19
  updated_by (Union[Unset, str]): The user or service account who updated the resource
20
20
  api_key (Union[Unset, str]): Api key
21
21
  expires_in (Union[Unset, str]): Duration until expiration (in seconds)
@@ -26,8 +26,8 @@ class ApiKey:
26
26
  """
27
27
 
28
28
  created_at: Union[Unset, str] = UNSET
29
- created_by: Union[Unset, str] = UNSET
30
29
  updated_at: Union[Unset, str] = UNSET
30
+ created_by: Union[Unset, str] = UNSET
31
31
  updated_by: Union[Unset, str] = UNSET
32
32
  api_key: Union[Unset, str] = UNSET
33
33
  expires_in: Union[Unset, str] = UNSET
@@ -40,10 +40,10 @@ class ApiKey:
40
40
  def to_dict(self) -> dict[str, Any]:
41
41
  created_at = self.created_at
42
42
 
43
- created_by = self.created_by
44
-
45
43
  updated_at = self.updated_at
46
44
 
45
+ created_by = self.created_by
46
+
47
47
  updated_by = self.updated_by
48
48
 
49
49
  api_key = self.api_key
@@ -62,13 +62,13 @@ class ApiKey:
62
62
  field_dict.update(self.additional_properties)
63
63
  field_dict.update({})
64
64
  if created_at is not UNSET:
65
- field_dict["created_at"] = created_at
66
- if created_by is not UNSET:
67
- field_dict["created_by"] = created_by
65
+ field_dict["createdAt"] = created_at
68
66
  if updated_at is not UNSET:
69
- field_dict["updated_at"] = updated_at
67
+ field_dict["updatedAt"] = updated_at
68
+ if created_by is not UNSET:
69
+ field_dict["createdBy"] = created_by
70
70
  if updated_by is not UNSET:
71
- field_dict["updated_by"] = updated_by
71
+ field_dict["updatedBy"] = updated_by
72
72
  if api_key is not UNSET:
73
73
  field_dict["api_key"] = api_key
74
74
  if expires_in is not UNSET:
@@ -89,13 +89,13 @@ class ApiKey:
89
89
  if not src_dict:
90
90
  return None
91
91
  d = src_dict.copy()
92
- created_at = d.pop("created_at", UNSET)
92
+ created_at = d.pop("createdAt", UNSET)
93
93
 
94
- created_by = d.pop("created_by", UNSET)
94
+ updated_at = d.pop("updatedAt", UNSET)
95
95
 
96
- updated_at = d.pop("updated_at", UNSET)
96
+ created_by = d.pop("createdBy", UNSET)
97
97
 
98
- updated_by = d.pop("updated_by", UNSET)
98
+ updated_by = d.pop("updatedBy", UNSET)
99
99
 
100
100
  api_key = d.pop("api_key", UNSET)
101
101
 
@@ -111,8 +111,8 @@ class ApiKey:
111
111
 
112
112
  api_key = cls(
113
113
  created_at=created_at,
114
- created_by=created_by,
115
114
  updated_at=updated_at,
115
+ created_by=created_by,
116
116
  updated_by=updated_by,
117
117
  api_key=api_key,
118
118
  expires_in=expires_in,
@@ -15,10 +15,12 @@ class Configuration:
15
15
  Attributes:
16
16
  continents (Union[Unset, list[Any]]): Continents
17
17
  countries (Union[Unset, list[Any]]): Countries
18
+ private_locations (Union[Unset, list[Any]]): Private locations managed with beamlit operator
18
19
  """
19
20
 
20
21
  continents: Union[Unset, list[Any]] = UNSET
21
22
  countries: Union[Unset, list[Any]] = UNSET
23
+ private_locations: Union[Unset, list[Any]] = UNSET
22
24
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
25
 
24
26
  def to_dict(self) -> dict[str, Any]:
@@ -30,6 +32,10 @@ class Configuration:
30
32
  if not isinstance(self.countries, Unset):
31
33
  countries = self.countries
32
34
 
35
+ private_locations: Union[Unset, list[Any]] = UNSET
36
+ if not isinstance(self.private_locations, Unset):
37
+ private_locations = self.private_locations
38
+
33
39
  field_dict: dict[str, Any] = {}
34
40
  field_dict.update(self.additional_properties)
35
41
  field_dict.update({})
@@ -37,6 +43,8 @@ class Configuration:
37
43
  field_dict["continents"] = continents
38
44
  if countries is not UNSET:
39
45
  field_dict["countries"] = countries
46
+ if private_locations is not UNSET:
47
+ field_dict["privateLocations"] = private_locations
40
48
 
41
49
  return field_dict
42
50
 
@@ -49,9 +57,12 @@ class Configuration:
49
57
 
50
58
  countries = cast(list[Any], d.pop("countries", UNSET))
51
59
 
60
+ private_locations = cast(list[Any], d.pop("privateLocations", UNSET))
61
+
52
62
  configuration = cls(
53
63
  continents=continents,
54
64
  countries=countries,
65
+ private_locations=private_locations,
55
66
  )
56
67
 
57
68
  configuration.additional_properties = d