beamlit 0.0.24rc21__py3-none-any.whl → 0.0.26__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. beamlit/agents/chat.py +26 -19
  2. beamlit/agents/decorator.py +31 -7
  3. beamlit/authentication/apikey.py +2 -2
  4. beamlit/authentication/authentication.py +2 -2
  5. beamlit/authentication/credentials.py +4 -4
  6. beamlit/common/logger.py +4 -2
  7. beamlit/common/settings.py +7 -6
  8. beamlit/deploy/deploy.py +12 -10
  9. beamlit/deploy/format.py +4 -4
  10. beamlit/functions/mcp/mcp.py +125 -0
  11. beamlit/functions/remote/remote.py +103 -0
  12. beamlit/models/__init__.py +4 -8
  13. beamlit/models/agent.py +18 -0
  14. beamlit/models/agent_history_event.py +2 -2
  15. beamlit/models/api_key.py +2 -2
  16. beamlit/models/continent.py +2 -2
  17. beamlit/models/core_status.py +62 -0
  18. beamlit/models/country.py +2 -2
  19. beamlit/models/environment_metrics.py +2 -21
  20. beamlit/models/function.py +18 -0
  21. beamlit/models/increase_and_rate_metric.py +3 -37
  22. beamlit/models/integration_config.py +45 -0
  23. beamlit/models/integration_connection_secret.py +2 -2
  24. beamlit/models/metrics.py +2 -32
  25. beamlit/models/model.py +18 -0
  26. beamlit/models/model_provider.py +2 -2
  27. beamlit/models/pending_invitation.py +2 -2
  28. beamlit/models/pending_invitation_render.py +6 -6
  29. beamlit/models/pending_invitation_render_workspace.py +2 -2
  30. beamlit/models/resource_environment_metrics.py +10 -124
  31. beamlit/models/resource_metrics.py +4 -40
  32. beamlit/models/runtime.py +1 -1
  33. beamlit/models/store_agent.py +2 -2
  34. beamlit/models/store_configuration.py +4 -4
  35. beamlit/models/store_function.py +2 -2
  36. beamlit/models/workspace.py +2 -2
  37. {beamlit-0.0.24rc21.dist-info → beamlit-0.0.26.dist-info}/METADATA +2 -1
  38. {beamlit-0.0.24rc21.dist-info → beamlit-0.0.26.dist-info}/RECORD +39 -35
  39. {beamlit-0.0.24rc21.dist-info → beamlit-0.0.26.dist-info}/WHEEL +0 -0
beamlit/models/agent.py CHANGED
@@ -7,6 +7,7 @@ from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
9
  from ..models.agent_spec import AgentSpec
10
+ from ..models.core_status import CoreStatus
10
11
  from ..models.environment_metadata import EnvironmentMetadata
11
12
 
12
13
 
@@ -20,10 +21,12 @@ class Agent:
20
21
  Attributes:
21
22
  metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
22
23
  spec (Union[Unset, AgentSpec]): Agent specification
