beamlit 0.0.19__py3-none-any.whl → 0.0.20rc2__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. beamlit/api/agents/create_agent.py +14 -9
  2. beamlit/api/agents/get_agent_deployment.py +22 -1
  3. beamlit/api/agents/update_agent.py +14 -9
  4. beamlit/api/functions/create_function.py +14 -9
  5. beamlit/api/functions/update_function.py +14 -9
  6. beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → integrations/create_integration_connection.py} +45 -41
  7. beamlit/api/integrations/delete_integration_connection.py +158 -0
  8. beamlit/api/integrations/get_integration.py +97 -0
  9. beamlit/api/integrations/get_integration_connection.py +154 -0
  10. beamlit/api/integrations/get_integration_connection_model.py +97 -0
  11. beamlit/api/integrations/get_integration_model.py +97 -0
  12. beamlit/api/integrations/list_integration_connection_models.py +97 -0
  13. beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → integrations/list_integration_connections.py} +24 -48
  14. beamlit/api/integrations/list_integration_models.py +97 -0
  15. beamlit/api/integrations/update_integration_connection.py +180 -0
  16. beamlit/authentication/__init__.py +2 -1
  17. beamlit/authentication/authentication.py +3 -0
  18. beamlit/authentication/clientcredentials.py +99 -0
  19. beamlit/authentication/credentials.py +7 -1
  20. beamlit/authentication/device_mode.py +0 -2
  21. beamlit/common/generate.py +166 -0
  22. beamlit/common/logger.py +30 -0
  23. beamlit/common/settings.py +112 -0
  24. beamlit/common/utils.py +13 -0
  25. beamlit/models/__init__.py +50 -24
  26. beamlit/models/agent_deployment.py +117 -49
  27. beamlit/models/{agent_deployment_configuration.py → agent_deployment_configuration_type_0.py} +5 -5
  28. beamlit/models/agent_deployment_history.py +46 -13
  29. beamlit/models/agent_deployment_history_event.py +78 -22
  30. beamlit/models/{function_deployment_pod_template.py → agent_deployment_pod_template_type_0.py} +5 -5
  31. beamlit/models/agent_with_deployments.py +174 -0
  32. beamlit/models/deployment_configurations.py +19 -6
  33. beamlit/models/deployment_serverless_config_type_0.py +218 -0
  34. beamlit/models/environment_metrics.py +19 -0
  35. beamlit/models/function_deployment.py +110 -42
  36. beamlit/models/{function_deployment_configuration.py → function_deployment_configuration_type_0.py} +5 -5
  37. beamlit/models/{agent_deployment_pod_template.py → function_deployment_pod_template_type_0.py} +5 -5
  38. beamlit/models/function_with_deployments.py +174 -0
  39. beamlit/models/increase_and_rate_metric.py +102 -0
  40. beamlit/models/integration.py +196 -0
  41. beamlit/models/integration_config.py +43 -0
  42. beamlit/models/integration_connection.py +196 -0
  43. beamlit/models/integration_connection_config.py +43 -0
  44. beamlit/models/integration_connection_secret.py +59 -0
  45. beamlit/models/integration_model.py +142 -0
  46. beamlit/models/integration_secret.py +59 -0
  47. beamlit/models/metrics.py +61 -20
  48. beamlit/models/model_deployment.py +96 -64
  49. beamlit/models/{model_deployment_pod_template.py → model_deployment_pod_template_type_0.py} +5 -5
  50. beamlit/models/policy.py +8 -34
  51. beamlit/models/provider_config.py +0 -9
  52. beamlit/models/resource_deployment_metrics.py +231 -36
  53. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +75 -0
  54. beamlit/models/{resource_deployment_metrics_inference_per_second_per_region.py → resource_deployment_metrics_inference_per_second_per_region_type_0.py} +5 -5
  55. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
  56. beamlit/models/{resource_deployment_metrics_query_per_second_per_region_per_code.py → resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py} +5 -5
  57. beamlit/models/resource_metrics.py +36 -0
  58. beamlit/models/runtime.py +29 -12
  59. beamlit/models/{runtime_readiness_probe.py → runtime_readiness_probe_type_0.py} +5 -5
  60. beamlit/models/store_agent.py +29 -13
  61. beamlit/models/{store_agent_labels.py → store_agent_labels_type_0.py} +5 -5
  62. beamlit/models/store_configuration.py +15 -4
  63. beamlit/models/store_configuration_option.py +18 -5
  64. beamlit/models/store_function.py +29 -13
  65. beamlit/models/{store_function_labels.py → store_function_labels_type_0.py} +5 -5
  66. beamlit/run.py +49 -0
  67. {beamlit-0.0.19.dist-info → beamlit-0.0.20rc2.dist-info}/METADATA +5 -2
  68. {beamlit-0.0.19.dist-info → beamlit-0.0.20rc2.dist-info}/RECORD +70 -46
  69. beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +0 -184
  70. beamlit/models/deployment_serverless_config.py +0 -129
  71. beamlit/models/labels.py +0 -43
  72. /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
  73. {beamlit-0.0.19.dist-info → beamlit-0.0.20rc2.dist-info}/WHEEL +0 -0
