beamlit 0.0.20rc5__tar.gz → 0.0.20rc7__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/PKG-INFO +7 -1
  2. beamlit-0.0.20rc7/beamlit.yaml +5 -0
  3. beamlit-0.0.20rc7/pyproject.toml +43 -0
  4. beamlit-0.0.20rc7/src/beamlit/agents/__init__.py +4 -0
  5. beamlit-0.0.20rc7/src/beamlit/agents/chat.py +87 -0
  6. beamlit-0.0.20rc7/src/beamlit/agents/decorator.py +147 -0
  7. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/delete_agent_history.py +6 -2
  8. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent_deployment_logs.py +11 -11
  9. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent_history.py +6 -2
  10. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/list_agent_deployment_history.py +11 -11
  11. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/list_agent_deployments.py +11 -11
  12. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/list_agents.py +11 -11
  13. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/put_agent_history.py +6 -2
  14. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/environments/list_environments.py +11 -11
  15. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/get_function_deployment_logs.py +11 -11
  16. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/list_function_deployments.py +11 -11
  17. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/list_functions.py +11 -11
  18. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/history/get_agents_history.py +11 -11
  19. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/history/list_agents_history.py +11 -11
  20. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/list_integration_connections.py +11 -11
  21. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/invitations/list_all_pending_invitations.py +11 -11
  22. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/locations/list_locations.py +11 -11
  23. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/model_providers/list_model_providers.py +11 -11
  24. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/get_model_deployment_logs.py +11 -11
  25. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/list_model_deployments.py +11 -11
  26. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/list_models.py +11 -11
  27. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/policies/list_policies.py +11 -11
  28. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
  29. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
  30. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/store/list_store_agents.py +11 -11
  31. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/store/list_store_functions.py +11 -11
  32. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/list_workspace_users.py +11 -11
  33. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/list_workspaces.py +11 -11
  34. beamlit-0.0.20rc7/src/beamlit/authentication/__init__.py +45 -0
  35. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/authentication/apikey.py +4 -4
  36. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/authentication/authentication.py +36 -5
  37. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/authentication/clientcredentials.py +18 -20
  38. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/authentication/credentials.py +18 -11
  39. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/authentication/device_mode.py +15 -12
  40. beamlit-0.0.20rc7/src/beamlit/common/__init__.py +13 -0
  41. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/common/generate.py +31 -19
  42. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/common/logger.py +9 -12
  43. beamlit-0.0.20rc7/src/beamlit/common/secrets.py +11 -0
  44. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/common/settings.py +78 -30
  45. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/common/utils.py +4 -2
  46. beamlit-0.0.20rc7/src/beamlit/functions/__init__.py +5 -0
  47. beamlit-0.0.20rc7/src/beamlit/functions/decorator.py +90 -0
  48. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/acl.py +2 -2
  49. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent.py +3 -3
  50. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_chain.py +2 -2
  51. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_configuration.py +2 -2
  52. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_deployment.py +25 -25
  53. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_deployment_configuration.py +2 -2
  54. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_deployment_history.py +5 -5
  55. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_deployment_history_event.py +9 -9
  56. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_deployment_pod_template.py +2 -2
  57. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_release.py +2 -2
  58. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_spec.py +15 -5
  59. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_with_deployments.py +6 -6
  60. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/api_key.py +2 -2
  61. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/authentication_provider_model.py +6 -6
  62. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/authentication_provider_organization.py +2 -2
  63. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/configuration.py +10 -10
  64. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/continent.py +2 -2
  65. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/core_spec.py +9 -3
  66. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/country.py +2 -2
  67. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/create_api_key_for_service_account_body.py +2 -2
  68. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/create_workspace_service_account_body.py +2 -2
  69. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/create_workspace_service_account_response_200.py +2 -2
  70. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/delete_workspace_service_account_response_200.py +2 -2
  71. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/deployment_configuration.py +2 -2
  72. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/deployment_configurations.py +2 -2
  73. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/deployment_serverless_config.py +2 -2
  74. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/deployment_serverless_config_type_0.py +3 -1
  75. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/environment.py +7 -7
  76. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/environment_metrics.py +8 -8
  77. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/flavor.py +9 -9
  78. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function.py +3 -3
  79. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_configuration.py +2 -2
  80. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_deployment.py +24 -24
  81. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_deployment_configuration.py +2 -2
  82. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_deployment_pod_template.py +2 -2
  83. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_kit.py +5 -5
  84. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_provider_ref.py +2 -2
  85. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_release.py +2 -2
  86. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_spec.py +9 -3
  87. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_with_deployments.py +6 -6
  88. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -2
  89. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/increase_and_rate_metric.py +5 -5
  90. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration.py +12 -12
  91. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration_config.py +2 -2
  92. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration_connection.py +5 -5
  93. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration_connection_config.py +2 -2
  94. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration_connection_secret.py +2 -2
  95. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration_model.py +6 -6
  96. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration_secret.py +2 -2
  97. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/invite_workspace_user_body.py +2 -2
  98. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/labels_type_0.py +2 -2
  99. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/location.py +5 -5
  100. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/location_response.py +5 -5
  101. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/metric.py +2 -2
  102. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/metrics.py +8 -8
  103. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model.py +3 -3
  104. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_deployment.py +18 -18
  105. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_deployment_log.py +2 -2
  106. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_deployment_metrics.py +9 -9
  107. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +5 -5
  108. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
  109. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_deployment_pod_template.py +2 -2
  110. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_metrics.py +6 -6
  111. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_provider.py +11 -11
  112. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_provider_ref.py +2 -2
  113. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_release.py +2 -2
  114. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_spec.py +9 -3
  115. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_with_deployments.py +6 -6
  116. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/pending_invitation.py +2 -2
  117. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/pending_invitation_accept.py +3 -3
  118. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/pending_invitation_render.py +5 -5
  119. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/pending_invitation_render_invited_by.py +2 -2
  120. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/pending_invitation_render_workspace.py +2 -2
  121. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/pending_invitation_workspace_details.py +6 -6
  122. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/policy.py +20 -20
  123. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/policy_location.py +9 -9
  124. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/policy_spec.py +9 -3
  125. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/provider_config.py +7 -7
  126. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/qps.py +2 -2
  127. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_log.py +2 -2
  128. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics.py +16 -16
  129. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_inference_per_region.py +5 -5
  130. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +6 -2
  131. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +5 -5
  132. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +6 -2
  133. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +3 -3
  134. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
  135. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_environment_metrics.py +62 -24
  136. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +6 -2
  137. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_metrics.py +10 -10
  138. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime.py +23 -23
  139. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime_readiness_probe.py +2 -2
  140. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime_resources.py +2 -2
  141. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/serverless_config.py +2 -2
  142. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/standard_fields_dynamo_db.py +2 -2
  143. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_agent.py +6 -6
  144. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_agent_configuration.py +2 -2
  145. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_agent_labels.py +2 -2
  146. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_configuration.py +16 -16
  147. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_configuration_option.py +2 -2
  148. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_function.py +12 -12
  149. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_function_configuration.py +2 -2
  150. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_function_kit.py +5 -5
  151. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_function_labels.py +2 -2
  152. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_function_parameter.py +9 -9
  153. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/update_workspace_service_account_body.py +2 -2
  154. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/update_workspace_service_account_response_200.py +2 -2
  155. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/update_workspace_user_role_body.py +2 -2
  156. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/workspace.py +3 -3
  157. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/workspace_labels.py +2 -2
  158. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/workspace_user.py +2 -2
  159. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/run.py +6 -6
  160. beamlit-0.0.20rc7/src/beamlit/serve/app.py +73 -0
  161. beamlit-0.0.20rc7/src/beamlit/serve/middlewares/__init__.py +4 -0
  162. beamlit-0.0.20rc7/src/beamlit/serve/middlewares/accesslog.py +14 -0
  163. beamlit-0.0.20rc7/src/beamlit/serve/middlewares/processtime.py +12 -0
  164. beamlit-0.0.20rc7/src/integrationtest/agent.py +39 -0
  165. beamlit-0.0.20rc7/src/integrationtest/functions/helloworld.py +7 -0
  166. beamlit-0.0.20rc7/src/integrationtest/main.py +18 -0
  167. beamlit-0.0.20rc7/uv.lock +1531 -0
  168. beamlit-0.0.20rc5/beamlit.yaml +0 -3
  169. beamlit-0.0.20rc5/pyproject.toml +0 -22
  170. beamlit-0.0.20rc5/src/beamlit/authentication/__init__.py +0 -29
  171. beamlit-0.0.20rc5/src/main.py +0 -24
  172. beamlit-0.0.20rc5/uv.lock +0 -317
  173. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/.gitignore +0 -0
  174. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/README.md +0 -0
  175. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/__init__.py +0 -0
  176. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/__init__.py +0 -0
  177. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/__init__.py +0 -0
  178. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/create_agent.py +0 -0
  179. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/create_agent_release.py +0 -0
  180. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/delete_agent.py +0 -0
  181. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/delete_agent_deployment.py +0 -0
  182. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/delete_agent_deployment_history.py +0 -0
  183. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent.py +0 -0
  184. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent_deployment.py +0 -0
  185. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent_deployment_history.py +0 -0
  186. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent_deployment_metrics.py +0 -0
  187. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent_environment_logs.py +0 -0
  188. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/get_agent_metrics.py +0 -0
  189. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/list_agent_history.py +0 -0
  190. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/put_agent_deployment.py +0 -0
  191. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/put_agent_deployment_history.py +0 -0
  192. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/agents/update_agent.py +0 -0
  193. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/configurations/__init__.py +0 -0
  194. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/configurations/get_configuration.py +0 -0
  195. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/environments/__init__.py +0 -0
  196. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/environments/create_environment.py +0 -0
  197. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/environments/delete_environment.py +0 -0
  198. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/environments/get_environment.py +0 -0
  199. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/environments/get_environment_metrics.py +0 -0
  200. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/environments/update_environment.py +0 -0
  201. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/__init__.py +0 -0
  202. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/create_function.py +0 -0
  203. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/create_function_release.py +0 -0
  204. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/delete_function.py +0 -0
  205. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/delete_function_deployment.py +0 -0
  206. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/get_function.py +0 -0
  207. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/get_function_deployment.py +0 -0
  208. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/get_function_deployment_metrics.py +0 -0
  209. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/get_function_environment_logs.py +0 -0
  210. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/get_function_metrics.py +0 -0
  211. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/put_function_deployment.py +0 -0
  212. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/functions/update_function.py +0 -0
  213. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/history/__init__.py +0 -0
  214. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/__init__.py +0 -0
  215. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/create_integration_connection.py +0 -0
  216. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/delete_integration_connection.py +0 -0
  217. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/get_integration.py +0 -0
  218. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/get_integration_connection.py +0 -0
  219. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/get_integration_connection_model.py +0 -0
  220. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/get_integration_model.py +0 -0
  221. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/list_integration_connection_models.py +0 -0
  222. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/list_integration_models.py +0 -0
  223. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/integrations/update_integration_connection.py +0 -0
  224. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/invitations/__init__.py +0 -0
  225. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/locations/__init__.py +0 -0
  226. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/metrics/__init__.py +0 -0
  227. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/metrics/get_metrics.py +0 -0
  228. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/model_providers/__init__.py +0 -0
  229. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/model_providers/create_model_provider.py +0 -0
  230. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/model_providers/delete_model_provider.py +0 -0
  231. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/model_providers/get_model_provider.py +0 -0
  232. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/model_providers/update_model_provider.py +0 -0
  233. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/__init__.py +0 -0
  234. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/create_model.py +0 -0
  235. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/delete_model.py +0 -0
  236. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/delete_model_deployment.py +0 -0
  237. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/get_model.py +0 -0
  238. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/get_model_deployment.py +0 -0
  239. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/get_model_deployment_metrics.py +0 -0
  240. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/get_model_environment_logs.py +0 -0
  241. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/get_model_metrics.py +0 -0
  242. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/put_model_deployment.py +0 -0
  243. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/release_model.py +0 -0
  244. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/models/update_model.py +0 -0
  245. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/policies/__init__.py +0 -0
  246. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/policies/create_policy.py +0 -0
  247. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/policies/delete_policy.py +0 -0
  248. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/policies/get_policy.py +0 -0
  249. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/policies/update_policy.py +0 -0
  250. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/__init__.py +0 -0
  251. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/create_api_key_for_service_account.py +0 -0
  252. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/create_workspace_service_account.py +0 -0
  253. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/delete_api_key_for_service_account.py +0 -0
  254. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/delete_workspace_service_account.py +0 -0
  255. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/service_accounts/update_workspace_service_account.py +0 -0
  256. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/store/__init__.py +0 -0
  257. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/store/get_store_agent.py +0 -0
  258. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/store/get_store_function.py +0 -0
  259. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/__init__.py +0 -0
  260. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/accept_workspace_invitation.py +0 -0
  261. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/create_worspace.py +0 -0
  262. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/decline_workspace_invitation.py +0 -0
  263. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/delete_workspace.py +0 -0
  264. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/get_workspace.py +0 -0
  265. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/invite_workspace_user.py +0 -0
  266. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/leave_workspace.py +0 -0
  267. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/remove_workspace_user.py +0 -0
  268. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/update_workspace.py +0 -0
  269. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/api/workspaces/update_workspace_user_role.py +0 -0
  270. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/client.py +0 -0
  271. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/errors.py +0 -0
  272. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/__init__.py +0 -0
  273. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_deployment_configuration_type_0.py +0 -0
  274. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_deployment_pod_template_type_0.py +0 -0
  275. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_history.py +0 -0
  276. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_history_event.py +0 -0
  277. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/agent_metadata.py +0 -0
  278. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/environment_spec.py +0 -0
  279. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_deployment_configuration_type_0.py +0 -0
  280. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_deployment_pod_template_type_0.py +0 -0
  281. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/function_metadata.py +0 -0
  282. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/integration_connection_spec.py +0 -0
  283. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/metadata.py +0 -0
  284. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/metadata_labels.py +0 -0
  285. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_deployment_pod_template_type_0.py +0 -0
  286. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/model_metadata.py +0 -0
  287. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/owner_fields.py +0 -0
  288. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/pod_template_spec.py +0 -0
  289. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -0
  290. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -0
  291. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +0 -0
  292. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/resource_log.py +0 -0
  293. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime_readiness_probe_type_0.py +0 -0
  294. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime_type_0.py +0 -0
  295. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime_type_0_readiness_probe.py +0 -0
  296. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -0
  297. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/runtime_type_0_resources.py +0 -0
  298. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/spec_configuration.py +0 -0
  299. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_agent_labels_type_0.py +0 -0
  300. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/store_function_labels_type_0.py +0 -0
  301. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/time_fields.py +0 -0
  302. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/models/websocket_channel.py +0 -0
  303. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/py.typed +0 -0
  304. {beamlit-0.0.20rc5 → beamlit-0.0.20rc7}/src/beamlit/types.py +0 -0