24
+ status (Union[Unset, CoreStatus]): Core status
23
25
  """
24
26
 
25
27
  metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
26
28
  spec: Union[Unset, "AgentSpec"] = UNSET
29
+ status: Union[Unset, "CoreStatus"] = UNSET
27
30
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
31
 
29
32
  def to_dict(self) -> dict[str, Any]:
@@ -35,6 +38,10 @@ class Agent:
35
38
  if not isinstance(self.spec, Unset):
36
39
  spec = self.spec.to_dict()
37
40
 
41
+ status: Union[Unset, dict[str, Any]] = UNSET
42
+ if not isinstance(self.status, Unset):
43
+ status = self.status.to_dict()
44
+
38
45
  field_dict: dict[str, Any] = {}
39
46
  field_dict.update(self.additional_properties)
40
47
  field_dict.update({})
@@ -42,12 +49,15 @@ class Agent:
42
49
  field_dict["metadata"] = metadata
43
50
  if spec is not UNSET:
44
51
  field_dict["spec"] = spec
52
+ if status is not UNSET:
53
+ field_dict["status"] = status
45
54
 
46
55
  return field_dict
47
56
 
48
57
  @classmethod
49
58
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
50
59
  from ..models.agent_spec import AgentSpec
60
+ from ..models.core_status import CoreStatus
51
61
  from ..models.environment_metadata import EnvironmentMetadata
52
62
 
53
63
  if not src_dict:
@@ -67,9 +77,17 @@ class Agent:
67
77
  else:
68
78
  spec = AgentSpec.from_dict(_spec)
69
79
 
80
+ _status = d.pop("status", UNSET)
81
+ status: Union[Unset, CoreStatus]
82
+ if isinstance(_status, Unset):
83
+ status = UNSET
84
+ else:
85
+ status = CoreStatus.from_dict(_status)
86
+
70
87
  agent = cls(
71
88
  metadata=metadata,
72
89
  spec=spec,
90
+ status=status,
73
91
  )
74
92
 
75
93
  agent.additional_properties = d
@@ -70,7 +70,7 @@ class AgentHistoryEvent:
70
70
  if status is not UNSET:
71
71
  field_dict["status"] = status
72
72
  if sub_function is not UNSET:
73
- field_dict["sub_function"] = sub_function
73
+ field_dict["subFunction"] = sub_function
74
74
  if took is not UNSET:
75
75
  field_dict["took"] = took
76
76
  if type_ is not UNSET:
@@ -95,7 +95,7 @@ class AgentHistoryEvent:
95
95
 
96
96
  status = d.pop("status", UNSET)
97
97
 
98
- sub_function = d.pop("sub_function", UNSET)
98
+ sub_function = d.pop("subFunction", UNSET)
99
99
 
100
100
  took = d.pop("took", UNSET)
101
101
 
beamlit/models/api_key.py CHANGED
@@ -70,7 +70,7 @@ class ApiKey:
70
70
  if updated_by is not UNSET:
71
71
  field_dict["updatedBy"] = updated_by
72
72
  if api_key is not UNSET:
73
- field_dict["api_key"] = api_key
73
+ field_dict["apiKey"] = api_key
74
74
  if expires_in is not UNSET:
75
75
  field_dict["expires_in"] = expires_in
76
76
  if id is not UNSET:
@@ -97,7 +97,7 @@ class ApiKey:
97
97
 
98
98
  updated_by = d.pop("updatedBy", UNSET)
99
99
 
100
- api_key = d.pop("api_key", UNSET)
100
+ api_key = d.pop("apiKey", UNSET)
101
101
 
102
102
  expires_in = d.pop("expires_in", UNSET)
103
103
 
@@ -30,7 +30,7 @@ class Continent:
30
30
  field_dict.update(self.additional_properties)
31
31
  field_dict.update({})
32
32
  if display_name is not UNSET:
33
- field_dict["display_name"] = display_name
33
+ field_dict["displayName"] = display_name
34
34
  if name is not UNSET:
35
35
  field_dict["name"] = name
36
36
 
@@ -41,7 +41,7 @@ class Continent:
41
41
  if not src_dict:
42
42
  return None
43
43
  d = src_dict.copy()
44
- display_name = d.pop("display_name", UNSET)
44
+ display_name = d.pop("displayName", UNSET)
45
45
 
46
46
  name = d.pop("name", UNSET)
47
47
 
@@ -0,0 +1,62 @@
1
+ from typing import Any, 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="CoreStatus")
9
+
10
+
11
+ @_attrs_define
12
+ class CoreStatus:
13
+ """Core status
14
+
15
+ Attributes:
16
+ deployment_status (Union[Unset, str]): The status of the core, can be CREATED, UPDATED, DELETED, DEPLOYED,
17
+ DISABLED, or FAILED
18
+ """
19
+
20
+ deployment_status: Union[Unset, str] = UNSET
21
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
22
+
23
+ def to_dict(self) -> dict[str, Any]:
24
+ deployment_status = self.deployment_status
25
+
26
+ field_dict: dict[str, Any] = {}
27
+ field_dict.update(self.additional_properties)
28
+ field_dict.update({})
29
+ if deployment_status is not UNSET:
30
+ field_dict["deploymentStatus"] = deployment_status
31
+
32
+ return field_dict
33
+
34
+ @classmethod
35
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
36
+ if not src_dict:
37
+ return None
38
+ d = src_dict.copy()
39
+ deployment_status = d.pop("deploymentStatus", UNSET)
40
+
41
+ core_status = cls(
42
+ deployment_status=deployment_status,
43
+ )
44
+
45
+ core_status.additional_properties = d
46
+ return core_status
47
+
48
+ @property
49
+ def additional_keys(self) -> list[str]:
50
+ return list(self.additional_properties.keys())
51
+
52
+ def __getitem__(self, key: str) -> Any:
53
+ return self.additional_properties[key]
54
+
55
+ def __setitem__(self, key: str, value: Any) -> None:
56
+ self.additional_properties[key] = value
57
+
58
+ def __delitem__(self, key: str) -> None:
59
+ del self.additional_properties[key]
60
+
61
+ def __contains__(self, key: str) -> bool:
62
+ return key in self.additional_properties
beamlit/models/country.py CHANGED
@@ -30,7 +30,7 @@ class Country:
30
30
  field_dict.update(self.additional_properties)
31
31
  field_dict.update({})
32
32
  if display_name is not UNSET:
33
- field_dict["display_name"] = display_name
33
+ field_dict["displayName"] = display_name
34
34
  if name is not UNSET:
35
35
  field_dict["name"] = name
36
36
 
@@ -41,7 +41,7 @@ class Country:
41
41
  if not src_dict:
42
42
  return None
43
43
  d = src_dict.copy()
44
- display_name = d.pop("display_name", UNSET)
44
+ display_name = d.pop("displayName", UNSET)
45
45
 
46
46
  name = d.pop("name", UNSET)
47
47
 
@@ -18,11 +18,9 @@ class EnvironmentMetrics:
18
18
 
19
19
  Attributes:
20
20
  inference_global (Union[Unset, list['Metric']]): Array of metrics
21
- inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
22
21
  """
