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
@@ -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
@@ -37,7 +37,9 @@ class ResourceLog:
37
37
  return field_dict
38
38
 
39
39
  @classmethod
40
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
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
  message = d.pop("message", UNSET)
43
45
 
beamlit/models/runtime.py CHANGED
@@ -23,10 +23,12 @@ class Runtime:
23
23
  envs (Union[Unset, list[Any]]): The environment variables to set in the deployment. Should be a list of
24
24
  Kubernetes EnvVar types
25
25
  image (Union[Unset, str]): The Docker image for the deployment
26
+ metric_port (Union[Unset, int]): The port to serve the metrics on
26
27
  model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
27
28
  readiness_probe (Union[Unset, RuntimeReadinessProbe]): The readiness probe. Should be a Kubernetes Probe type
28
29
  resources (Union[Unset, RuntimeResources]): The resources for the deployment. Should be a Kubernetes
29
30
  ResourceRequirements type
31
+ serving_port (Union[Unset, int]): The port to serve the model on
30
32
  type_ (Union[Unset, str]): The type of origin for the deployment
31
33
  """
32
34
 
@@ -34,9 +36,11 @@ class Runtime:
34
36
  command: Union[Unset, list[Any]] = UNSET
35
37
  envs: Union[Unset, list[Any]] = UNSET
36
38
  image: Union[Unset, str] = UNSET
39
+ metric_port: Union[Unset, int] = UNSET
37
40
  model: Union[Unset, str] = UNSET
38
41
  readiness_probe: Union[Unset, "RuntimeReadinessProbe"] = UNSET
39
42
  resources: Union[Unset, "RuntimeResources"] = UNSET
43
+ serving_port: Union[Unset, int] = UNSET
40
44
  type_: Union[Unset, str] = UNSET
41
45
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
42
46
 
@@ -55,6 +59,8 @@ class Runtime:
55
59
 
56
60
  image = self.image
57
61
 
62
+ metric_port = self.metric_port
63
+
58
64
  model = self.model
59
65
 
60
66
  readiness_probe: Union[Unset, dict[str, Any]] = UNSET
@@ -65,6 +71,8 @@ class Runtime:
65
71
  if not isinstance(self.resources, Unset):
66
72
  resources = self.resources.to_dict()
67
73
 
74
+ serving_port = self.serving_port
75
+
68
76
  type_ = self.type_
69
77
 
70
78
  field_dict: dict[str, Any] = {}
@@ -78,12 +86,16 @@ class Runtime:
78
86
  field_dict["envs"] = envs
79
87
  if image is not UNSET:
80
88
  field_dict["image"] = image
89
+ if metric_port is not UNSET:
90
+ field_dict["metricPort"] = metric_port
81
91
  if model is not UNSET:
82
92
  field_dict["model"] = model
83
93
  if readiness_probe is not UNSET:
84
- field_dict["readiness_probe"] = readiness_probe
94
+ field_dict["readinessProbe"] = readiness_probe
85
95
  if resources is not UNSET:
86
96
  field_dict["resources"] = resources
97
+ if serving_port is not UNSET:
98
+ field_dict["servingPort"] = serving_port
87
99
  if type_ is not UNSET:
88
100
  field_dict["type"] = type_
89
101
 
@@ -105,9 +117,11 @@ class Runtime:
105
117
 
106
118
  image = d.pop("image", UNSET)
107
119
 
120
+ metric_port = d.pop("metricPort", UNSET)
121
+
108
122
  model = d.pop("model", UNSET)
109
123
 
110
- _readiness_probe = d.pop("readiness_probe", UNSET)
124
+ _readiness_probe = d.pop("readinessProbe", UNSET)
111
125
  readiness_probe: Union[Unset, RuntimeReadinessProbe]
112
126
  if isinstance(_readiness_probe, Unset):
113
127
  readiness_probe = UNSET
@@ -121,6 +135,8 @@ class Runtime:
121
135
  else:
122
136
  resources = RuntimeResources.from_dict(_resources)
123
137
 
138
+ serving_port = d.pop("servingPort", UNSET)
139
+
124
140
  type_ = d.pop("type", UNSET)
125
141
 
126
142
  runtime = cls(
@@ -128,9 +144,11 @@ class Runtime:
128
144
  command=command,
129
145
  envs=envs,
130
146
  image=image,
147
+ metric_port=metric_port,
131
148
  model=model,
132
149
  readiness_probe=readiness_probe,
133
150
  resources=resources,
151
+ serving_port=serving_port,
134
152
  type_=type_,
135
153
  )
136
154
 
@@ -10,17 +10,24 @@ T = TypeVar("T", bound="ServerlessConfig")
10
10
 
11
11
  @_attrs_define
12
12
  class ServerlessConfig:
13
- """Configuration for the serverless model deployment
13
+ """Configuration for a serverless deployment
14
14
 
15
15
  Attributes:
16
- last_pod_retention_period (Union[Unset, str]): The last pod retention period
17
- max_num_replicas (Union[Unset, int]): The maximum number of replicas
18
- metric (Union[Unset, str]): Metric to scale on, can be "cpu" or "memory" or "rps" or "concurrency"
19
- min_num_replicas (Union[Unset, int]): The minimum number of replicas
20
- scale_down_delay (Union[Unset, str]): The scale down delay
21
- scale_up_minimum (Union[Unset, int]): The scale up minimum
22
- stable_window (Union[Unset, str]): The stable window
23
- target (Union[Unset, str]): Target value for the metric
16
+ last_pod_retention_period (Union[Unset, str]): The minimum amount of time that the last replica will remain
17
+ active AFTER a scale-to-zero decision is made
18
+ max_num_replicas (Union[Unset, int]): The maximum number of replicas for the deployment.
19
+ metric (Union[Unset, str]): Metric watched to make scaling decisions. Can be "cpu" or "memory" or "rps" or
20
+ "concurrency"
21
+ min_num_replicas (Union[Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in which
22
+ case the deployment is always running in at least one location).
23
+ scale_down_delay (Union[Unset, str]): The time window which must pass at reduced concurrency before a scale-down
24
+ decision is applied. This can be useful, for example, to keep containers around for a configurable duration to
25
+ avoid a cold start penalty if new requests come in.
26
+ scale_up_minimum (Union[Unset, int]): The minimum number of replicas that will be created when the deployment
27
+ scales up from zero.
28
+ stable_window (Union[Unset, str]): The sliding time window over which metrics are averaged to provide the input
29
+ for scaling decisions
30
+ target (Union[Unset, str]): Target value for the watched metric
24
31
  """