beamlit/models/runtime.py CHANGED
@@ -6,7 +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.runtime_readiness_probe import RuntimeReadinessProbe
9
+ from ..models.runtime_readiness_probe_type_0 import RuntimeReadinessProbeType0
10
10
  from ..models.runtime_resources import RuntimeResources
11
11
 
12
12
 
@@ -24,7 +24,8 @@ class Runtime:
24
24
  Kubernetes EnvVar types
25
25
  image (Union[Unset, str]): The Docker image for the deployment
26
26
  model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
27
- readiness_probe (Union[Unset, RuntimeReadinessProbe]): The readiness probe. Should be a Kubernetes Probe type
27
+ readiness_probe (Union['RuntimeReadinessProbeType0', None, Unset]): The readiness probe. Should be a Kubernetes
28
+ Probe type
28
29
  resources (Union[Unset, RuntimeResources]): The resources for the deployment. Should be a Kubernetes
29
30
  ResourceRequirements type
30
31
  type (Union[Unset, str]): The type of origin for the deployment
@@ -35,12 +36,14 @@ class Runtime:
35
36
  envs: Union[Unset, List[Any]] = UNSET
36
37
  image: Union[Unset, str] = UNSET
37
38
  model: Union[Unset, str] = UNSET
38
- readiness_probe: Union[Unset, "RuntimeReadinessProbe"] = UNSET
39
+ readiness_probe: Union["RuntimeReadinessProbeType0", None, Unset] = UNSET
39
40
  resources: Union[Unset, "RuntimeResources"] = UNSET
40
41
  type: Union[Unset, str] = UNSET
41
42
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
42
43
 
43
44
  def to_dict(self) -> dict[str, Any]:
45
+ from ..models.runtime_readiness_probe_type_0 import RuntimeReadinessProbeType0
46
+
44
47
  args: Union[Unset, List[Any]] = UNSET
45
48
  if not isinstance(self.args, Unset):
46
49
  args = self.args
@@ -57,9 +60,13 @@ class Runtime:
57
60
 
58
61
  model = self.model
59
62
 
60
- readiness_probe: Union[Unset, Dict[str, Any]] = UNSET
61
- if not isinstance(self.readiness_probe, Unset):
63
+ readiness_probe: Union[Dict[str, Any], None, Unset]
64
+ if isinstance(self.readiness_probe, Unset):
65
+ readiness_probe = UNSET
66
+ elif isinstance(self.readiness_probe, RuntimeReadinessProbeType0):
62
67
  readiness_probe = self.readiness_probe.to_dict()
68
+ else:
69
+ readiness_probe = self.readiness_probe
63
70
 