@@ -1,11 +1,17 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: beamlit
3
- Version: 0.0.20rc5
3
+ Version: 0.0.20rc7
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12
7
+ Requires-Dist: asgi-correlation-id<5.0.0,>=4.3.4
7
8
  Requires-Dist: attrs>=21.3.0
9
+ Requires-Dist: fastapi[standard]<0.116.0,>=0.115.4
8
10
  Requires-Dist: httpx<0.28.0,>=0.20.0
11
+ Requires-Dist: langchain-community<0.4.0,>=0.3.3
12
+ Requires-Dist: langchain-core<0.4.0,>=0.3.13
13
+ Requires-Dist: langchain-openai<0.3.0,>=0.2.4
14
+ Requires-Dist: langgraph<0.3.0,>=0.2.40
9
15
  Requires-Dist: pydantic-settings<2.7.0,>=2.6.1
10
16
  Requires-Dist: pydantic<2.11.0,>=2.10.3
11
17
  Requires-Dist: python-dateutil>=2.8.0
@@ -0,0 +1,5 @@
1
+ agent:
2
+ functions_directory: src/integrationtest/functions
3
+ server:
4
+ module: integrationtest.agent.main
5
+ port: 1338
@@ -0,0 +1,43 @@
1
+ [project]
2
+ name = "beamlit"
3
+ version = "0.0.20.pre-7"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "cploujoux", email = "ch.ploujoux@gmail.com" }
8
+ ]
9
+ packages = [
10
+ {include = "beamlit"},
11
+ ]
12
+ include = ["CHANGELOG.md", "beamlit/py.typed"]
13
+ requires-python = ">=3.12"
14
+ dependencies = [
15
+ "httpx>=0.20.0,<0.28.0",
16
+ "attrs>=21.3.0",
17
+ "python-dateutil>=2.8.0",
18
+ "pyyaml>=6.0.2,<6.1.0",
19
+ "pydantic-settings>=2.6.1,<2.7.0",
20
+ "pydantic>=2.10.3,<2.11.0",
21
+ "requests>=2.32.3,<2.33.0",
22
+ "langchain-core>=0.3.13,<0.4.0",
23
+ "langchain-community>=0.3.3,<0.4.0",
24
+ "langchain-openai>=0.2.4,<0.3.0",
25
+ "langgraph>=0.2.40,<0.3.0",
26
+ "fastapi[standard]>=0.115.4,<0.116.0",
27
+ "asgi-correlation-id>=4.3.4,<5.0.0",
28
+ ]
29
+ [dependency-groups]
30
+ dev = [
31
+ "ruff>=0.8.2",
32
+ ]
33
+
34
+ [build-system]
35
+ requires = ["hatchling"]
36
+ build-backend = "hatchling.build"
37
+
38
+ [tool.ruff]
39
+ line-length = 100
40
+
41
+ [tool.ruff.lint]
42
+ select = ["F", "I", "UP"]
43
+ ignore = ["UP006", "UP007", "UP035"]
@@ -0,0 +1,4 @@
1
+ from .chat import get_chat_model
2
+ from .decorator import agent
3
+
4
+ __all__ = ["agent", "get_chat_model"]
@@ -0,0 +1,87 @@
1
+ from logging import getLogger
2
+
3
+ from beamlit.authentication import get_authentication_headers, new_client
4
+ from beamlit.common.settings import get_settings
5
+ from beamlit.models import AgentDeployment
6
+
7
+ logger = getLogger(__name__)
8
+
9
+
10
+ def get_base_url(agent_model: AgentDeployment):
11
+ settings = get_settings()
12
+ return f"{settings.run_url}/{settings.workspace}/models/{agent_model.model}/v1"
13
+
14
+
15
+ def get_mistral_chat_model(**kwargs):
16
+ from langchain_mistralai.chat_models import ChatMistralAI # type: ignore
17
+
18
+ return ChatMistralAI(**kwargs)
19
+
20
+
21
+ def get_openai_chat_model(**kwargs):
22
+ from langchain_openai import ChatOpenAI # type: ignore
23
+
24
+ return ChatOpenAI(**kwargs)
25
+
26
+
27
+ def get_anthropic_chat_model(**kwargs):
28
+ from langchain_anthropic import ChatAnthropic # type: ignore
29
+
30
+ return ChatAnthropic(**kwargs)
31
+
32
+
33
+ def get_chat_model(agent_model: AgentDeployment):
34
+ settings = get_settings()
35
+ client = new_client()
36
+
37
+ headers = get_authentication_headers(settings)
38
+ headers["X-Beamlit-Environment"] = agent_model.environment
39
+
40
+ jwt = headers.pop("X-Beamlit-Authorization").replace("Bearer ", "")
41
+ params = {"environment": agent_model.environment}
42
+ chat_classes = {
43
+ "openai": {
44
+ "func": get_openai_chat_model,
45
+ "kwargs": {
46
+ "http_client": client.get_httpx_client(),
47
+ },
48
+ },
49
+ "anthropic": {
50
+ "func": get_anthropic_chat_model,
51
+ "kwargs": {},
52
+ },
53
+ "mistral": {
54
+ "func": get_mistral_chat_model,
55
+ "kwargs": {
56
+ "api_key": jwt,
57
+ },
58
+ },
59
+ }
60
+
61
+ if agent_model is None:
62
+ raise ValueError("agent_model not found in configuration")
63
+ if agent_model.runtime is None:
64
+ raise ValueError("runtime not found in agent model")
65
+ if agent_model.runtime.type_ is None:
66
+ raise ValueError("type not found in runtime")
67
+ if agent_model.runtime.model is None:
68
+ raise ValueError("model not found in runtime")
69
+
70
+ provider = agent_model.runtime.type_
71
+ model = agent_model.runtime.model
72
+
73
+ kwargs = {
74
+ "model": model,
75
+ "base_url": get_base_url(agent_model),
76
+ "default_query": params,
77
+ "default_headers": headers,
78
+ "api_key": "fake_api_key",
79
+ "temperature": 0,
80
+ }
81
+ chat_class = chat_classes.get(provider)
82
+ if not chat_class:
83
+ logger.warning(f"Provider {provider} not currently supported, defaulting to OpenAI")
84
+ chat_class = chat_classes["openai"]
85
+ if "kwargs" in chat_class:
86
+ kwargs.update(chat_class["kwargs"])
87
+ return chat_class["func"](**kwargs)
@@ -0,0 +1,147 @@
1
+ # Import necessary modules
2
+ import ast
3
+ import importlib
4
+ import os
5
+ from logging import getLogger
6
+
7
+ from langgraph.checkpoint.memory import MemorySaver
8
+ from langgraph.prebuilt import create_react_agent
9
+
10
+ from beamlit.api.models import get_model_deployment
11
+ from beamlit.authentication import new_client
12
+ from beamlit.common.settings import get_settings, init
13
+ from beamlit.errors import UnexpectedStatus
14
+ from beamlit.models import AgentDeployment
15
+
16
+ from .chat import get_chat_model
17
+
18
+
19
+ def get_functions(dir="src/functions", from_decorator="function"):
20
+ functions = []
21
+ logger = getLogger(__name__)
22
+
23
+ # Walk through all Python files in functions directory and subdirectories
24
+ for root, _, files in os.walk(dir):
25
+ for file in files:
26
+ if file.endswith(".py"):
27
+ file_path = os.path.join(root, file)
28
+ # Read and compile the file content
29
+ with open(file_path) as f:
30
+ try:
31
+ file_content = f.read()
32
+ # Parse the file content to find decorated functions
33
+ tree = ast.parse(file_content)
34
+
35
+ # Look for function definitions with decorators
36
+ for node in ast.walk(tree):
37
+ if (
38
+ not isinstance(node, ast.FunctionDef)
39
+ or len(node.decorator_list) == 0
40
+ ):
41
+ continue
42
+ decorator = node.decorator_list[0]
43
+
44
+ decorator_name = ""
45
+ if isinstance(decorator, ast.Call):
46
+ decorator_name = decorator.func.id
47
+ if isinstance(decorator, ast.Name):
48
+ decorator_name = decorator.id
49
+
50
+ if decorator_name == from_decorator:
51
+ # Get the function name and decorator name
52
+ func_name = node.name
53
+
54
+ # Import the module to get the actual function
55
+ spec = importlib.util.spec_from_file_location(func_name, file_path)
56
+ module = importlib.util.module_from_spec(spec)
57
+ spec.loader.exec_module(module)
58
+ # Check if kit=True in the decorator arguments
59
+ is_kit = False
60
+ if isinstance(decorator, ast.Call):
61
+ for keyword in decorator.keywords:
62
+ if keyword.arg == "kit" and isinstance(
63
+ keyword.value, ast.Constant
64
+ ):
65
+ is_kit = keyword.value.value
66
+ if is_kit:
67
+ kit_functions = get_functions(
68
+ dir=os.path.join(root),
69
+ from_decorator="kit",
70
+ )
71
+ functions.extend(kit_functions)
72
+
73
+ # Get the decorated function
74
+ if not is_kit and hasattr(module, func_name):
75
+ func = getattr(module, func_name)
76
+ functions.append(func)
77
+ except Exception as e:
78
+ logger.warning(f"Error processing {file_path}: {e!s}")
79
+ return functions
80
+
81
+
82
+ def agent(
83
+ bl_agent: AgentDeployment = None,
84
+ chat_model=None,
85
+ agent=None,
86
+ ):
87
+ settings = init()
88
+ logger = getLogger(__name__)
89
+
90
+ def wrapper(func):
91
+ settings = get_settings()
92
+
93
+ def wrapped(*args, **kwargs):
94
+ return func(
95
+ settings.agent.agent,
96
+ settings.agent.chat_model,
97
+ settings.agent.functions,
98
+ *args,
99
+ **kwargs,
100
+ )
101
+
102
+ return wrapped
103
+
104
+ # Initialize functions array to store decorated functions
105
+ functions = get_functions(dir=settings.agent.functions_directory)
106
+ settings.agent.functions = functions
107
+
108
+ if bl_agent.model and chat_model is None:
109
+ client = new_client()
110
+ try:
111
+ response = get_model_deployment.sync_detailed(
112
+ bl_agent.model, settings.environment, client=client
113
+ )
114
+ settings.agent.model = response.parsed
115
+ except UnexpectedStatus as e:
116
+ if e.status_code == 404 and settings.environment != "production":
117
+ try:
118
+ response = get_model_deployment.sync_detailed(
119
+ bl_agent.model, "production", client=client
120
+ )
121
+ settings.agent.model = response.parsed
122
+ except UnexpectedStatus as e:
123
+ if e.status_code == 404:
124
+ raise ValueError(f"Model {bl_agent.model} not found")
125
+ else:
126
+ raise e
127
+ chat_model = get_chat_model(settings.agent.model)
128
+ settings.agent.chat_model = chat_model
129
+ runtime = settings.agent.model.runtime
130
+ logger.info(f"Chat model configured, using: {runtime.type_}:{runtime.model}")
131
+
132
+ if len(functions) == 0:
133
+ raise ValueError(
134
+ "You must define at least one function, you can define this function in directory "
135
+ f'"{settings.agent.functions_directory}". Here is a sample function you can use:\n\n'
136
+ "from beamlit.functions import function\n\n"
137
+ "@function()\n"
138
+ "def hello_world(query: str):\n"
139
+ " return 'Hello, world!'\n"
140
+ )
141
+
142
+ if agent is None and chat_model is not None:
143
+ memory = MemorySaver()
144
+ agent = create_react_agent(chat_model, functions, checkpointer=memory)
145
+ settings.agent.agent = agent
146
+
147
+ return wrapper
@@ -21,7 +21,9 @@ def _get_kwargs(
21
21
  return _kwargs
22
22
 
23
23
 
24
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AgentHistory]:
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[AgentHistory]:
25
27
  if response.status_code == 200:
26
28
  response_200 = AgentHistory.from_dict(response.json())
27
29
 
@@ -32,7 +34,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
32
34
  return None
33
35
 
34
36
 
35
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AgentHistory]:
37
+ def _build_response(
38
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
+ ) -> Response[AgentHistory]:
36
40
  return Response(
37
41
  status_code=HTTPStatus(response.status_code),
38
42
  content=response.content,
@@ -1,5 +1,5 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, List, Optional, Union
2
+ from typing import Any, Optional, Union
3
3
 
4
4
  import httpx
5
5
 
@@ -23,7 +23,7 @@ def _get_kwargs(
23
23
 
24
24
  def _parse_response(
25
25
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[List["ResourceDeploymentLog"]]:
26
+ ) -> Optional[list["ResourceDeploymentLog"]]:
27
27
  if response.status_code == 200:
28
28
  response_200 = []
29
29
  _response_200 = response.json()
@@ -41,7 +41,7 @@ def _parse_response(
41
41
 
42
42
  def _build_response(
43
43
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
- ) -> Response[List["ResourceDeploymentLog"]]:
44
+ ) -> Response[list["ResourceDeploymentLog"]]:
45
45
  return Response(
46
46
  status_code=HTTPStatus(response.status_code),
47
47
  content=response.content,
@@ -55,7 +55,7 @@ def sync_detailed(
55
55
  environment_name: str,
56
56
  *,
57
57
  client: AuthenticatedClient,
58
- ) -> Response[List["ResourceDeploymentLog"]]:
58
+ ) -> Response[list["ResourceDeploymentLog"]]:
59
59
  """
60
60
  Args:
61
61
  agent_name (str):
@@ -66,7 +66,7 @@ def sync_detailed(
66
66
  httpx.TimeoutException: If the request takes longer than Client.timeout.
67
67
 
68
68
  Returns:
69
- Response[List['ResourceDeploymentLog']]
69
+ Response[list['ResourceDeploymentLog']]
70
70
  """
71
71
 
72
72
  kwargs = _get_kwargs(
@@ -86,7 +86,7 @@ def sync(
86
86
  environment_name: str,
87
87
  *,
88
88
  client: AuthenticatedClient,
89
- ) -> Optional[List["ResourceDeploymentLog"]]:
89
+ ) -> Optional[list["ResourceDeploymentLog"]]:
90
90
  """
91
91
  Args:
92
92
  agent_name (str):
@@ -97,7 +97,7 @@ def sync(
97
97
  httpx.TimeoutException: If the request takes longer than Client.timeout.
98
98
 
99
99
  Returns:
100
- List['ResourceDeploymentLog']
100
+ list['ResourceDeploymentLog']
101
101
  """
102
102
 
103
103
  return sync_detailed(
@@ -112,7 +112,7 @@ async def asyncio_detailed(
112
112
  environment_name: str,
113
113
  *,
114
114
  client: AuthenticatedClient,
115
- ) -> Response[List["ResourceDeploymentLog"]]:
115
+ ) -> Response[list["ResourceDeploymentLog"]]:
116
116
  """
117
117
  Args:
118
118
  agent_name (str):
@@ -123,7 +123,7 @@ async def asyncio_detailed(
123
123
  httpx.TimeoutException: If the request takes longer than Client.timeout.
124
124
 
125
125
  Returns:
126
- Response[List['ResourceDeploymentLog']]
126
+ Response[list['ResourceDeploymentLog']]
127
127
  """
128
128
 
129
129
  kwargs = _get_kwargs(
@@ -141,7 +141,7 @@ async def asyncio(
141
141
  environment_name: str,
142
142
  *,
143
143
  client: AuthenticatedClient,
144
- ) -> Optional[List["ResourceDeploymentLog"]]:
144
+ ) -> Optional[list["ResourceDeploymentLog"]]:
145
145
  """
146
146
  Args:
147
147
  agent_name (str):
@@ -152,7 +152,7 @@ async def asyncio(
152
152
  httpx.TimeoutException: If the request takes longer than Client.timeout.
153
153
 
154
154
  Returns:
155
- List['ResourceDeploymentLog']
155
+ list['ResourceDeploymentLog']
156
156
  """
157
157
 
158
158
  return (
@@ -21,7 +21,9 @@ def _get_kwargs(
21
21
  return _kwargs
22
22
 
23
23
 
24
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AgentHistory]:
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[AgentHistory]:
25
27
  if response.status_code == 200:
26
28
  response_200 = AgentHistory.from_dict(response.json())
27
29
 
@@ -32,7 +34,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
32
34
  return None
33
35
 
34
36
 
35
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AgentHistory]:
37
+ def _build_response(
38
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
+ ) -> Response[AgentHistory]:
36
40
  return Response(
37
41
  status_code=HTTPStatus(response.status_code),
38
42
  content=response.content,
@@ -1,5 +1,5 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, List, Optional, Union
2
+ from typing import Any, Optional, Union
3
3
 
4
4
  import httpx
5
5
 
@@ -23,7 +23,7 @@ def _get_kwargs(
23
23
 
24
24
  def _parse_response(
25
25
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[List["AgentDeploymentHistory"]]:
26
+ ) -> Optional[list["AgentDeploymentHistory"]]:
27
27
  if response.status_code == 200:
28
28
  response_200 = []
29
29
  _response_200 = response.json()
@@ -41,7 +41,7 @@ def _parse_response(
41
41
 
42
42
  def _build_response(
43
43
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
- ) -> Response[List["AgentDeploymentHistory"]]:
44
+ ) -> Response[list["AgentDeploymentHistory"]]:
45
45
  return Response(
46
46
  status_code=HTTPStatus(response.status_code),
47
47
  content=response.content,
@@ -55,7 +55,7 @@ def sync_detailed(
55
55
  environment_name: str,
56
56
  *,
57
57
  client: AuthenticatedClient,
58
- ) -> Response[List["AgentDeploymentHistory"]]:
58
+ ) -> Response[list["AgentDeploymentHistory"]]:
59
59
  """
60
60
  Args:
61
61
  agent_name (str):
@@ -66,7 +66,7 @@ def sync_detailed(
66
66
  httpx.TimeoutException: If the request takes longer than Client.timeout.
67
67
 
68
68
  Returns:
69
- Response[List['AgentDeploymentHistory']]
69
+ Response[list['AgentDeploymentHistory']]
70
70
  """
71
71
 
72
72
  kwargs = _get_kwargs(
@@ -86,7 +86,7 @@ def sync(
86
86
  environment_name: str,
87
87
  *,
88
88
  client: AuthenticatedClient,
89
- ) -> Optional[List["AgentDeploymentHistory"]]:
89
+ ) -> Optional[list["AgentDeploymentHistory"]]:
90
90
  """
91
91
  Args:
92
92
  agent_name (str):
@@ -97,7 +97,7 @@ def sync(
97
97
  httpx.TimeoutException: If the request takes longer than Client.timeout.
98
98
 
99
99
  Returns:
100
- List['AgentDeploymentHistory']
100
+ list['AgentDeploymentHistory']
101
101
  """
102
102
 
103
103
  return sync_detailed(
@@ -112,7 +112,7 @@ async def asyncio_detailed(
112
112
  environment_name: str,
113
113
  *,
114
114
  client: AuthenticatedClient,
115
- ) -> Response[List["AgentDeploymentHistory"]]:
115
+ ) -> Response[list["AgentDeploymentHistory"]]:
116
116
  """
117
117
  Args:
118
118
  agent_name (str):
@@ -123,7 +123,7 @@ async def asyncio_detailed(
123
123
  httpx.TimeoutException: If the request takes longer than Client.timeout.
124
124
 
125
125
  Returns:
126
- Response[List['AgentDeploymentHistory']]
126
+ Response[list['AgentDeploymentHistory']]
127
127
  """
128
128
 
129
129
  kwargs = _get_kwargs(
@@ -141,7 +141,7 @@ async def asyncio(
141
141
  environment_name: str,
142
142
  *,
143
143
  client: AuthenticatedClient,
144
- ) -> Optional[List["AgentDeploymentHistory"]]:
144
+ ) -> Optional[list["AgentDeploymentHistory"]]:
145
145
  """
146
146
  Args:
147
147
  agent_name (str):
@@ -152,7 +152,7 @@ async def asyncio(
152
152
  httpx.TimeoutException: If the request takes longer than Client.timeout.
153
153
 
154
154
  Returns:
155
- List['AgentDeploymentHistory']
155
+ list['AgentDeploymentHistory']
156
156
  """
157
157
 
158
158
  return (
@@ -1,5 +1,5 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, List, Optional, Union
2
+ from typing import Any, Optional, Union
3
3
 
4
4
  import httpx
5
5
 
@@ -22,7 +22,7 @@ def _get_kwargs(
22
22
 
23
23
  def _parse_response(
24
24
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
- ) -> Optional[List["AgentDeployment"]]:
25
+ ) -> Optional[list["AgentDeployment"]]:
26
26
  if response.status_code == 200:
27
27
  response_200 = []
28
28
  _response_200 = response.json()
@@ -40,7 +40,7 @@ def _parse_response(
40
40
 
41
41
  def _build_response(
42
42
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
43
- ) -> Response[List["AgentDeployment"]]:
43
+ ) -> Response[list["AgentDeployment"]]:
44
44
  return Response(
45
45
  status_code=HTTPStatus(response.status_code),
46
46
  content=response.content,
@@ -53,7 +53,7 @@ def sync_detailed(
53
53
  agent_name: str,
54
54
  *,
55
55
  client: AuthenticatedClient,
56
- ) -> Response[List["AgentDeployment"]]:
56
+ ) -> Response[list["AgentDeployment"]]:
57
57
  """List all agent deployments
58
58
 
59
59
  Args:
@@ -64,7 +64,7 @@ def sync_detailed(
64
64
  httpx.TimeoutException: If the request takes longer than Client.timeout.
65
65
 
66
66
  Returns:
67
- Response[List['AgentDeployment']]
67
+ Response[list['AgentDeployment']]
68
68
  """
69
69
 
70
70
  kwargs = _get_kwargs(
@@ -82,7 +82,7 @@ def sync(
82
82
  agent_name: str,
83
83
  *,
84
84
  client: AuthenticatedClient,
85
- ) -> Optional[List["AgentDeployment"]]:
85
+ ) -> Optional[list["AgentDeployment"]]:
86
86
  """List all agent deployments
87
87
 
88
88
  Args:
@@ -93,7 +93,7 @@ def sync(
93
93
  httpx.TimeoutException: If the request takes longer than Client.timeout.
94
94
 
95
95
  Returns:
96
- List['AgentDeployment']
96
+ list['AgentDeployment']
97
97
  """
98
98
 
99
99
  return sync_detailed(
@@ -106,7 +106,7 @@ async def asyncio_detailed(
106
106
  agent_name: str,
107
107
  *,
108
108
  client: AuthenticatedClient,
109
- ) -> Response[List["AgentDeployment"]]:
109
+ ) -> Response[list["AgentDeployment"]]:
110
110
  """List all agent deployments
111
111
 
112
112
  Args:
@@ -117,7 +117,7 @@ async def asyncio_detailed(
117
117
  httpx.TimeoutException: If the request takes longer than Client.timeout.
118
118
 
119
119
  Returns:
120
- Response[List['AgentDeployment']]
120
+ Response[list['AgentDeployment']]
121
121
  """
122
122
 
123
123
  kwargs = _get_kwargs(
@@ -133,7 +133,7 @@ async def asyncio(
133
133
  agent_name: str,
134
134
  *,
135
135
  client: AuthenticatedClient,
136
- ) -> Optional[List["AgentDeployment"]]:
136
+ ) -> Optional[list["AgentDeployment"]]:
137
137
  """List all agent deployments
138
138
 
139
139
  Args:
@@ -144,7 +144,7 @@ async def asyncio(
144
144
  httpx.TimeoutException: If the request takes longer than Client.timeout.
145
145
 
146
146
  Returns:
147
- List['AgentDeployment']
147
+ list['AgentDeployment']
148
148
  """
149
149
 
150
150
  return (