beamlit 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. beamlit-0.1.0/.gitignore +23 -0
  2. beamlit-0.1.0/PKG-INFO +59 -0
  3. beamlit-0.1.0/README.md +47 -0
  4. beamlit-0.1.0/pyproject.toml +19 -0
  5. beamlit-0.1.0/src/beamlit/__init__.py +8 -0
  6. beamlit-0.1.0/src/beamlit/api/__init__.py +1 -0
  7. beamlit-0.1.0/src/beamlit/api/agents/__init__.py +0 -0
  8. beamlit-0.1.0/src/beamlit/api/agents/create_agent.py +155 -0
  9. beamlit-0.1.0/src/beamlit/api/agents/create_agent_release.py +146 -0
  10. beamlit-0.1.0/src/beamlit/api/agents/delete_agent.py +146 -0
  11. beamlit-0.1.0/src/beamlit/api/agents/delete_agent_deployment.py +163 -0
  12. beamlit-0.1.0/src/beamlit/api/agents/delete_agent_deployment_history.py +172 -0
  13. beamlit-0.1.0/src/beamlit/api/agents/get_agent.py +146 -0
  14. beamlit-0.1.0/src/beamlit/api/agents/get_agent_deployment.py +163 -0
  15. beamlit-0.1.0/src/beamlit/api/agents/get_agent_deployment_history.py +172 -0
  16. beamlit-0.1.0/src/beamlit/api/agents/get_agent_deployment_logs.py +164 -0
  17. beamlit-0.1.0/src/beamlit/api/agents/get_agent_deployment_metrics.py +159 -0
  18. beamlit-0.1.0/src/beamlit/api/agents/get_agent_metrics.py +150 -0
  19. beamlit-0.1.0/src/beamlit/api/agents/list_agent_deployment_history.py +164 -0
  20. beamlit-0.1.0/src/beamlit/api/agents/list_agent_deployments.py +155 -0
  21. beamlit-0.1.0/src/beamlit/api/agents/list_agents.py +127 -0
  22. beamlit-0.1.0/src/beamlit/api/agents/put_agent_deployment.py +185 -0
  23. beamlit-0.1.0/src/beamlit/api/agents/put_agent_deployment_history.py +198 -0
  24. beamlit-0.1.0/src/beamlit/api/agents/update_agent.py +168 -0
  25. beamlit-0.1.0/src/beamlit/api/authentication_providers/__init__.py +0 -0
  26. beamlit-0.1.0/src/beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +184 -0
  27. beamlit-0.1.0/src/beamlit/api/authentication_providers/list_models_for_authentication_provider.py +163 -0
  28. beamlit-0.1.0/src/beamlit/api/authentication_providers/list_organizations_for_authentication_provider.py +163 -0
  29. beamlit-0.1.0/src/beamlit/api/configurations/__init__.py +0 -0
  30. beamlit-0.1.0/src/beamlit/api/configurations/get_configuration.py +122 -0
  31. beamlit-0.1.0/src/beamlit/api/environments/__init__.py +0 -0
  32. beamlit-0.1.0/src/beamlit/api/environments/create_environment.py +167 -0
  33. beamlit-0.1.0/src/beamlit/api/environments/delete_environment.py +154 -0
  34. beamlit-0.1.0/src/beamlit/api/environments/get_environment.py +154 -0
  35. beamlit-0.1.0/src/beamlit/api/environments/get_environment_metrics.py +158 -0
  36. beamlit-0.1.0/src/beamlit/api/environments/list_environments.py +139 -0
  37. beamlit-0.1.0/src/beamlit/api/environments/update_environment.py +180 -0
  38. beamlit-0.1.0/src/beamlit/api/functions/__init__.py +0 -0
  39. beamlit-0.1.0/src/beamlit/api/functions/create_function.py +155 -0
  40. beamlit-0.1.0/src/beamlit/api/functions/create_function_release.py +150 -0
  41. beamlit-0.1.0/src/beamlit/api/functions/delete_function.py +146 -0
  42. beamlit-0.1.0/src/beamlit/api/functions/delete_function_deployment.py +163 -0
  43. beamlit-0.1.0/src/beamlit/api/functions/get_function.py +146 -0
  44. beamlit-0.1.0/src/beamlit/api/functions/get_function_deployment.py +163 -0
  45. beamlit-0.1.0/src/beamlit/api/functions/get_function_deployment_logs.py +164 -0
  46. beamlit-0.1.0/src/beamlit/api/functions/get_function_deployment_metrics.py +159 -0
  47. beamlit-0.1.0/src/beamlit/api/functions/get_function_metrics.py +150 -0
  48. beamlit-0.1.0/src/beamlit/api/functions/list_function_deployments.py +155 -0
  49. beamlit-0.1.0/src/beamlit/api/functions/list_functions.py +131 -0
  50. beamlit-0.1.0/src/beamlit/api/functions/put_function_deployment.py +185 -0
  51. beamlit-0.1.0/src/beamlit/api/functions/update_function.py +168 -0
  52. beamlit-0.1.0/src/beamlit/api/history/__init__.py +0 -0
  53. beamlit-0.1.0/src/beamlit/api/history/get_agents_history.py +155 -0
  54. beamlit-0.1.0/src/beamlit/api/history/list_agents_history.py +131 -0
  55. beamlit-0.1.0/src/beamlit/api/invitations/__init__.py +0 -0
  56. beamlit-0.1.0/src/beamlit/api/invitations/list_all_pending_invitations.py +142 -0
  57. beamlit-0.1.0/src/beamlit/api/locations/__init__.py +0 -0
  58. beamlit-0.1.0/src/beamlit/api/locations/list_locations.py +139 -0
  59. beamlit-0.1.0/src/beamlit/api/metrics/__init__.py +0 -0
  60. beamlit-0.1.0/src/beamlit/api/metrics/get_metrics.py +130 -0
  61. beamlit-0.1.0/src/beamlit/api/model_providers/__init__.py +0 -0
  62. beamlit-0.1.0/src/beamlit/api/model_providers/create_model_provider.py +163 -0
  63. beamlit-0.1.0/src/beamlit/api/model_providers/delete_model_provider.py +154 -0
  64. beamlit-0.1.0/src/beamlit/api/model_providers/get_model_provider.py +154 -0
  65. beamlit-0.1.0/src/beamlit/api/model_providers/list_model_providers.py +139 -0
  66. beamlit-0.1.0/src/beamlit/api/model_providers/update_model_provider.py +176 -0
  67. beamlit-0.1.0/src/beamlit/api/models/__init__.py +0 -0
  68. beamlit-0.1.0/src/beamlit/api/models/create_model.py +168 -0
  69. beamlit-0.1.0/src/beamlit/api/models/delete_model.py +154 -0
  70. beamlit-0.1.0/src/beamlit/api/models/delete_model_deployment.py +171 -0
  71. beamlit-0.1.0/src/beamlit/api/models/get_model.py +154 -0
  72. beamlit-0.1.0/src/beamlit/api/models/get_model_deployment.py +171 -0
  73. beamlit-0.1.0/src/beamlit/api/models/get_model_deployment_logs.py +168 -0
  74. beamlit-0.1.0/src/beamlit/api/models/get_model_deployment_metrics.py +163 -0
  75. beamlit-0.1.0/src/beamlit/api/models/get_model_metrics.py +154 -0
  76. beamlit-0.1.0/src/beamlit/api/models/list_model_deployments.py +163 -0
  77. beamlit-0.1.0/src/beamlit/api/models/list_models.py +135 -0
  78. beamlit-0.1.0/src/beamlit/api/models/put_model_deployment.py +193 -0
  79. beamlit-0.1.0/src/beamlit/api/models/release_model.py +154 -0
  80. beamlit-0.1.0/src/beamlit/api/models/update_model.py +181 -0
  81. beamlit-0.1.0/src/beamlit/api/policies/__init__.py +0 -0
  82. beamlit-0.1.0/src/beamlit/api/policies/create_policy.py +167 -0
  83. beamlit-0.1.0/src/beamlit/api/policies/delete_policy.py +154 -0
  84. beamlit-0.1.0/src/beamlit/api/policies/get_policy.py +154 -0
  85. beamlit-0.1.0/src/beamlit/api/policies/list_policies.py +139 -0
  86. beamlit-0.1.0/src/beamlit/api/policies/update_policy.py +180 -0
  87. beamlit-0.1.0/src/beamlit/api/service_accounts/__init__.py +0 -0
  88. beamlit-0.1.0/src/beamlit/api/service_accounts/create_api_key_for_service_account.py +177 -0
  89. beamlit-0.1.0/src/beamlit/api/service_accounts/create_workspace_service_account.py +168 -0
  90. beamlit-0.1.0/src/beamlit/api/service_accounts/delete_api_key_for_service_account.py +104 -0
  91. beamlit-0.1.0/src/beamlit/api/service_accounts/delete_workspace_service_account.py +158 -0
  92. beamlit-0.1.0/src/beamlit/api/service_accounts/get_workspace_service_accounts.py +139 -0
  93. beamlit-0.1.0/src/beamlit/api/service_accounts/list_api_keys_for_service_account.py +163 -0
  94. beamlit-0.1.0/src/beamlit/api/service_accounts/update_workspace_service_account.py +181 -0
  95. beamlit-0.1.0/src/beamlit/api/store/__init__.py +0 -0
  96. beamlit-0.1.0/src/beamlit/api/store/get_store_agent.py +146 -0
  97. beamlit-0.1.0/src/beamlit/api/store/get_store_function.py +146 -0
  98. beamlit-0.1.0/src/beamlit/api/store/list_store_agents.py +131 -0
  99. beamlit-0.1.0/src/beamlit/api/store/list_store_functions.py +131 -0
  100. beamlit-0.1.0/src/beamlit/api/workspaces/__init__.py +0 -0
  101. beamlit-0.1.0/src/beamlit/api/workspaces/accept_workspace_invitation.py +161 -0
  102. beamlit-0.1.0/src/beamlit/api/workspaces/create_worspace.py +163 -0
  103. beamlit-0.1.0/src/beamlit/api/workspaces/decline_workspace_invitation.py +158 -0
  104. beamlit-0.1.0/src/beamlit/api/workspaces/delete_workspace.py +154 -0
  105. beamlit-0.1.0/src/beamlit/api/workspaces/get_workspace.py +154 -0
  106. beamlit-0.1.0/src/beamlit/api/workspaces/invite_workspace_user.py +174 -0
  107. beamlit-0.1.0/src/beamlit/api/workspaces/leave_workspace.py +161 -0
  108. beamlit-0.1.0/src/beamlit/api/workspaces/list_workspace_users.py +139 -0
  109. beamlit-0.1.0/src/beamlit/api/workspaces/list_workspaces.py +139 -0
  110. beamlit-0.1.0/src/beamlit/api/workspaces/remove_workspace_user.py +101 -0
  111. beamlit-0.1.0/src/beamlit/api/workspaces/update_workspace.py +176 -0
  112. beamlit-0.1.0/src/beamlit/api/workspaces/update_workspace_user_role.py +187 -0
  113. beamlit-0.1.0/src/beamlit/authentication/__init__.py +24 -0
  114. beamlit-0.1.0/src/beamlit/authentication/apikey.py +14 -0
  115. beamlit-0.1.0/src/beamlit/authentication/authentication.py +35 -0
  116. beamlit-0.1.0/src/beamlit/authentication/credentials.py +165 -0
  117. beamlit-0.1.0/src/beamlit/authentication/device_mode.py +115 -0
  118. beamlit-0.1.0/src/beamlit/client.py +270 -0
  119. beamlit-0.1.0/src/beamlit/errors.py +16 -0
  120. beamlit-0.1.0/src/beamlit/models/__init__.py +189 -0
  121. beamlit-0.1.0/src/beamlit/models/acl.py +149 -0
  122. beamlit-0.1.0/src/beamlit/models/agent.py +151 -0
  123. beamlit-0.1.0/src/beamlit/models/agent_chain.py +77 -0
  124. beamlit-0.1.0/src/beamlit/models/agent_configuration.py +68 -0
  125. beamlit-0.1.0/src/beamlit/models/agent_deployment.py +327 -0
  126. beamlit-0.1.0/src/beamlit/models/agent_deployment_configuration.py +43 -0
  127. beamlit-0.1.0/src/beamlit/models/agent_deployment_history.py +183 -0
  128. beamlit-0.1.0/src/beamlit/models/agent_deployment_history_event.py +131 -0
  129. beamlit-0.1.0/src/beamlit/models/agent_deployment_pod_template.py +43 -0
  130. beamlit-0.1.0/src/beamlit/models/agent_release.py +68 -0
  131. beamlit-0.1.0/src/beamlit/models/api_key.py +140 -0
  132. beamlit-0.1.0/src/beamlit/models/authentication_provider_model.py +142 -0
  133. beamlit-0.1.0/src/beamlit/models/authentication_provider_organization.py +86 -0
  134. beamlit-0.1.0/src/beamlit/models/configuration.py +72 -0
  135. beamlit-0.1.0/src/beamlit/models/continent.py +68 -0
  136. beamlit-0.1.0/src/beamlit/models/country.py +68 -0
  137. beamlit-0.1.0/src/beamlit/models/create_api_key_for_service_account_body.py +67 -0
  138. beamlit-0.1.0/src/beamlit/models/create_workspace_service_account_body.py +69 -0
  139. beamlit-0.1.0/src/beamlit/models/create_workspace_service_account_response_200.py +103 -0
  140. beamlit-0.1.0/src/beamlit/models/delete_workspace_service_account_response_200.py +94 -0
  141. beamlit-0.1.0/src/beamlit/models/deployment_configuration.py +68 -0
  142. beamlit-0.1.0/src/beamlit/models/deployment_configurations.py +43 -0
  143. beamlit-0.1.0/src/beamlit/models/deployment_serverless_config.py +129 -0
  144. beamlit-0.1.0/src/beamlit/models/environment.py +162 -0
  145. beamlit-0.1.0/src/beamlit/models/environment_metrics.py +75 -0
  146. beamlit-0.1.0/src/beamlit/models/flavor.py +68 -0
  147. beamlit-0.1.0/src/beamlit/models/function.py +151 -0
  148. beamlit-0.1.0/src/beamlit/models/function_configuration.py +68 -0
  149. beamlit-0.1.0/src/beamlit/models/function_deployment.py +327 -0
  150. beamlit-0.1.0/src/beamlit/models/function_deployment_configuration.py +43 -0
  151. beamlit-0.1.0/src/beamlit/models/function_deployment_pod_template.py +43 -0
  152. beamlit-0.1.0/src/beamlit/models/function_kit.py +95 -0
  153. beamlit-0.1.0/src/beamlit/models/function_provider_ref.py +68 -0
  154. beamlit-0.1.0/src/beamlit/models/function_release.py +68 -0
  155. beamlit-0.1.0/src/beamlit/models/get_workspace_service_accounts_response_200_item.py +94 -0
  156. beamlit-0.1.0/src/beamlit/models/invite_workspace_user_body.py +58 -0
  157. beamlit-0.1.0/src/beamlit/models/labels.py +43 -0
  158. beamlit-0.1.0/src/beamlit/models/labels_type_0.py +43 -0
  159. beamlit-0.1.0/src/beamlit/models/location.py +120 -0
  160. beamlit-0.1.0/src/beamlit/models/location_response.py +111 -0
  161. beamlit-0.1.0/src/beamlit/models/metric.py +68 -0
  162. beamlit-0.1.0/src/beamlit/models/metrics.py +111 -0
  163. beamlit-0.1.0/src/beamlit/models/model.py +151 -0
  164. beamlit-0.1.0/src/beamlit/models/model_deployment.py +283 -0
  165. beamlit-0.1.0/src/beamlit/models/model_deployment_log.py +68 -0
  166. beamlit-0.1.0/src/beamlit/models/model_deployment_metrics.py +170 -0
  167. beamlit-0.1.0/src/beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +75 -0
  168. beamlit-0.1.0/src/beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
  169. beamlit-0.1.0/src/beamlit/models/model_deployment_pod_template.py +43 -0
  170. beamlit-0.1.0/src/beamlit/models/model_metrics.py +94 -0
  171. beamlit-0.1.0/src/beamlit/models/model_provider.py +187 -0
  172. beamlit-0.1.0/src/beamlit/models/model_provider_ref.py +68 -0
  173. beamlit-0.1.0/src/beamlit/models/model_release.py +68 -0
  174. beamlit-0.1.0/src/beamlit/models/model_with_deployments.py +174 -0
  175. beamlit-0.1.0/src/beamlit/models/pending_invitation.py +122 -0
  176. beamlit-0.1.0/src/beamlit/models/pending_invitation_accept.py +81 -0
  177. beamlit-0.1.0/src/beamlit/models/pending_invitation_render.py +135 -0
  178. beamlit-0.1.0/src/beamlit/models/pending_invitation_render_invited_by.py +86 -0
  179. beamlit-0.1.0/src/beamlit/models/pending_invitation_render_workspace.py +68 -0
  180. beamlit-0.1.0/src/beamlit/models/pending_invitation_workspace_details.py +70 -0
  181. beamlit-0.1.0/src/beamlit/models/policy.py +216 -0
  182. beamlit-0.1.0/src/beamlit/models/policy_location.py +68 -0
  183. beamlit-0.1.0/src/beamlit/models/provider_config.py +101 -0
  184. beamlit-0.1.0/src/beamlit/models/qps.py +59 -0
  185. beamlit-0.1.0/src/beamlit/models/resource_deployment_log.py +68 -0
  186. beamlit-0.1.0/src/beamlit/models/resource_deployment_metrics.py +172 -0
  187. beamlit-0.1.0/src/beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +75 -0
  188. beamlit-0.1.0/src/beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
  189. beamlit-0.1.0/src/beamlit/models/resource_metrics.py +94 -0
  190. beamlit-0.1.0/src/beamlit/models/runtime.py +152 -0
  191. beamlit-0.1.0/src/beamlit/models/runtime_readiness_probe.py +43 -0
  192. beamlit-0.1.0/src/beamlit/models/runtime_resources.py +43 -0
  193. beamlit-0.1.0/src/beamlit/models/serverless_config.py +122 -0
  194. beamlit-0.1.0/src/beamlit/models/standard_fields_dynamo_db.py +86 -0
  195. beamlit-0.1.0/src/beamlit/models/store_agent.py +165 -0
  196. beamlit-0.1.0/src/beamlit/models/store_agent_configuration.py +95 -0
  197. beamlit-0.1.0/src/beamlit/models/store_agent_labels.py +43 -0
  198. beamlit-0.1.0/src/beamlit/models/store_configuration.py +149 -0
  199. beamlit-0.1.0/src/beamlit/models/store_configuration_option.py +77 -0
  200. beamlit-0.1.0/src/beamlit/models/store_function.py +207 -0
  201. beamlit-0.1.0/src/beamlit/models/store_function_configuration.py +95 -0
  202. beamlit-0.1.0/src/beamlit/models/store_function_kit.py +95 -0
  203. beamlit-0.1.0/src/beamlit/models/store_function_labels.py +43 -0
  204. beamlit-0.1.0/src/beamlit/models/store_function_parameter.py +86 -0
  205. beamlit-0.1.0/src/beamlit/models/update_workspace_service_account_body.py +67 -0
  206. beamlit-0.1.0/src/beamlit/models/update_workspace_service_account_response_200.py +94 -0
  207. beamlit-0.1.0/src/beamlit/models/update_workspace_user_role_body.py +58 -0
  208. beamlit-0.1.0/src/beamlit/models/workspace.py +126 -0
  209. beamlit-0.1.0/src/beamlit/models/workspace_labels.py +43 -0
  210. beamlit-0.1.0/src/beamlit/models/workspace_user.py +113 -0
  211. beamlit-0.1.0/src/beamlit/py.typed +1 -0
  212. beamlit-0.1.0/src/beamlit/types.py +46 -0
  213. beamlit-0.1.0/src/main.py +18 -0
  214. beamlit-0.1.0/uv.lock +155 -0