64
71
  resources: Union[Unset, Dict[str, Any]] = UNSET
65
72
  if not isinstance(self.resources, Unset):
@@ -91,7 +98,7 @@ class Runtime:
91
98
 
92
99
  @classmethod
93
100
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
94
- from ..models.runtime_readiness_probe import RuntimeReadinessProbe
101
+ from ..models.runtime_readiness_probe_type_0 import RuntimeReadinessProbeType0
95
102
  from ..models.runtime_resources import RuntimeResources
96
103
 
97
104
  d = src_dict.copy()
@@ -105,12 +112,22 @@ class Runtime:
105
112
 
106
113
  model = d.pop("model", UNSET)
107
114
 
108
- _readiness_probe = d.pop("readiness_probe", UNSET)
109
- readiness_probe: Union[Unset, RuntimeReadinessProbe]
110
- if isinstance(_readiness_probe, Unset):
111
- readiness_probe = UNSET
112
- else:
113
- readiness_probe = RuntimeReadinessProbe.from_dict(_readiness_probe)
115
+ def _parse_readiness_probe(data: object) -> Union["RuntimeReadinessProbeType0", None, Unset]:
116
+ if data is None:
117
+ return data
118
+ if isinstance(data, Unset):
119
+ return data
120
+ try:
121
+ if not isinstance(data, dict):
122
+ raise TypeError()
123
+ readiness_probe_type_0 = RuntimeReadinessProbeType0.from_dict(data)
124
+
125
+ return readiness_probe_type_0
126
+ except: # noqa: E722
127
+ pass
128
+ return cast(Union["RuntimeReadinessProbeType0", None, Unset], data)
129
+
130
+ readiness_probe = _parse_readiness_probe(d.pop("readiness_probe", UNSET))
114
131
 
115
132
  _resources = d.pop("resources", UNSET)
116
133
  resources: Union[Unset, RuntimeResources]
@@ -3,11 +3,11 @@ from typing import Any, Type, TypeVar
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- T = TypeVar("T", bound="RuntimeReadinessProbe")
6
+ T = TypeVar("T", bound="RuntimeReadinessProbeType0")
7
7
 
8
8
 
9
9
  @_attrs_define
10
- class RuntimeReadinessProbe:
10
+ class RuntimeReadinessProbeType0:
11
11
  """The readiness probe. Should be a Kubernetes Probe type"""
12
12
 
13
13
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
@@ -21,10 +21,10 @@ class RuntimeReadinessProbe:
21
21
  @classmethod
22
22
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
23
23
  d = src_dict.copy()
24
- runtime_readiness_probe = cls()
24
+ runtime_readiness_probe_type_0 = cls()
25
25
 
26
- runtime_readiness_probe.additional_properties = d
27
- return runtime_readiness_probe
26
+ runtime_readiness_probe_type_0.additional_properties = d
27
+ return runtime_readiness_probe_type_0
28
28
 
29
29
  @property
30
30
  def additional_keys(self) -> list[str]:
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -6,7 +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.store_agent_labels import StoreAgentLabels
9
+ from ..models.store_agent_labels_type_0 import StoreAgentLabelsType0
10
10
  from ..models.store_configuration import StoreConfiguration
11
11
 
12
12
 
@@ -26,7 +26,7 @@ class StoreAgent:
26
26
  description (Union[Unset, str]): Store agent description
27
27
  display_name (Union[Unset, str]): Store agent display name
28
28
  image (Union[Unset, str]): Store agent image
29
- labels (Union[Unset, StoreAgentLabels]): Store agent labels
29
+ labels (Union['StoreAgentLabelsType0', None, Unset]): Store agent labels
30
30
  name (Union[Unset, str]): Store agent name