25
32
 
26
33
  last_pod_retention_period: Union[Unset, str] = UNSET
@@ -54,19 +61,19 @@ class ServerlessConfig:
54
61
  field_dict.update(self.additional_properties)
55
62
  field_dict.update({})
56
63
  if last_pod_retention_period is not UNSET:
57
- field_dict["last_pod_retention_period"] = last_pod_retention_period
64
+ field_dict["lastPodRetentionPeriod"] = last_pod_retention_period
58
65
  if max_num_replicas is not UNSET:
59
- field_dict["max_num_replicas"] = max_num_replicas
66
+ field_dict["maxNumReplicas"] = max_num_replicas
60
67
  if metric is not UNSET:
61
68
  field_dict["metric"] = metric
62
69
  if min_num_replicas is not UNSET:
63
- field_dict["min_num_replicas"] = min_num_replicas
70
+ field_dict["minNumReplicas"] = min_num_replicas
64
71
  if scale_down_delay is not UNSET:
65
- field_dict["scale_down_delay"] = scale_down_delay
72
+ field_dict["scaleDownDelay"] = scale_down_delay
66
73
  if scale_up_minimum is not UNSET:
67
- field_dict["scale_up_minimum"] = scale_up_minimum
74
+ field_dict["scaleUpMinimum"] = scale_up_minimum
68
75
  if stable_window is not UNSET:
69
- field_dict["stable_window"] = stable_window
76
+ field_dict["stableWindow"] = stable_window
70
77
  if target is not UNSET:
71
78
  field_dict["target"] = target
72
79
 
@@ -77,19 +84,19 @@ class ServerlessConfig:
77
84
  if not src_dict:
78
85
  return None
79
86
  d = src_dict.copy()
80
- last_pod_retention_period = d.pop("last_pod_retention_period", UNSET)
87
+ last_pod_retention_period = d.pop("lastPodRetentionPeriod", UNSET)
81
88
 
82
- max_num_replicas = d.pop("max_num_replicas", UNSET)
89
+ max_num_replicas = d.pop("maxNumReplicas", UNSET)
83
90
 
84
91
  metric = d.pop("metric", UNSET)
85
92
 
86
- min_num_replicas = d.pop("min_num_replicas", UNSET)
93
+ min_num_replicas = d.pop("minNumReplicas", UNSET)
87
94
 
88
- scale_down_delay = d.pop("scale_down_delay", UNSET)
95
+ scale_down_delay = d.pop("scaleDownDelay", UNSET)
89
96
 
90
- scale_up_minimum = d.pop("scale_up_minimum", UNSET)
97
+ scale_up_minimum = d.pop("scaleUpMinimum", UNSET)
91
98
 
92
- stable_window = d.pop("stable_window", UNSET)
99
+ stable_window = d.pop("stableWindow", UNSET)
93
100
 
94
101
  target = d.pop("target", UNSET)
95
102
 
@@ -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
@@ -10,11 +10,11 @@ T = TypeVar("T", bound="SpecConfiguration")
10
10
 
11
11
  @_attrs_define
12
12
  class SpecConfiguration:
13
- """Agent configuration, this is a key value storage. In your agent you can retrieve the value with config[key]
13
+ """Configuration, this is a key value storage. In your object you can retrieve the value with config[key]
14
14
 
15
15
  Attributes:
16
- secret (Union[Unset, bool]): Agent configuration secret
17
- value (Union[Unset, str]): Agent configuration value
16
+ secret (Union[Unset, bool]): ACconfiguration secret
17
+ value (Union[Unset, str]): Configuration value
18
18
  """
19
19
 
20
20
  secret: Union[Unset, bool] = UNSET
@@ -37,7 +37,9 @@ class SpecConfiguration:
37
37
  return field_dict
38
38
 
39
39
  @classmethod
40
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
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
  secret = d.pop("secret", UNSET)
43
45
 
@@ -19,8 +19,8 @@ class StoreAgent:
19
19
 
20
20
  Attributes:
21
21
  created_at (Union[Unset, str]): The date and time when the resource was created
22
- created_by (Union[Unset, str]): The user or service account who created the resource
23
22
  updated_at (Union[Unset, str]): The date and time when the resource was updated
23
+ created_by (Union[Unset, str]): The user or service account who created the resource
24
24
  updated_by (Union[Unset, str]): The user or service account who updated the resource
25
25
  configuration (Union[Unset, list['StoreConfiguration']]): Store agent configuration
26
26
  description (Union[Unset, str]): Store agent description
@@ -31,8 +31,8 @@ class StoreAgent:
31
31
  """
32
32
 
33
33
  created_at: Union[Unset, str] = UNSET
34
- created_by: Union[Unset, str] = UNSET
35
34
  updated_at: Union[Unset, str] = UNSET
35
+ created_by: Union[Unset, str] = UNSET
36
36
  updated_by: Union[Unset, str] = UNSET
37
37
  configuration: Union[Unset, list["StoreConfiguration"]] = UNSET
38
38
  description: Union[Unset, str] = UNSET
@@ -45,10 +45,10 @@ class StoreAgent:
45
45
  def to_dict(self) -> dict[str, Any]:
46
46
  created_at = self.created_at
47
47
 
48
- created_by = self.created_by
49
-
50
48
  updated_at = self.updated_at
51
49
 
50
+ created_by = self.created_by
51
+
52
52
  updated_by = self.updated_by