23
22
 
24
23
  inference_global: Union[Unset, list["Metric"]] = UNSET
25
- inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
26
24
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
25
 
28
26
  def to_dict(self) -> dict[str, Any]:
@@ -33,20 +31,11 @@ class EnvironmentMetrics:
33
31
  componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
34
32
  inference_global.append(componentsschemas_array_metric_item)
35
33
 
36
- inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
37
- if not isinstance(self.inference_per_second_global, Unset):
38
- inference_per_second_global = []
39
- for componentsschemas_array_metric_item_data in self.inference_per_second_global:
40
- componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
41
- inference_per_second_global.append(componentsschemas_array_metric_item)
42
-
43
34
  field_dict: dict[str, Any] = {}
44
35
  field_dict.update(self.additional_properties)
45
36
  field_dict.update({})
46
37
  if inference_global is not UNSET:
47
- field_dict["inference_global"] = inference_global
48
- if inference_per_second_global is not UNSET:
49
- field_dict["inference_per_second_global"] = inference_per_second_global
38
+ field_dict["inferenceGlobal"] = inference_global
50
39
 
51
40
  return field_dict
52
41
 
@@ -58,22 +47,14 @@ class EnvironmentMetrics:
58
47
  return None
59
48
  d = src_dict.copy()
60
49
  inference_global = []
61
- _inference_global = d.pop("inference_global", UNSET)
50
+ _inference_global = d.pop("inferenceGlobal", UNSET)
62
51
  for componentsschemas_array_metric_item_data in _inference_global or []:
63
52
  componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
64
53
 
65
54
  inference_global.append(componentsschemas_array_metric_item)
66
55
 