31
31
  """
32
32
 
@@ -38,11 +38,13 @@ class StoreAgent:
38
38
  description: Union[Unset, str] = UNSET
39
39
  display_name: Union[Unset, str] = UNSET
40
40
  image: Union[Unset, str] = UNSET
41
- labels: Union[Unset, "StoreAgentLabels"] = UNSET
41
+ labels: Union["StoreAgentLabelsType0", None, Unset] = UNSET
42
42
  name: Union[Unset, str] = UNSET
43
43
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
44
44
 
45
45
  def to_dict(self) -> dict[str, Any]:
46
+ from ..models.store_agent_labels_type_0 import StoreAgentLabelsType0
47
+
46
48
  created_at = self.created_at
47
49
 
48
50
  created_by = self.created_by
@@ -64,9 +66,13 @@ class StoreAgent:
64
66
 
65
67
  image = self.image
66
68
 
67
- labels: Union[Unset, Dict[str, Any]] = UNSET
68
- if not isinstance(self.labels, Unset):
69
+ labels: Union[Dict[str, Any], None, Unset]
70
+ if isinstance(self.labels, Unset):
71
+ labels = UNSET
72
+ elif isinstance(self.labels, StoreAgentLabelsType0):
69
73
  labels = self.labels.to_dict()
74
+ else:
75
+ labels = self.labels
70
76
 
71
77
  name = self.name
72
78
 
@@ -98,7 +104,7 @@ class StoreAgent:
98
104
 
99
105
  @classmethod
100
106
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
101
- from ..models.store_agent_labels import StoreAgentLabels
107
+ from ..models.store_agent_labels_type_0 import StoreAgentLabelsType0
102
108
  from ..models.store_configuration import StoreConfiguration
103
109
 
104
110
  d = src_dict.copy()
@@ -123,12 +129,22 @@ class StoreAgent:
123
129
 
124
130
  image = d.pop("image", UNSET)
125
131
 
126
- _labels = d.pop("labels", UNSET)
127
- labels: Union[Unset, StoreAgentLabels]
128
- if isinstance(_labels, Unset):
129
- labels = UNSET
130
- else:
131
- labels = StoreAgentLabels.from_dict(_labels)
132
+ def _parse_labels(data: object) -> Union["StoreAgentLabelsType0", None, Unset]:
133
+ if data is None:
134
+ return data
135
+ if isinstance(data, Unset):
136
+ return data
137
+ try:
138
+ if not isinstance(data, dict):
139
+ raise TypeError()
140
+ labels_type_0 = StoreAgentLabelsType0.from_dict(data)
141
+
142
+ return labels_type_0
143
+ except: # noqa: E722
144
+ pass
145
+ return cast(Union["StoreAgentLabelsType0", None, Unset], data)
146
+
147
+ labels = _parse_labels(d.pop("labels", UNSET))
132
148
 
133
149
  name = d.pop("name", UNSET)
134
150
 
@@ -3,11 +3,11 @@ from typing import Any, Type, TypeVar
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- T = TypeVar("T", bound="StoreAgentLabels")
6
+ T = TypeVar("T", bound="StoreAgentLabelsType0")
7
7
 
8
8
 
9
9
  @_attrs_define
10
- class StoreAgentLabels:
10
+ class StoreAgentLabelsType0:
11
11
  """Store agent labels"""
12
12
 
13
13
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
@@ -21,10 +21,10 @@ class StoreAgentLabels:
21
21
  @classmethod
22
22
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
23
23
  d = src_dict.copy()
24
- store_agent_labels = cls()
24
+ store_agent_labels_type_0 = cls()
25
25
 
26
- store_agent_labels.additional_properties = d
27
- return store_agent_labels
26
+ store_agent_labels_type_0.additional_properties = d
27
+ return store_agent_labels_type_0
28
28
 
29
29
  @property
30
30
  def additional_keys(self) -> list[str]:
@@ -20,7 +20,7 @@ class StoreConfiguration:
20
20
  available_models (Union[Unset, List[str]]): Available models for the configuration
21
21
  description (Union[Unset, str]): Store configuration description
22
22
  display_name (Union[Unset, str]): Store configuration display name
23
- if_ (Union[Unset, str]): Conditional rendering for the configuration, example: provider === 'openai'
23
+ if_ (Union[None, Unset, str]): Conditional rendering for the configuration, example: provider === 'openai'
24
24
  name (Union[Unset, str]): Store configuration name
25
25
  options (Union[Unset, List['StoreConfigurationOption']]):
26
26
  required (Union[Unset, bool]): Store configuration required
@@ -31,7 +31,7 @@ class StoreConfiguration:
31
31
  available_models: Union[Unset, List[str]] = UNSET
32
32
  description: Union[Unset, str] = UNSET
33
33
  display_name: Union[Unset, str] = UNSET
34
- if_: Union[Unset, str] = UNSET
34
+ if_: Union[None, Unset, str] = UNSET
35
35
  name: Union[Unset, str] = UNSET
36
36
  options: Union[Unset, List["StoreConfigurationOption"]] = UNSET
37
37
  required: Union[Unset, bool] = UNSET
@@ -48,7 +48,11 @@ class StoreConfiguration:
48
48
 
49
49
  display_name = self.display_name
50
50
 
51
- if_ = self.if_
51
+ if_: Union[None, Unset, str]
52
+ if isinstance(self.if_, Unset):
53
+ if_ = UNSET
54
+ else:
55
+ if_ = self.if_
52
56
 
53
57
  name = self.name
54
58
 
@@ -100,7 +104,14 @@ class StoreConfiguration:
100
104
 
101
105
  display_name = d.pop("display_name", UNSET)
102
106
 
103
- if_ = d.pop("if", UNSET)
107
+ def _parse_if_(data: object) -> Union[None, Unset, str]:
108
+ if data is None:
109
+ return data
110
+ if isinstance(data, Unset):
111
+ return data
112
+ return cast(Union[None, Unset, str], data)
113
+
114
+ if_ = _parse_if_(d.pop("if", UNSET))
104
115
 
105
116
  name = d.pop("name", UNSET)
106
117
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union
1
+ from typing import Any, Type, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -13,18 +13,23 @@ class StoreConfigurationOption:
13
13
  """Store configuration options for a select type configuration