53
53
 
54
54
  configuration: Union[Unset, list[dict[str, Any]]] = UNSET
@@ -74,13 +74,13 @@ class StoreAgent:
74
74
  field_dict.update(self.additional_properties)
75
75
  field_dict.update({})
76
76
  if created_at is not UNSET:
77
- field_dict["created_at"] = created_at
78
- if created_by is not UNSET:
79
- field_dict["created_by"] = created_by
77
+ field_dict["createdAt"] = created_at
80
78
  if updated_at is not UNSET:
81
- field_dict["updated_at"] = updated_at
79
+ field_dict["updatedAt"] = updated_at
80
+ if created_by is not UNSET:
81
+ field_dict["createdBy"] = created_by
82
82
  if updated_by is not UNSET:
83
- field_dict["updated_by"] = updated_by
83
+ field_dict["updatedBy"] = updated_by
84
84
  if configuration is not UNSET:
85
85
  field_dict["configuration"] = configuration
86
86
  if description is not UNSET:
@@ -104,13 +104,13 @@ class StoreAgent:
104
104
  if not src_dict:
105
105
  return None
106
106
  d = src_dict.copy()
107
- created_at = d.pop("created_at", UNSET)
107
+ created_at = d.pop("createdAt", UNSET)
108
108
 
109
- created_by = d.pop("created_by", UNSET)
109
+ updated_at = d.pop("updatedAt", UNSET)
110
110
 
111
- updated_at = d.pop("updated_at", UNSET)
111
+ created_by = d.pop("createdBy", UNSET)
112
112
 
113
- updated_by = d.pop("updated_by", UNSET)
113
+ updated_by = d.pop("updatedBy", UNSET)
114
114
 
115
115
  configuration = []
116
116
  _configuration = d.pop("configuration", UNSET)
@@ -136,8 +136,8 @@ class StoreAgent:
136
136
 