@@ -0,0 +1,23 @@
1
+ __pycache__/
2
+ build/
3
+ dist/
4
+ *.egg-info/
5
+ .pytest_cache/
6
+
7
+ # pyenv
8
+ .python-version
9
+
10
+ # Environments
11
+ .env
12
+ .venv
13
+
14
+ # mypy
15
+ .mypy_cache/
16
+ .dmypy.json
17
+ dmypy.json
18
+
19
+ # JetBrains
20
+ .idea/
21
+
22
+ /coverage.xml
23
+ /.coverage
beamlit-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.3
2
+ Name: beamlit
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Author-email: cploujoux <ch.ploujoux@gmail.com>
6
+ Requires-Python: >=3.12
7
+ Requires-Dist: attrs>=21.3.0
8
+ Requires-Dist: httpx<0.28.0,>=0.20.0
9
+ Requires-Dist: python-dateutil>=2.8.0
10
+ Requires-Dist: pyyaml==6.0.2
11
+ Description-Content-Type: text/markdown
12
+
13
+ # beamlit
14
+ A client library for accessing Beamlit Control Plane
15
+
16
+ ## Usage
17
+ First, create a client:
18
+
19
+ ```python
20
+ from beamlit.authentication import (RunClientWithCredentials, load_credentials,
21
+ new_client_with_credentials)
22
+
23
+ WORKSPACE_NAME = "development"
24
+ credentials = load_credentials(WORKSPACE_NAME)
25
+ config = RunClientWithCredentials(
26
+ credentials=credentials,
27
+ workspace=WORKSPACE_NAME,
28
+ )
29
+ client = new_client_with_credentials(config)
30
+ ```
31
+
32
+ Now call your endpoint and use your models:
33
+
34
+ ```python
35
+ from typing import List
36
+
37
+ from beamlit.api.models import list_models
38
+ from beamlit.types import Response
39
+ from beamlit.models.model import Model
40
+
41
+ with client as client:
42
+ models: List[Model] = list_models.sync(client=client)
43
+ # or if you need more info (e.g. status_code)
44
+ response: Response[List[Model]] = list_models.sync_detailed(client=client)
45
+ ```
46
+
47
+ Or do the same thing with an async version:
48
+
49
+ ```python
50
+ from typing import List
51
+
52
+ from beamlit.api.models import list_models
53
+ from beamlit.types import Response
54
+ from beamlit.models.model import Model
55
+
56
+ async with client as client:
57
+ models: List[Model] = await list_models.asyncio(client=client)
58
+ response: Response[List[Model]] = await list_models.asyncio_detailed(client=client)
59
+ ```
@@ -0,0 +1,47 @@
1
+ # beamlit
2
+ A client library for accessing Beamlit Control Plane
3
+
4
+ ## Usage
5
+ First, create a client:
6
+
7
+ ```python
8
+ from beamlit.authentication import (RunClientWithCredentials, load_credentials,
9
+ new_client_with_credentials)
10
+
11
+ WORKSPACE_NAME = "development"
12
+ credentials = load_credentials(WORKSPACE_NAME)
13
+ config = RunClientWithCredentials(
14
+ credentials=credentials,
15
+ workspace=WORKSPACE_NAME,
16
+ )
17
+ client = new_client_with_credentials(config)
18
+ ```
19
+
20
+ Now call your endpoint and use your models:
21
+
22
+ ```python
23
+ from typing import List
24
+
25
+ from beamlit.api.models import list_models
26
+ from beamlit.types import Response
27
+ from beamlit.models.model import Model
28
+
29
+ with client as client:
30
+ models: List[Model] = list_models.sync(client=client)
31
+ # or if you need more info (e.g. status_code)
32
+ response: Response[List[Model]] = list_models.sync_detailed(client=client)
33
+ ```
34
+
35
+ Or do the same thing with an async version:
36
+
37
+ ```python
38
+ from typing import List
39
+
40
+ from beamlit.api.models import list_models
41
+ from beamlit.types import Response
42
+ from beamlit.models.model import Model
43
+
44
+ async with client as client:
45
+ models: List[Model] = await list_models.asyncio(client=client)
46
+ response: Response[List[Model]] = await list_models.asyncio_detailed(client=client)
47
+ ```
@@ -0,0 +1,19 @@
1
+ [project]
2
+ name = "beamlit"
3
+ version = "0.1.0"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "cploujoux", email = "ch.ploujoux@gmail.com" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ dependencies = [
11
+ "httpx>=0.20.0,<0.28.0",
12
+ "attrs>=21.3.0",
13
+ "python-dateutil>=2.8.0",
14
+ "pyyaml==6.0.2",
15
+ ]
16
+
17
+ [build-system]
18
+ requires = ["hatchling"]
19
+ build-backend = "hatchling.build"
@@ -0,0 +1,8 @@
1
+ """A client library for accessing Beamlit Control Plane"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
File without changes
@@ -0,0 +1,155 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.agent import Agent
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ body: Agent,
15
+ ) -> dict[str, Any]:
16
+ headers: dict[str, Any] = {}
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "post",
20
+ "url": "/agents",
21
+ }
22
+
23
+ _body = body.to_dict()
24
+
25
+ _kwargs["json"] = _body
26
+ headers["Content-Type"] = "application/json"
27
+
28
+ _kwargs["headers"] = headers
29
+ return _kwargs
30
+
31
+
32
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Agent]:
33
+ if response.status_code == 200:
34
+ response_200 = Agent.from_dict(response.json())
35
+
36
+ return response_200
37
+ if client.raise_on_unexpected_status:
38
+ raise errors.UnexpectedStatus(response.status_code, response.content)
39
+ else:
40
+ return None
41
+
42
+
43
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Agent]:
44
+ return Response(
45
+ status_code=HTTPStatus(response.status_code),
46
+ content=response.content,
47
+ headers=response.headers,
48
+ parsed=_parse_response(client=client, response=response),
49
+ )
50
+
51
+
52
+ def sync_detailed(
53
+ *,
54
+ client: AuthenticatedClient,
55
+ body: Agent,
56
+ ) -> Response[Agent]:
57
+ """Create agent by name
58
+
59
+ Args:
60
+ body (Agent): Agent parent of AgentDeployment
61
+
62
+ Raises:
63
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
65
+
66
+ Returns:
67
+ Response[Agent]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ body=body,
72
+ )
73
+
74
+ response = client.get_httpx_client().request(
75
+ **kwargs,
76
+ )
77
+
78
+ return _build_response(client=client, response=response)
79
+
80
+
81
+ def sync(
82
+ *,
83
+ client: AuthenticatedClient,
84
+ body: Agent,
85
+ ) -> Optional[Agent]:
86
+ """Create agent by name
87
+
88
+ Args:
89
+ body (Agent): Agent parent of AgentDeployment
90
+
91
+ Raises:
92
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
94
+
95
+ Returns:
96
+ Agent
97
+ """
98
+
99
+ return sync_detailed(
100
+ client=client,
101
+ body=body,
102
+ ).parsed
103
+
104
+
105
+ async def asyncio_detailed(
106
+ *,
107
+ client: AuthenticatedClient,
108
+ body: Agent,
109
+ ) -> Response[Agent]:
110
+ """Create agent by name
111
+
112
+ Args:
113
+ body (Agent): Agent parent of AgentDeployment
114
+
115
+ Raises:
116
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
117
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
118
+
119
+ Returns:
120
+ Response[Agent]
121
+ """
122
+
123
+ kwargs = _get_kwargs(
124
+ body=body,
125
+ )
126
+
127
+ response = await client.get_async_httpx_client().request(**kwargs)
128
+
129
+ return _build_response(client=client, response=response)
130
+
131
+
132
+ async def asyncio(
133
+ *,
134
+ client: AuthenticatedClient,
135
+ body: Agent,
136
+ ) -> Optional[Agent]:
137
+ """Create agent by name
138
+
139
+ Args:
140
+ body (Agent): Agent parent of AgentDeployment
141
+
142
+ Raises:
143
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
144
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
145
+
146
+ Returns:
147
+ Agent
148
+ """
149
+
150
+ return (
151
+ await asyncio_detailed(
152
+ client=client,
153
+ body=body,
154
+ )
155
+ ).parsed
@@ -0,0 +1,146 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.agent_release import AgentRelease
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ agent_name: str,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "post",
17
+ "url": f"/agents/{agent_name}/release",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AgentRelease]:
24
+ if response.status_code == 200:
25
+ response_200 = AgentRelease.from_dict(response.json())
26
+
27
+ return response_200
28
+ if client.raise_on_unexpected_status:
29
+ raise errors.UnexpectedStatus(response.status_code, response.content)
30
+ else:
31
+ return None
32
+
33
+
34
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AgentRelease]:
35
+ return Response(
36
+ status_code=HTTPStatus(response.status_code),
37
+ content=response.content,
38
+ headers=response.headers,
39
+ parsed=_parse_response(client=client, response=response),
40
+ )
41
+
42
+
43
+ def sync_detailed(
44
+ agent_name: str,
45
+ *,
46
+ client: AuthenticatedClient,
47
+ ) -> Response[AgentRelease]:
48
+ """Create release for a agent from an environment
49
+
50
+ Args:
51
+ agent_name (str):
52
+
53
+ Raises:
54
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
55
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
56
+
57
+ Returns:
58
+ Response[AgentRelease]
59
+ """
60
+
61
+ kwargs = _get_kwargs(
62
+ agent_name=agent_name,
63
+ )
64
+
65
+ response = client.get_httpx_client().request(
66
+ **kwargs,
67
+ )
68
+
69
+ return _build_response(client=client, response=response)
70
+
71
+
72
+ def sync(
73
+ agent_name: str,
74
+ *,
75
+ client: AuthenticatedClient,
76
+ ) -> Optional[AgentRelease]:
77
+ """Create release for a agent from an environment
78
+
79
+ Args:
80
+ agent_name (str):
81
+
82
+ Raises:
83
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
84
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
85
+
86
+ Returns:
87
+ AgentRelease
88
+ """
89
+
90
+ return sync_detailed(
91
+ agent_name=agent_name,
92
+ client=client,
93
+ ).parsed
94
+
95
+
96
+ async def asyncio_detailed(
97
+ agent_name: str,
98
+ *,
99
+ client: AuthenticatedClient,
100
+ ) -> Response[AgentRelease]:
101
+ """Create release for a agent from an environment
102
+
103
+ Args:
104
+ agent_name (str):
105
+
106
+ Raises:
107
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
108
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
109
+
110
+ Returns:
111
+ Response[AgentRelease]
112
+ """
113
+
114
+ kwargs = _get_kwargs(
115
+ agent_name=agent_name,
116
+ )
117
+
118
+ response = await client.get_async_httpx_client().request(**kwargs)
119
+
120
+ return _build_response(client=client, response=response)
121
+
122
+
123
+ async def asyncio(
124
+ agent_name: str,
125
+ *,
126
+ client: AuthenticatedClient,
127
+ ) -> Optional[AgentRelease]:
128
+ """Create release for a agent from an environment
129
+
130
+ Args:
131
+ agent_name (str):
132
+
133
+ Raises:
134
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
135
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
136
+
137
+ Returns:
138
+ AgentRelease
139
+ """
140
+
141
+ return (
142
+ await asyncio_detailed(
143
+ agent_name=agent_name,
144
+ client=client,
145
+ )
146
+ ).parsed
@@ -0,0 +1,146 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.agent import Agent
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ agent_name: str,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "delete",
17
+ "url": f"/agents/{agent_name}",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Agent]:
24
+ if response.status_code == 200:
25
+ response_200 = Agent.from_dict(response.json())
26
+
27
+ return response_200
28
+ if client.raise_on_unexpected_status:
29
+ raise errors.UnexpectedStatus(response.status_code, response.content)
30
+ else:
31
+ return None
32
+
33
+
34
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Agent]:
35
+ return Response(
36
+ status_code=HTTPStatus(response.status_code),
37
+ content=response.content,
38
+ headers=response.headers,
39
+ parsed=_parse_response(client=client, response=response),
40
+ )
41
+
42
+
43
+ def sync_detailed(
44
+ agent_name: str,
45
+ *,
46
+ client: AuthenticatedClient,
47
+ ) -> Response[Agent]:
48
+ """Delete agent by name
49
+
50
+ Args:
51
+ agent_name (str):
52
+
53
+ Raises:
54
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
55
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
56
+
57
+ Returns:
58
+ Response[Agent]
59
+ """
60
+
61
+ kwargs = _get_kwargs(
62
+ agent_name=agent_name,
63
+ )
64
+
65
+ response = client.get_httpx_client().request(
66
+ **kwargs,
67
+ )
68
+
69
+ return _build_response(client=client, response=response)
70
+
71
+
72
+ def sync(
73
+ agent_name: str,
74
+ *,
75
+ client: AuthenticatedClient,
76
+ ) -> Optional[Agent]:
77
+ """Delete agent by name
78
+
79
+ Args:
80
+ agent_name (str):
81
+
82
+ Raises:
83
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
84
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
85
+
86
+ Returns:
87
+ Agent
88
+ """
89
+
90
+ return sync_detailed(
91
+ agent_name=agent_name,
92
+ client=client,
93
+ ).parsed
94
+
95
+
96
+ async def asyncio_detailed(
97
+ agent_name: str,
98
+ *,
99
+ client: AuthenticatedClient,
100
+ ) -> Response[Agent]:
101
+ """Delete agent by name
102
+
103
+ Args:
104
+ agent_name (str):
105
+
106
+ Raises:
107
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
108
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
109
+
110
+ Returns:
111
+ Response[Agent]
112
+ """
113
+
114
+ kwargs = _get_kwargs(
115
+ agent_name=agent_name,
116
+ )
117
+
118
+ response = await client.get_async_httpx_client().request(**kwargs)
119
+
120
+ return _build_response(client=client, response=response)
121
+
122
+
123
+ async def asyncio(
124
+ agent_name: str,
125
+ *,
126
+ client: AuthenticatedClient,
127
+ ) -> Optional[Agent]:
128
+ """Delete agent by name
129
+
130
+ Args:
131
+ agent_name (str):
132
+
133
+ Raises:
134
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
135
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
136
+
137
+ Returns:
138
+ Agent
139
+ """
140
+
141
+ return (
142
+ await asyncio_detailed(
143
+ agent_name=agent_name,
144
+ client=client,
145
+ )
146
+ ).parsed