14
14
 
15
15
  Attributes:
16
- if_ (Union[Unset, str]): Conditional rendering for the configuration option, example: provider === 'openai'
16
+ if_ (Union[None, Unset, str]): Conditional rendering for the configuration option, example: provider ===
17
+ 'openai'
17
18
  label (Union[Unset, str]): Store configuration option label
18
19
  value (Union[Unset, str]): Store configuration option value
19
20
  """
20
21
 
21
- if_: Union[Unset, str] = UNSET
22
+ if_: Union[None, Unset, str] = UNSET
22
23
  label: Union[Unset, str] = UNSET
23
24
  value: Union[Unset, str] = UNSET
24
25
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
26
 
26
27
  def to_dict(self) -> dict[str, Any]:
27
- if_ = self.if_
28
+ if_: Union[None, Unset, str]
29
+ if isinstance(self.if_, Unset):
30
+ if_ = UNSET
31
+ else:
32
+ if_ = self.if_
28
33
 
29
34
  label = self.label
30
35
 
@@ -45,7 +50,15 @@ class StoreConfigurationOption:
45
50
  @classmethod
46
51
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
47
52
  d = src_dict.copy()
48
- if_ = d.pop("if", UNSET)
53
+
54
+ def _parse_if_(data: object) -> Union[None, Unset, str]:
55
+ if data is None:
56
+ return data
57
+ if isinstance(data, Unset):
58
+ return data
59
+ return cast(Union[None, Unset, str], data)
60
+
61
+ if_ = _parse_if_(d.pop("if", UNSET))
49
62
 
50
63
  label = d.pop("label", UNSET)
51
64
 
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -8,7 +8,7 @@ from ..types import UNSET, Unset
8
8
  if TYPE_CHECKING:
9
9
  from ..models.store_configuration import StoreConfiguration
10
10
  from ..models.store_function_kit import StoreFunctionKit
11
- from ..models.store_function_labels import StoreFunctionLabels
11
+ from ..models.store_function_labels_type_0 import StoreFunctionLabelsType0
12
12
  from ..models.store_function_parameter import StoreFunctionParameter
13
13
 
14
14
 
@@ -29,7 +29,7 @@ class StoreFunction:
29
29
  display_name (Union[Unset, str]): Store function display name
30
30
  image (Union[Unset, str]): Store function image
31
31
  kit (Union[Unset, List['StoreFunctionKit']]): Store function kit
32
- labels (Union[Unset, StoreFunctionLabels]): Store function labels
32
+ labels (Union['StoreFunctionLabelsType0', None, Unset]): Store function labels
33
33
  name (Union[Unset, str]): Store function name
34
34
  parameters (Union[Unset, List['StoreFunctionParameter']]): Store function parameters
35
35
  """