137
137
  store_agent = cls(
138
138
  created_at=created_at,
139
- created_by=created_by,
140
139
  updated_at=updated_at,
140
+ created_by=created_by,
141
141
  updated_by=updated_by,
142
142
  configuration=configuration,
143
143
  description=description,
@@ -21,8 +21,8 @@ class StoreFunction:
21
21
 
22
22
  Attributes:
23
23
  created_at (Union[Unset, str]): The date and time when the resource was created
24
- created_by (Union[Unset, str]): The user or service account who created the resource
25
24
  updated_at (Union[Unset, str]): The date and time when the resource was updated
25
+ created_by (Union[Unset, str]): The user or service account who created the resource
26
26
  updated_by (Union[Unset, str]): The user or service account who updated the resource
27
27
  configuration (Union[Unset, list['StoreConfiguration']]): Store function configuration
28
28
  description (Union[Unset, str]): Store function description
@@ -35,8 +35,8 @@ class StoreFunction:
35
35
  """
36
36
 
37
37
  created_at: Union[Unset, str] = UNSET
38
- created_by: Union[Unset, str] = UNSET
39
38
  updated_at: Union[Unset, str] = UNSET
39
+ created_by: Union[Unset, str] = UNSET
40
40
  updated_by: Union[Unset, str] = UNSET
41
41
  configuration: Union[Unset, list["StoreConfiguration"]] = UNSET
42
42
  description: Union[Unset, str] = UNSET
@@ -51,10 +51,10 @@ class StoreFunction:
51
51
  def to_dict(self) -> dict[str, Any]:
52
52
  created_at = self.created_at
53
53
 
54
- created_by = self.created_by
55
-
56
54
  updated_at = self.updated_at
57
55
 
56
+ created_by = self.created_by
57
+
58
58
  updated_by = self.updated_by
59
59
 
60
60
  configuration: Union[Unset, list[dict[str, Any]]] = UNSET
@@ -94,13 +94,13 @@ class StoreFunction:
94
94
  field_dict.update(self.additional_properties)
95
95
  field_dict.update({})
96
96
  if created_at is not UNSET:
97
- field_dict["created_at"] = created_at
98
- if created_by is not UNSET:
99
- field_dict["created_by"] = created_by
97
+ field_dict["createdAt"] = created_at
100
98
  if updated_at is not UNSET:
101
- field_dict["updated_at"] = updated_at
99
+ field_dict["updatedAt"] = updated_at
100
+ if created_by is not UNSET:
101
+ field_dict["createdBy"] = created_by
102
102
  if updated_by is not UNSET:
103
- field_dict["updated_by"] = updated_by
103
+ field_dict["updatedBy"] = updated_by
104
104
  if configuration is not UNSET:
105
105
  field_dict["configuration"] = configuration
106
106
  if description is not UNSET:
@@ -130,13 +130,13 @@ class StoreFunction:
130
130
  if not src_dict:
131
131
  return None
132
132
  d = src_dict.copy()
133
- created_at = d.pop("created_at", UNSET)
133
+ created_at = d.pop("createdAt", UNSET)
134
134
 
135
- created_by = d.pop("created_by", UNSET)
135
+ updated_at = d.pop("updatedAt", UNSET)
136
136
 
137
- updated_at = d.pop("updated_at", UNSET)
137
+ created_by = d.pop("createdBy", UNSET)
138
138
 
139
- updated_by = d.pop("updated_by", UNSET)
139
+ updated_by = d.pop("updatedBy", UNSET)
140
140
 
141
141
  configuration = []
142
142
  _configuration = d.pop("configuration", UNSET)
@@ -176,8 +176,8 @@ class StoreFunction:
176
176
 
177
177
  store_function = cls(
178
178
  created_at=created_at,
179
- created_by=created_by,
180
179
  updated_at=updated_at,
180
+ created_by=created_by,
181
181
  updated_by=updated_by,
182
182
  configuration=configuration,
183
183
  description=description,
@@ -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
@@ -37,7 +37,9 @@ class TimeFields:
37
37
  return field_dict
38
38
 
39
39
  @classmethod
40
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
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
  created_at = d.pop("createdAt", UNSET)
43
45
 
@@ -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
@@ -49,7 +49,9 @@ class WebsocketChannel:
49
49
  return field_dict
50
50
 
51
51
  @classmethod
52
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
52
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
53
+ if not src_dict:
54
+ return None
53
55
  d = src_dict.copy()
54
56
  created_at = d.pop("createdAt", UNSET)
55
57
 
@@ -18,30 +18,32 @@ class Workspace:
18
18
 
19
19
  Attributes:
20
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
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
23
  updated_by (Union[Unset, str]): The user or service account who updated the resource
24
24
  display_name (Union[Unset, str]): Workspace display name
25
25
  labels (Union[Unset, WorkspaceLabels]): Workspace labels
26
26
  name (Union[Unset, str]): Workspace name
27
+ write_region (Union[Unset, str]): Workspace write region
27
28
  """
28
29
 
29
30
  created_at: Union[Unset, str] = UNSET
30
- created_by: Union[Unset, str] = UNSET
31
31
  updated_at: Union[Unset, str] = UNSET
32
+ created_by: Union[Unset, str] = UNSET
32
33
  updated_by: Union[Unset, str] = UNSET
33
34
  display_name: Union[Unset, str] = UNSET
34
35
  labels: Union[Unset, "WorkspaceLabels"] = UNSET
35
36
  name: Union[Unset, str] = UNSET
37
+ write_region: Union[Unset, str] = UNSET
36
38
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
39
 
38
40
  def to_dict(self) -> dict[str, Any]:
39
41
  created_at = self.created_at
40
42
 
41
- created_by = self.created_by
42
-
43
43
  updated_at = self.updated_at
44
44
 
45
+ created_by = self.created_by
46
+
45
47
  updated_by = self.updated_by
46
48
 
47
49
  display_name = self.display_name
@@ -52,23 +54,27 @@ class Workspace:
52
54
 
53
55
  name = self.name
54
56
 
57
+ write_region = self.write_region
58
+
55
59
  field_dict: dict[str, Any] = {}
56
60
  field_dict.update(self.additional_properties)
57
61
  field_dict.update({})
58
62
  if created_at is not UNSET:
59
- field_dict["created_at"] = created_at
60
- if created_by is not UNSET:
61
- field_dict["created_by"] = created_by
63
+ field_dict["createdAt"] = created_at
62
64
  if updated_at is not UNSET:
63
- field_dict["updated_at"] = updated_at
65
+ field_dict["updatedAt"] = updated_at
66
+ if created_by is not UNSET:
67
+ field_dict["createdBy"] = created_by
64
68
  if updated_by is not UNSET:
65
- field_dict["updated_by"] = updated_by
69
+ field_dict["updatedBy"] = updated_by
66
70
  if display_name is not UNSET:
67
71
  field_dict["display_name"] = display_name
68
72
  if labels is not UNSET:
69
73
  field_dict["labels"] = labels
70
74
  if name is not UNSET:
71
75
  field_dict["name"] = name
76
+ if write_region is not UNSET:
77
+ field_dict["writeRegion"] = write_region
72
78
 
73
79
  return field_dict
74
80
 
@@ -79,13 +85,13 @@ class Workspace:
79
85
  if not src_dict:
80
86
  return None
81
87
  d = src_dict.copy()
82
- created_at = d.pop("created_at", UNSET)
88
+ created_at = d.pop("createdAt", UNSET)
83
89
 
84
- created_by = d.pop("created_by", UNSET)
90
+ updated_at = d.pop("updatedAt", UNSET)
85
91
 
86
- updated_at = d.pop("updated_at", UNSET)
92
+ created_by = d.pop("createdBy", UNSET)
87
93
 
88
- updated_by = d.pop("updated_by", UNSET)
94
+ updated_by = d.pop("updatedBy", UNSET)
89
95
 
90
96
  display_name = d.pop("display_name", UNSET)
91
97
 
@@ -98,14 +104,17 @@ class Workspace:
98
104
 
99
105
  name = d.pop("name", UNSET)
100
106
 
107
+ write_region = d.pop("writeRegion", UNSET)
108
+
101
109
  workspace = cls(
102
110
  created_at=created_at,
103
- created_by=created_by,
104
111
  updated_at=updated_at,
112
+ created_by=created_by,
105
113
  updated_by=updated_by,
106
114
  display_name=display_name,
107
115
  labels=labels,
108
116
  name=name,
117
+ write_region=write_region,
109
118
  )
110
119
 
111
120
  workspace.additional_properties = d
beamlit/run.py CHANGED
@@ -2,7 +2,6 @@ import urllib.parse
2
2
  from typing import Any
3
3
 
4
4
  import requests
5
-
6
5
  from beamlit.client import AuthenticatedClient
7
6
  from beamlit.common.settings import get_settings
8
7
 
beamlit/serve/app.py CHANGED
@@ -16,6 +16,7 @@ from .middlewares import AccessLogMiddleware, AddProcessTimeHeader
16
16
  sys.path.insert(0, os.getcwd())
17
17
  sys.path.insert(0, os.path.join(os.getcwd(), "src"))
18
18
 
19
+
19
20
  def import_module():
20
21
  settings = get_settings()
21
22
  main_module = importlib.import_module(".".join(settings.server.module.split(".")[0:-1]))
@@ -10,5 +10,7 @@ class AccessLogMiddleware(BaseHTTPMiddleware):
10
10
  process_time = response.headers.get("X-Process-Time")
11
11
  rid_header = response.headers.get("X-Request-Id")
12
12
  request_id = rid_header or response.headers.get("X-Beamlit-Request-Id")
13
- logger.info(f"{request.method} {request.url.path} {response.status_code} {process_time}ms rid={request_id}")
13
+ logger.info(
14
+ f"{request.method} {request.url.path} {response.status_code} {process_time}ms rid={request_id}"
15
+ )
14
16
  return response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.24rc20
3
+ Version: 0.0.24rc21
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12