67
- inference_per_second_global = []
68
- _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
69
- for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
70
- componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
71
-
72
- inference_per_second_global.append(componentsschemas_array_metric_item)
73
-
74
56
  environment_metrics = cls(
75
57
  inference_global=inference_global,
76
- inference_per_second_global=inference_per_second_global,
77
58
  )
78
59
 
79
60
  environment_metrics.additional_properties = d
@@ -6,6 +6,7 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
+ from ..models.core_status import CoreStatus
9
10
  from ..models.environment_metadata import EnvironmentMetadata
10
11
  from ..models.function_spec import FunctionSpec
11
12
 
@@ -20,10 +21,12 @@ class Function:
20
21
  Attributes:
21
22
  metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
22
23
  spec (Union[Unset, FunctionSpec]): Function specification
24
+ status (Union[Unset, CoreStatus]): Core status
23
25
  """
24
26
 
25
27
  metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
26
28
  spec: Union[Unset, "FunctionSpec"] = UNSET
29
+ status: Union[Unset, "CoreStatus"] = UNSET
27
30
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
31
 
29
32
  def to_dict(self) -> dict[str, Any]:
@@ -35,6 +38,10 @@ class Function:
35
38
  if not isinstance(self.spec, Unset):
36
39
  spec = self.spec.to_dict()
37
40
 
41
+ status: Union[Unset, dict[str, Any]] = UNSET
42
+ if not isinstance(self.status, Unset):
43
+ status = self.status.to_dict()
44
+
38
45
  field_dict: dict[str, Any] = {}
39
46
  field_dict.update(self.additional_properties)
40
47
  field_dict.update({})
@@ -42,11 +49,14 @@ class Function:
42
49
  field_dict["metadata"] = metadata
43
50
  if spec is not UNSET:
44
51
  field_dict["spec"] = spec
52
+ if status is not UNSET:
53
+ field_dict["status"] = status
45
54
 
46
55
  return field_dict
47
56
 
48
57
  @classmethod
49
58
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
59
+ from ..models.core_status import CoreStatus
50
60
  from ..models.environment_metadata import EnvironmentMetadata
51
61
  from ..models.function_spec import FunctionSpec
52
62
 
@@ -67,9 +77,17 @@ class Function:
67
77
  else:
68
78
  spec = FunctionSpec.from_dict(_spec)
69
79
 
80
+ _status = d.pop("status", UNSET)
81
+ status: Union[Unset, CoreStatus]
82
+ if isinstance(_status, Unset):
83
+ status = UNSET
84
+ else:
85
+ status = CoreStatus.from_dict(_status)
86
+
70
87
  function = cls(
71
88
  metadata=metadata,
72
89
  spec=spec,
90
+ status=status,
73
91
  )
74
92
 
75
93
  function.additional_properties = d
@@ -1,14 +1,10 @@
1
- from typing import TYPE_CHECKING, Any, 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
5
5
 
6
6
  from ..types import UNSET, Unset
7
7
 
8
- if TYPE_CHECKING:
9
- from ..models.metric import Metric
10
-
11
-
12
8
  T = TypeVar("T", bound="IncreaseAndRateMetric")
13
9
 
14
10
 
@@ -18,70 +14,40 @@ class IncreaseAndRateMetric:
18
14
 
19
15
  Attributes:
20
16
  inference_global (Union[Unset, Any]): Historical requests for all resources globally
21
- inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
22
17
  query (Union[Unset, Any]): Number of requests for all resources globally
23
- query_per_second (Union[Unset, float]): RPS value (in last 24 hours) per location, for all resources globally
24
18
  """
25
19
 
26
20
  inference_global: Union[Unset, Any] = UNSET
27
- inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
28
21
  query: Union[Unset, Any] = UNSET
29
- query_per_second: Union[Unset, float] = UNSET
30
22
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
31
23
 
32
24
  def to_dict(self) -> dict[str, Any]:
33
25
  inference_global = self.inference_global
34
26
 