@@ -43,12 +43,14 @@ class StoreFunction:
43
43
  display_name: Union[Unset, str] = UNSET
44
44
  image: Union[Unset, str] = UNSET
45
45
  kit: Union[Unset, List["StoreFunctionKit"]] = UNSET
46
- labels: Union[Unset, "StoreFunctionLabels"] = UNSET
46
+ labels: Union["StoreFunctionLabelsType0", None, Unset] = UNSET
47
47
  name: Union[Unset, str] = UNSET
48
48
  parameters: Union[Unset, List["StoreFunctionParameter"]] = UNSET
49
49
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
50
50
 
51
51
  def to_dict(self) -> dict[str, Any]:
52
+ from ..models.store_function_labels_type_0 import StoreFunctionLabelsType0
53
+
52
54
  created_at = self.created_at
53
55
 
54
56
  created_by = self.created_by
@@ -77,9 +79,13 @@ class StoreFunction:
77
79
  kit_item = kit_item_data.to_dict()
78
80
  kit.append(kit_item)
79
81
 
80
- labels: Union[Unset, Dict[str, Any]] = UNSET
81
- if not isinstance(self.labels, Unset):
82
+ labels: Union[Dict[str, Any], None, Unset]
83
+ if isinstance(self.labels, Unset):
84
+ labels = UNSET
85
+ elif isinstance(self.labels, StoreFunctionLabelsType0):
82
86
  labels = self.labels.to_dict()
87
+ else:
88
+ labels = self.labels
83
89
 
84
90
  name = self.name
85
91
 
@@ -124,7 +130,7 @@ class StoreFunction:
124
130
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
125
131
  from ..models.store_configuration import StoreConfiguration
126
132
  from ..models.store_function_kit import StoreFunctionKit
127
- from ..models.store_function_labels import StoreFunctionLabels
133
+ from ..models.store_function_labels_type_0 import StoreFunctionLabelsType0
128
134
  from ..models.store_function_parameter import StoreFunctionParameter
129
135
 
130
136
  d = src_dict.copy()
@@ -156,12 +162,22 @@ class StoreFunction:
156
162
 
157
163
  kit.append(kit_item)
158
164
 
159
- _labels = d.pop("labels", UNSET)
160
- labels: Union[Unset, StoreFunctionLabels]
161
- if isinstance(_labels, Unset):
162
- labels = UNSET
163
- else:
164
- labels = StoreFunctionLabels.from_dict(_labels)
165
+ def _parse_labels(data: object) -> Union["StoreFunctionLabelsType0", None, Unset]:
166
+ if data is None:
167
+ return data
168
+ if isinstance(data, Unset):
169
+ return data
170
+ try:
171
+ if not isinstance(data, dict):
172
+ raise TypeError()
173
+ labels_type_0 = StoreFunctionLabelsType0.from_dict(data)
174
+
175
+ return labels_type_0
176
+ except: # noqa: E722
177
+ pass
178
+ return cast(Union["StoreFunctionLabelsType0", None, Unset], data)
179
+
180
+ labels = _parse_labels(d.pop("labels", UNSET))
165
181
 
166
182
  name = d.pop("name", UNSET)
167
183
 
@@ -3,11 +3,11 @@ from typing import Any, Type, TypeVar
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- T = TypeVar("T", bound="StoreFunctionLabels")
6
+ T = TypeVar("T", bound="StoreFunctionLabelsType0")
7
7
 
8
8
 
9
9
  @_attrs_define
10
- class StoreFunctionLabels:
10
+ class StoreFunctionLabelsType0:
11
11
  """Store function labels"""
12
12
 
13
13
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
@@ -21,10 +21,10 @@ class StoreFunctionLabels:
21
21
  @classmethod
22
22
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
23
23
  d = src_dict.copy()
24
- store_function_labels = cls()
24
+ store_function_labels_type_0 = cls()
25
25
 
26
- store_function_labels.additional_properties = d
27
- return store_function_labels
26
+ store_function_labels_type_0.additional_properties = d
27
+ return store_function_labels_type_0
28
28
 
29
29
  @property
30
30
  def additional_keys(self) -> list[str]:
beamlit/run.py ADDED
@@ -0,0 +1,49 @@
1
+ import urllib.parse
2
+ from contextlib import contextmanager
3
+ from typing import Any, Callable, Dict, List, Optional
4
+
5
+ import requests
6
+ from beamlit.client import AuthenticatedClient
7
+ from beamlit.common.settings import get_settings
8
+
9
+
10
+ class RunClient:
11
+ def __init__(self, client: AuthenticatedClient):
12
+ self.client = client
13
+
14
+ def run(
15
+ self,
16
+ resource_type: str,
17
+ resource_name: str,
18
+ environment: str,
19
+ method: str,
20
+ path: str = "",
21
+ headers: Optional[Dict[str, str]] = None,
22
+ json: Optional[Dict[str, Any]] = None,
23
+ data: Optional[str] = None,
24
+ params: Optional[Dict[str, str]] = None,
25
+ ) -> requests.Response:
26
+ settings = get_settings()
27
+ headers = headers or {}
28
+ params = params or {}
29
+
30
+ # Build the path
31
+ if path:
32
+ path = f"{settings.workspace}/{resource_type}s/{resource_name}/{path}"
33
+ else:
34
+ path = f"{settings.workspace}/{resource_type}s/{resource_name}"
35
+
36
+ client = self.client.get_httpx_client()
37
+ url = urllib.parse.urljoin(settings.run_url, path)
38
+
39
+ kwargs = {
40
+ "headers": headers,
41
+ "params": {"environment": environment, **params},
42
+ }
43
+ if data:
44
+ kwargs["data"] = data
45
+ if json:
46
+ kwargs["json"] = json
47
+
48
+ response = client.request(method, url, **kwargs)
49
+ return response
@@ -1,13 +1,16 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: beamlit
3
- Version: 0.0.19
3
+ Version: 0.0.20rc2
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12
7
7
  Requires-Dist: attrs>=21.3.0
8
8
  Requires-Dist: httpx<0.28.0,>=0.20.0
9
+ Requires-Dist: pydantic-settings<2.7.0,>=2.6.1
10
+ Requires-Dist: pydantic<2.11.0,>=2.10.3
9
11
  Requires-Dist: python-dateutil>=2.8.0
10
- Requires-Dist: pyyaml==6.0.2
12
+ Requires-Dist: pyyaml<6.1.0,>=6.0.2
13
+ Requires-Dist: requests<2.33.0,>=2.32.3
11
14
  Description-Content-Type: text/markdown
12
15
 
13
16
  # beamlit