35
- inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
36
- if not isinstance(self.inference_per_second_global, Unset):
37
- inference_per_second_global = []
38
- for componentsschemas_array_metric_item_data in self.inference_per_second_global:
39
- componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
40
- inference_per_second_global.append(componentsschemas_array_metric_item)
41
-
42
27
  query = self.query
43
28
 
44
- query_per_second = self.query_per_second
45
-
46
29
  field_dict: dict[str, Any] = {}
47
30
  field_dict.update(self.additional_properties)
48
31
  field_dict.update({})
49
32
  if inference_global is not UNSET:
50
- field_dict["inference_global"] = inference_global
51
- if inference_per_second_global is not UNSET:
52
- field_dict["inference_per_second_global"] = inference_per_second_global
33
+ field_dict["inferenceGlobal"] = inference_global
53
34
  if query is not UNSET:
54
35
  field_dict["query"] = query
55
- if query_per_second is not UNSET:
56
- field_dict["query_per_second"] = query_per_second
57
36
 
58
37
  return field_dict
59
38
 
60
39
  @classmethod
61
40
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
62
- from ..models.metric import Metric
63
-
64
41
  if not src_dict:
65
42
  return None
66
43
  d = src_dict.copy()
67
- inference_global = d.pop("inference_global", UNSET)
68
-
69
- inference_per_second_global = []
70
- _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
71
- for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
72
- componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
73
-
74
- inference_per_second_global.append(componentsschemas_array_metric_item)
44
+ inference_global = d.pop("inferenceGlobal", UNSET)
75
45
 
76
46
  query = d.pop("query", UNSET)
77
47
 
78
- query_per_second = d.pop("query_per_second", UNSET)
79
-
80
48
  increase_and_rate_metric = cls(
81
49
  inference_global=inference_global,
82
- inference_per_second_global=inference_per_second_global,
83
50
  query=query,
84
- query_per_second=query_per_second,
85
51
  )
86
52
 
87
53
  increase_and_rate_metric.additional_properties = d
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="IntegrationConfig")
7
+
8
+
9
+ @_attrs_define
10
+ class IntegrationConfig:
11
+ """Integration config"""
12
+
13
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> dict[str, Any]:
16
+ field_dict: dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+
19
+ return field_dict
20
+
21
+ @classmethod
22
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
+ if not src_dict:
24
+ return None
25
+ d = src_dict.copy()
26
+ integration_config = cls()
27
+
28
+ integration_config.additional_properties = d
29
+ return integration_config
30
+
31
+ @property
32
+ def additional_keys(self) -> list[str]:
33
+ return list(self.additional_properties.keys())
34
+
35
+ def __getitem__(self, key: str) -> Any:
36
+ return self.additional_properties[key]
37
+
38
+ def __setitem__(self, key: str, value: Any) -> None:
39
+ self.additional_properties[key] = value
40
+
41
+ def __delitem__(self, key: str) -> None:
42
+ del self.additional_properties[key]
43
+
44
+ def __contains__(self, key: str) -> bool:
45
+ return key in self.additional_properties
@@ -26,7 +26,7 @@ class IntegrationConnectionSecret:
26
26
  field_dict.update(self.additional_properties)
27
27
  field_dict.update({})
28
28
  if api_key is not UNSET:
29
- field_dict["api_key"] = api_key
29
+ field_dict["apiKey"] = api_key
30
30
 
31
31
  return field_dict
32
32
 
@@ -35,7 +35,7 @@ class IntegrationConnectionSecret:
35
35
  if not src_dict:
36
36
  return None
37
37
  d = src_dict.copy()
38
- api_key = d.pop("api_key", UNSET)
38
+ api_key = d.pop("apiKey", UNSET)
39
39
 
40
40
  integration_connection_secret = cls(
41
41
  api_key=api_key,
beamlit/models/metrics.py CHANGED
@@ -7,7 +7,6 @@ from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
9
  from ..models.increase_and_rate_metric import IncreaseAndRateMetric
10
- from ..models.metric import Metric
11
10
 
12
11
 
13
12
  T = TypeVar("T", bound="Metrics")
@@ -19,18 +18,14 @@ class Metrics:
19
18
 
20
19
  Attributes:
21
20
  inference_global (Union[Unset, Any]): Historical requests for all resources globally
22
- inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
23
21
  query (Union[Unset, Any]): Number of requests for all resources globally
24
- query_per_second (Union[Unset, float]): RPS value (in last 24 hours) per location, for all resources globally
25
22
  agents (Union[Unset, IncreaseAndRateMetric]): Metrics for resources
26
23
  functions (Union[Unset, IncreaseAndRateMetric]): Metrics for resources
27
24
  models (Union[Unset, IncreaseAndRateMetric]): Metrics for resources
28
25
  """
29
26
 
30
27
  inference_global: Union[Unset, Any] = UNSET
31
- inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
32
28
  query: Union[Unset, Any] = UNSET
33
- query_per_second: Union[Unset, float] = UNSET
34
29
  agents: Union[Unset, "IncreaseAndRateMetric"] = UNSET
35
30
  functions: Union[Unset, "IncreaseAndRateMetric"] = UNSET
36
31
  models: Union[Unset, "IncreaseAndRateMetric"] = UNSET
@@ -39,17 +34,8 @@ class Metrics:
39
34
  def to_dict(self) -> dict[str, Any]:
40
35
  inference_global = self.inference_global
41
36
 
42
- inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
43
- if not isinstance(self.inference_per_second_global, Unset):
44
- inference_per_second_global = []
45
- for componentsschemas_array_metric_item_data in self.inference_per_second_global:
46
- componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
47
- inference_per_second_global.append(componentsschemas_array_metric_item)
48
-
49
37
  query = self.query
50
38
 
51
- query_per_second = self.query_per_second
52
-
53
39
  agents: Union[Unset, dict[str, Any]] = UNSET
54
40
  if not isinstance(self.agents, Unset):
55
41
  agents = self.agents.to_dict()
@@ -66,13 +52,9 @@ class Metrics:
66
52
  field_dict.update(self.additional_properties)
67
53
  field_dict.update({})
68
54
  if inference_global is not UNSET:
69
- field_dict["inference_global"] = inference_global
70
- if inference_per_second_global is not UNSET:
71
- field_dict["inference_per_second_global"] = inference_per_second_global
55
+ field_dict["inferenceGlobal"] = inference_global
72
56
  if query is not UNSET:
73
57
  field_dict["query"] = query
74
- if query_per_second is not UNSET:
75
- field_dict["query_per_second"] = query_per_second
76
58
  if agents is not UNSET:
77
59
  field_dict["agents"] = agents
78
60
  if functions is not UNSET:
@@ -85,24 +67,14 @@ class Metrics:
85
67
  @classmethod
86
68
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
87
69
  from ..models.increase_and_rate_metric import IncreaseAndRateMetric
88
- from ..models.metric import Metric
89
70
 
90
71
  if not src_dict:
91
72
  return None
92
73
  d = src_dict.copy()
93
- inference_global = d.pop("inference_global", UNSET)
94
-
95
- inference_per_second_global = []
96
- _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
97
- for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
98
- componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
99
-
100
- inference_per_second_global.append(componentsschemas_array_metric_item)
74
+ inference_global = d.pop("inferenceGlobal", UNSET)
101
75
 
102
76
  query = d.pop("query", UNSET)
103
77
 
104
- query_per_second = d.pop("query_per_second", UNSET)
105
-
106
78
  _agents = d.pop("agents", UNSET)
107
79
  agents: Union[Unset, IncreaseAndRateMetric]
108
80
  if isinstance(_agents, Unset):
@@ -126,9 +98,7 @@ class Metrics:
126
98
 
127
99
  metrics = cls(
128
100
  inference_global=inference_global,
129
- inference_per_second_global=inference_per_second_global,
130
101
  query=query,
131
- query_per_second=query_per_second,
132
102
  agents=agents,
133
103
  functions=functions,
134
104
  models=models,
beamlit/models/model.py CHANGED
@@ -6,6 +6,7 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
+ from ..models.core_status import CoreStatus
9
10
  from ..models.environment_metadata import EnvironmentMetadata
10
11
  from ..models.model_spec import ModelSpec
11
12
 
@@ -20,10 +21,12 @@ class Model:
20
21
  Attributes:
21
22
  metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
22
23
  spec (Union[Unset, ModelSpec]): Model specification
24
+ status (Union[Unset, CoreStatus]): Core status
23
25
  """
24
26
 
25
27
  metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
26
28
  spec: Union[Unset, "ModelSpec"] = UNSET
29
+ status: Union[Unset, "CoreStatus"] = UNSET
27
30
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
31
 
29
32
  def to_dict(self) -> dict[str, Any]:
@@ -35,6 +38,10 @@ class Model:
35
38
  if not isinstance(self.spec, Unset):
36
39
  spec = self.spec.to_dict()
37
40
 
41
+ status: Union[Unset, dict[str, Any]] = UNSET
42
+ if not isinstance(self.status, Unset):
43
+ status = self.status.to_dict()
44
+
38
45
  field_dict: dict[str, Any] = {}
39
46
  field_dict.update(self.additional_properties)
40
47
  field_dict.update({})
@@ -42,11 +49,14 @@ class Model:
42
49
  field_dict["metadata"] = metadata
43
50
  if spec is not UNSET:
44
51
  field_dict["spec"] = spec
52
+ if status is not UNSET:
53
+ field_dict["status"] = status
45
54
 
46
55
  return field_dict
47
56
 
48
57
  @classmethod
49
58
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
59
+ from ..models.core_status import CoreStatus
50
60
  from ..models.environment_metadata import EnvironmentMetadata
51
61
  from ..models.model_spec import ModelSpec
52
62
 
@@ -67,9 +77,17 @@ class Model:
67
77
  else:
68
78
  spec = ModelSpec.from_dict(_spec)
69
79
 
80
+ _status = d.pop("status", UNSET)
81
+ status: Union[Unset, CoreStatus]
82
+ if isinstance(_status, Unset):
83
+ status = UNSET
84
+ else:
85
+ status = CoreStatus.from_dict(_status)
86
+
70
87
  model = cls(
71
88
  metadata=metadata,
72
89
  spec=spec,
90
+ status=status,
73
91
  )
74
92
 
75
93
  model.additional_properties = d
@@ -87,7 +87,7 @@ class ModelProvider:
87
87
  if config is not UNSET:
88
88
  field_dict["config"] = config
89
89
  if display_name is not UNSET:
90
- field_dict["display_name"] = display_name
90
+ field_dict["displayName"] = display_name
91
91
  if labels is not UNSET:
92
92
  field_dict["labels"] = labels
93
93
  if name is not UNSET:
@@ -124,7 +124,7 @@ class ModelProvider:
124
124
  else:
125
125
  config = ProviderConfig.from_dict(_config)
126
126
 
127
- display_name = d.pop("display_name", UNSET)
127
+ display_name = d.pop("displayName", UNSET)
128
128
 
129
129
  _labels = d.pop("labels", UNSET)
130
130
  labels: Union[Unset, MetadataLabels]
@@ -64,7 +64,7 @@ class PendingInvitation:
64
64
  if email is not UNSET:
65
65
  field_dict["email"] = email
66
66
  if invited_by is not UNSET:
67
- field_dict["invited_by"] = invited_by
67
+ field_dict["invitedBy"] = invited_by
68
68
  if role is not UNSET:
69
69
  field_dict["role"] = role
70
70
  if workspace is not UNSET:
@@ -87,7 +87,7 @@ class PendingInvitation:
87
87
 
88
88
  email = d.pop("email", UNSET)
89
89
 
90
- invited_by = d.pop("invited_by", UNSET)
90
+ invited_by = d.pop("invitedBy", UNSET)
91
91
 
92
92
  role = d.pop("role", UNSET)
93
93