beamlit 0.0.30rc35__tar.gz → 0.0.31__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. {beamlit-0.0.30rc35 → beamlit-0.0.31}/PKG-INFO +1 -1
  2. {beamlit-0.0.30rc35 → beamlit-0.0.31}/pyproject.toml +1 -1
  3. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/agents/chain.py +5 -5
  4. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/agents/decorator.py +4 -3
  5. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/create_workspace_service_account.py +3 -1
  6. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/delete_workspace_service_account.py +3 -1
  7. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/get_workspace_service_accounts.py +3 -1
  8. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/update_workspace_service_account.py +3 -1
  9. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/authentication/authentication.py +8 -4
  10. beamlit-0.0.31/src/beamlit/common/instrumentation.py +123 -0
  11. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/common/logger.py +1 -1
  12. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/common/settings.py +11 -6
  13. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/deploy/deploy.py +29 -8
  14. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/deploy/format.py +2 -0
  15. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/decorator.py +10 -3
  16. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/mcp/mcp.py +3 -2
  17. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/remote/remote.py +3 -2
  18. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/__init__.py +9 -3
  19. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_environment_metrics.py +3 -1
  20. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/run.py +1 -0
  21. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/serve/app.py +18 -12
  22. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/integrationtest/agent.py +1 -0
  23. beamlit-0.0.31/src/integrationtest/functions/helloworld.py +13 -0
  24. {beamlit-0.0.30rc35 → beamlit-0.0.31}/uv.lock +390 -392
  25. beamlit-0.0.30rc35/src/beamlit/common/instrumentation.py +0 -101
  26. beamlit-0.0.30rc35/src/integrationtest/functions/helloworld.py +0 -7
  27. {beamlit-0.0.30rc35 → beamlit-0.0.31}/.gitignore +0 -0
  28. {beamlit-0.0.30rc35 → beamlit-0.0.31}/README.md +0 -0
  29. {beamlit-0.0.30rc35 → beamlit-0.0.31}/beamlit.yaml +0 -0
  30. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/__init__.py +0 -0
  31. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/agents/__init__.py +0 -0
  32. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/agents/chat.py +0 -0
  33. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/__init__.py +0 -0
  34. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/__init__.py +0 -0
  35. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/create_agent.py +0 -0
  36. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/create_agent_release.py +0 -0
  37. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/delete_agent.py +0 -0
  38. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/delete_agent_history.py +0 -0
  39. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/get_agent.py +0 -0
  40. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/get_agent_environment_logs.py +0 -0
  41. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/get_agent_history.py +0 -0
  42. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/get_agent_metrics.py +0 -0
  43. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/get_agent_trace_ids.py +0 -0
  44. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/list_agent_history.py +0 -0
  45. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/list_agents.py +0 -0
  46. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/put_agent_history.py +0 -0
  47. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/agents/update_agent.py +0 -0
  48. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/configurations/__init__.py +0 -0
  49. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/configurations/get_configuration.py +0 -0
  50. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/default/__init__.py +0 -0
  51. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/default/get_trace.py +0 -0
  52. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/default/get_trace_ids.py +0 -0
  53. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/default/get_trace_logs.py +0 -0
  54. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/environments/__init__.py +0 -0
  55. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/environments/create_environment.py +0 -0
  56. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/environments/delete_environment.py +0 -0
  57. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/environments/get_environment.py +0 -0
  58. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/environments/get_environment_metrics.py +0 -0
  59. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/environments/list_environments.py +0 -0
  60. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/environments/update_environment.py +0 -0
  61. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/__init__.py +0 -0
  62. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/create_function.py +0 -0
  63. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/create_function_release.py +0 -0
  64. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/delete_function.py +0 -0
  65. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/get_function.py +0 -0
  66. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/get_function_environment_logs.py +0 -0
  67. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/get_function_metrics.py +0 -0
  68. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/get_function_trace_ids.py +0 -0
  69. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/list_functions.py +0 -0
  70. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/functions/update_function.py +0 -0
  71. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/history/__init__.py +0 -0
  72. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/history/get_agents_history.py +0 -0
  73. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/history/list_agents_history.py +0 -0
  74. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/__init__.py +0 -0
  75. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/create_integration_connection.py +0 -0
  76. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/delete_integration_connection.py +0 -0
  77. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/get_integration.py +0 -0
  78. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/get_integration_connection.py +0 -0
  79. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/get_integration_connection_model.py +0 -0
  80. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/get_integration_model.py +0 -0
  81. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/list_integration_connection_models.py +0 -0
  82. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/list_integration_connections.py +0 -0
  83. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/list_integration_models.py +0 -0
  84. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/integrations/update_integration_connection.py +0 -0
  85. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/invitations/__init__.py +0 -0
  86. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/invitations/list_all_pending_invitations.py +0 -0
  87. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/locations/__init__.py +0 -0
  88. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/locations/list_locations.py +0 -0
  89. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/metrics/__init__.py +0 -0
  90. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/metrics/get_metrics.py +0 -0
  91. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/model_providers/__init__.py +0 -0
  92. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/model_providers/create_model_provider.py +0 -0
  93. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/model_providers/delete_model_provider.py +0 -0
  94. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/model_providers/get_model_provider.py +0 -0
  95. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/model_providers/list_model_providers.py +0 -0
  96. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/model_providers/update_model_provider.py +0 -0
  97. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/__init__.py +0 -0
  98. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/create_model.py +0 -0
  99. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/delete_model.py +0 -0
  100. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/get_model.py +0 -0
  101. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/get_model_environment_logs.py +0 -0
  102. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/get_model_metrics.py +0 -0
  103. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/get_model_trace_ids.py +0 -0
  104. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/list_models.py +0 -0
  105. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/release_model.py +0 -0
  106. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/models/update_model.py +0 -0
  107. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/policies/__init__.py +0 -0
  108. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/policies/create_policy.py +0 -0
  109. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/policies/delete_policy.py +0 -0
  110. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/policies/get_policy.py +0 -0
  111. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/policies/list_policies.py +0 -0
  112. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/policies/update_policy.py +0 -0
  113. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/__init__.py +0 -0
  114. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/create_private_cluster.py +0 -0
  115. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/delete_private_cluster.py +0 -0
  116. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/get_private_cluster.py +0 -0
  117. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/get_private_cluster_health.py +0 -0
  118. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/list_private_clusters.py +0 -0
  119. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/update_private_cluster.py +0 -0
  120. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/privateclusters/update_private_cluster_health.py +0 -0
  121. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/__init__.py +0 -0
  122. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/create_api_key_for_service_account.py +0 -0
  123. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/delete_api_key_for_service_account.py +0 -0
  124. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/service_accounts/list_api_keys_for_service_account.py +0 -0
  125. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/store/__init__.py +0 -0
  126. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/store/get_store_agent.py +0 -0
  127. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/store/get_store_function.py +0 -0
  128. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/store/list_store_agents.py +0 -0
  129. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/store/list_store_functions.py +0 -0
  130. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/__init__.py +0 -0
  131. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/accept_workspace_invitation.py +0 -0
  132. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/create_worspace.py +0 -0
  133. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/decline_workspace_invitation.py +0 -0
  134. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/delete_workspace.py +0 -0
  135. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/get_workspace.py +0 -0
  136. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/invite_workspace_user.py +0 -0
  137. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/leave_workspace.py +0 -0
  138. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/list_workspace_users.py +0 -0
  139. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/list_workspaces.py +0 -0
  140. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/remove_workspace_user.py +0 -0
  141. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/update_workspace.py +0 -0
  142. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/api/workspaces/update_workspace_user_role.py +0 -0
  143. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/authentication/__init__.py +0 -0
  144. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/authentication/apikey.py +0 -0
  145. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/authentication/clientcredentials.py +0 -0
  146. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/authentication/credentials.py +0 -0
  147. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/authentication/device_mode.py +0 -0
  148. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/client.py +0 -0
  149. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/common/__init__.py +0 -0
  150. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/common/error.py +0 -0
  151. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/common/generate.py +0 -0
  152. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/common/secrets.py +0 -0
  153. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/common/utils.py +0 -0
  154. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/deploy/__init__.py +0 -0
  155. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/deploy/parser.py +0 -0
  156. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/errors.py +0 -0
  157. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/__init__.py +0 -0
  158. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/github/__init__.py +0 -0
  159. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/github/github.py +0 -0
  160. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/github/kit/__init__.py +0 -0
  161. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/github/kit/pull_request.py +0 -0
  162. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/math/__init__.py +0 -0
  163. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/math/math.py +0 -0
  164. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/search/__init__.py +0 -0
  165. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/functions/search/search.py +0 -0
  166. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/acl.py +0 -0
  167. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/agent.py +0 -0
  168. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/agent_chain.py +0 -0
  169. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/agent_history.py +0 -0
  170. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/agent_history_event.py +0 -0
  171. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/agent_metadata.py +0 -0
  172. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/agent_release.py +0 -0
  173. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/agent_spec.py +0 -0
  174. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/api_key.py +0 -0
  175. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/configuration.py +0 -0
  176. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/continent.py +0 -0
  177. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/core_spec.py +0 -0
  178. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/core_spec_configurations.py +0 -0
  179. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/core_status.py +0 -0
  180. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/country.py +0 -0
  181. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/create_api_key_for_service_account_body.py +0 -0
  182. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/create_workspace_service_account_body.py +0 -0
  183. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/create_workspace_service_account_response_200.py +0 -0
  184. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/delete_workspace_service_account_response_200.py +0 -0
  185. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/environment.py +0 -0
  186. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/environment_metadata.py +0 -0
  187. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/environment_metrics.py +0 -0
  188. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/environment_spec.py +0 -0
  189. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/flavor.py +0 -0
  190. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/function.py +0 -0
  191. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/function_kit.py +0 -0
  192. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/function_metadata.py +0 -0
  193. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/function_release.py +0 -0
  194. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/function_spec.py +0 -0
  195. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/get_trace_ids_response_200.py +0 -0
  196. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/get_trace_logs_response_200.py +0 -0
  197. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/get_trace_response_200.py +0 -0
  198. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/get_workspace_service_accounts_response_200_item.py +0 -0
  199. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/increase_and_rate_metric.py +0 -0
  200. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/integration_config.py +0 -0
  201. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/integration_connection.py +0 -0
  202. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/integration_connection_config.py +0 -0
  203. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/integration_connection_secret.py +0 -0
  204. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/integration_connection_spec.py +0 -0
  205. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/integration_model.py +0 -0
  206. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/invite_workspace_user_body.py +0 -0
  207. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/location_response.py +0 -0
  208. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/metadata.py +0 -0
  209. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/metadata_labels.py +0 -0
  210. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/metric.py +0 -0
  211. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/metrics.py +0 -0
  212. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/model.py +0 -0
  213. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/model_metadata.py +0 -0
  214. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/model_private_cluster.py +0 -0
  215. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/model_provider.py +0 -0
  216. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/model_release.py +0 -0
  217. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/model_spec.py +0 -0
  218. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/owner_fields.py +0 -0
  219. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/pending_invitation.py +0 -0
  220. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/pending_invitation_accept.py +0 -0
  221. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/pending_invitation_render.py +0 -0
  222. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/pending_invitation_render_invited_by.py +0 -0
  223. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/pending_invitation_render_workspace.py +0 -0
  224. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/pending_invitation_workspace_details.py +0 -0
  225. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/pod_template_spec.py +0 -0
  226. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/policy.py +0 -0
  227. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/policy_location.py +0 -0
  228. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/policy_spec.py +0 -0
  229. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/private_cluster.py +0 -0
  230. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/private_location.py +0 -0
  231. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/provider_config.py +0 -0
  232. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/qps.py +0 -0
  233. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_deployment_metrics.py +0 -0
  234. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +0 -0
  235. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +0 -0
  236. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_environment_metrics_inference_per_region.py +0 -0
  237. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +0 -0
  238. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_environment_metrics_query_per_region_per_code.py +0 -0
  239. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +0 -0
  240. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_log.py +0 -0
  241. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/resource_metrics.py +0 -0
  242. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/runtime.py +0 -0
  243. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/runtime_readiness_probe.py +0 -0
  244. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/runtime_resources.py +0 -0
  245. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/serverless_config.py +0 -0
  246. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/spec_configuration.py +0 -0
  247. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_agent.py +0 -0
  248. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_agent_labels.py +0 -0
  249. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_configuration.py +0 -0
  250. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_configuration_option.py +0 -0
  251. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_function.py +0 -0
  252. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_function_kit.py +0 -0
  253. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_function_labels.py +0 -0
  254. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/store_function_parameter.py +0 -0
  255. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/time_fields.py +0 -0
  256. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/trace_ids_response.py +0 -0
  257. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/update_workspace_service_account_body.py +0 -0
  258. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/update_workspace_service_account_response_200.py +0 -0
  259. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/update_workspace_user_role_body.py +0 -0
  260. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/websocket_channel.py +0 -0
  261. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/workspace.py +0 -0
  262. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/workspace_labels.py +0 -0
  263. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/models/workspace_user.py +0 -0
  264. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/py.typed +0 -0
  265. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/serve/middlewares/__init__.py +0 -0
  266. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/serve/middlewares/accesslog.py +0 -0
  267. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/serve/middlewares/processtime.py +0 -0
  268. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/beamlit/types.py +0 -0
  269. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/integrationtest/beamlit.yaml +0 -0
  270. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/integrationtest/main.py +0 -0
  271. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/integrationtest/pyproject.toml +0 -0
  272. {beamlit-0.0.30rc35 → beamlit-0.0.31}/src/integrationtest/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.30rc35
3
+ Version: 0.0.31
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "beamlit"
3
- version = "0.0.30.pre-35"
3
+ version = "0.0.31"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -1,17 +1,17 @@
1
1
  import asyncio
2
- from dataclasses import dataclass
3
2
  import warnings
4
- from typing import Any, Callable
3
+ from dataclasses import dataclass
4
+ from typing import Callable
5
5
 
6
6
  import pydantic
7
7
  import typing_extensions as t
8
+ from langchain_core.tools.base import BaseTool, ToolException
9
+
8
10
  from beamlit.api.agents import list_agents
9
11
  from beamlit.authentication.authentication import AuthenticatedClient
12
+ from beamlit.common.settings import get_settings
10
13
  from beamlit.models import Agent, AgentChain
11
14
  from beamlit.run import RunClient
12
- from beamlit.common.settings import get_settings
13
- from langchain_core.tools.base import BaseTool, ToolException
14
-
15
15
 
16
16
 
17
17
  class ChainTool(BaseTool):
@@ -6,6 +6,10 @@ import importlib
6
6
  import os
7
7
  from logging import getLogger
8
8
 
9
+ from langchain_core.tools import Tool
10
+ from langgraph.checkpoint.memory import MemorySaver
11
+ from langgraph.prebuilt import create_react_agent
12
+
9
13
  from beamlit.api.models import get_model
10
14
  from beamlit.authentication import new_client
11
15
  from beamlit.common.settings import init
@@ -13,9 +17,6 @@ from beamlit.errors import UnexpectedStatus
13
17
  from beamlit.functions.mcp.mcp import MCPClient, MCPToolkit
14
18
  from beamlit.functions.remote.remote import RemoteToolkit
15
19
  from beamlit.models import Agent, AgentMetadata, AgentSpec
16
- from langchain_core.tools import Tool
17
- from langgraph.checkpoint.memory import MemorySaver
18
- from langgraph.prebuilt import create_react_agent
19
20
 
20
21
  from .chain import ChainToolkit
21
22
  from .chat import get_chat_model
@@ -6,7 +6,9 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.create_workspace_service_account_body import CreateWorkspaceServiceAccountBody
9
- from ...models.create_workspace_service_account_response_200 import CreateWorkspaceServiceAccountResponse200
9
+ from ...models.create_workspace_service_account_response_200 import (
10
+ CreateWorkspaceServiceAccountResponse200,
11
+ )
10
12
  from ...types import Response
11
13
 
12
14
 
@@ -5,7 +5,9 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.delete_workspace_service_account_response_200 import DeleteWorkspaceServiceAccountResponse200
8
+ from ...models.delete_workspace_service_account_response_200 import (
9
+ DeleteWorkspaceServiceAccountResponse200,
10
+ )
9
11
  from ...types import Response
10
12
 
11
13
 
@@ -5,7 +5,9 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.get_workspace_service_accounts_response_200_item import GetWorkspaceServiceAccountsResponse200Item
8
+ from ...models.get_workspace_service_accounts_response_200_item import (
9
+ GetWorkspaceServiceAccountsResponse200Item,
10
+ )
9
11
  from ...types import Response
10
12
 
11
13
 
@@ -6,7 +6,9 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.update_workspace_service_account_body import UpdateWorkspaceServiceAccountBody
9
- from ...models.update_workspace_service_account_response_200 import UpdateWorkspaceServiceAccountResponse200
9
+ from ...models.update_workspace_service_account_response_200 import (
10
+ UpdateWorkspaceServiceAccountResponse200,
11
+ )
10
12
  from ...types import Response
11
13
 
12
14
 
@@ -1,15 +1,19 @@
1
- import os
2
1
  from dataclasses import dataclass
3
2
  from typing import Dict, Generator
4
3
 
5
- from beamlit.common.settings import Settings, get_settings
6
4
  from httpx import Auth, Request, Response
7
5
 
6
+ from beamlit.common.settings import Settings, get_settings
7
+
8
8
  from ..client import AuthenticatedClient
9
9
  from .apikey import ApiKeyProvider
10
10
  from .clientcredentials import ClientCredentials
11
- from .credentials import (Credentials, current_context, load_credentials,
12
- load_credentials_from_settings)
11
+ from .credentials import (
12
+ Credentials,
13
+ current_context,
14
+ load_credentials,
15
+ load_credentials_from_settings,
16
+ )
13
17
  from .device_mode import BearerToken
14
18
 
15
19
 
@@ -0,0 +1,123 @@
1
+ from typing import Any
2
+
3
+ from fastapi import FastAPI
4
+ from opentelemetry import metrics, trace
5
+ from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import (
6
+ OTLPMetricExporter,
7
+ )
8
+ from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
9
+ OTLPSpanExporter,
10
+ )
11
+ from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
12
+ from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
13
+ from opentelemetry.instrumentation.logging import LoggingInstrumentor
14
+ from opentelemetry.metrics import NoOpMeterProvider
15
+ from opentelemetry.sdk.metrics import MeterProvider
16
+ from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
17
+ from opentelemetry.sdk.resources import Resource
18
+ from opentelemetry.sdk.trace import TracerProvider
19
+ from opentelemetry.sdk.trace.export import BatchSpanProcessor
20
+ from opentelemetry.trace import NoOpTracerProvider
21
+ from typing_extensions import Dict
22
+
23
+ from .settings import get_settings
24
+
25
+ tracer: trace.Tracer | None = None
26
+ meter: metrics.Meter | None = None
27
+
28
+
29
+ def get_tracer() -> trace.Tracer:
30
+ if tracer is None:
31
+ raise Exception("Tracer is not initialized")
32
+ return tracer
33
+
34
+
35
+ def get_meter() -> metrics.Meter:
36
+ if meter is None:
37
+ raise Exception("Meter is not initialized")
38
+ return meter
39
+
40
+
41
+ def get_resource_attributes() -> Dict[str, Any]:
42
+ resources = Resource.create()
43
+ resources_dict: Dict[str, Any] = {}
44
+ for key in resources.attributes:
45
+ resources_dict[key] = resources.attributes[key]
46
+ settings = get_settings()
47
+ if settings is None:
48
+ raise Exception("Settings are not initialized")
49
+ resources_dict["workspace"] = settings.workspace
50
+ resources_dict["service.name"] = settings.name
51
+ return resources_dict
52
+
53
+
54
+ def get_metrics_exporter() -> OTLPMetricExporter | None:
55
+ settings = get_settings()
56
+ if settings is None:
57
+ raise Exception("Settings are not initialized")
58
+ if not settings.enable_opentelemetry:
59
+ # Return None or a NoOpExporter equivalent
60
+ return None
61
+ return OTLPMetricExporter()
62
+
63
+
64
+ def get_span_exporter() -> OTLPSpanExporter | None:
65
+ settings = get_settings()
66
+ if not settings.enable_opentelemetry:
67
+ return None
68
+ return OTLPSpanExporter()
69
+
70
+
71
+ def instrument_app(app: FastAPI):
72
+ global tracer
73
+ global meter
74
+ settings = get_settings()
75
+ if settings is None:
76
+ raise Exception("Settings are not initialized")
77
+
78
+ if not settings.enable_opentelemetry:
79
+ # Use NoOp implementations to stub tracing and metrics
80
+ trace.set_tracer_provider(NoOpTracerProvider())
81
+ tracer = trace.get_tracer(__name__)
82
+
83
+ metrics.set_meter_provider(NoOpMeterProvider())
84
+ meter = metrics.get_meter(__name__)
85
+ return
86
+
87
+ resource = Resource.create(
88
+ {
89
+ "service.name": settings.name,
90
+ "service.namespace": settings.workspace,
91
+ "service.workspace": settings.workspace,
92
+ }
93
+ )
94
+
95
+ # Set up the TracerProvider if not already set
96
+ if not isinstance(trace.get_tracer_provider(), TracerProvider):
97
+ trace_provider = TracerProvider(resource=resource)
98
+ span_processor = BatchSpanProcessor(get_span_exporter())
99
+ trace_provider.add_span_processor(span_processor)
100
+ trace.set_tracer_provider(trace_provider)
101
+ tracer = trace_provider.get_tracer(__name__)
102
+ else:
103
+ tracer = trace.get_tracer(__name__)
104
+
105
+ # Set up the MeterProvider if not already set
106
+ if not isinstance(metrics.get_meter_provider(), MeterProvider):
107
+ metrics_exporter = PeriodicExportingMetricReader(get_metrics_exporter())
108
+ meter_provider = MeterProvider(
109
+ resource=resource, metric_readers=[metrics_exporter]
110
+ )
111
+ metrics.set_meter_provider(meter_provider)
112
+ meter = meter_provider.get_meter(__name__)
113
+ else:
114
+ meter = metrics.get_meter(__name__)
115
+
116
+ # Only instrument the app when OpenTelemetry is enabled
117
+ FastAPIInstrumentor.instrument_app(
118
+ app=app, tracer_provider=trace.get_tracer_provider(), meter_provider=metrics.get_meter_provider()
119
+ )
120
+ HTTPXClientInstrumentor().instrument(meter_provider=metrics.get_meter_provider())
121
+ LoggingInstrumentor(tracer_provider=trace.get_tracer_provider()).instrument(
122
+ set_logging_format=True
123
+ )
@@ -27,5 +27,5 @@ def init(log_level: str):
27
27
  logging.getLogger("httpx").propagate = False
28
28
 
29
29
  handler = logging.StreamHandler()
30
- handler.setFormatter(ColoredFormatter(f"%(levelname)s %(name)s - %(message)s"))
30
+ handler.setFormatter(ColoredFormatter("%(levelname)s %(name)s - %(message)s"))
31
31
  logging.basicConfig(level=log_level, handlers=[handler])
@@ -2,6 +2,16 @@ import os
2
2
  from logging import getLogger
3
3
  from typing import Tuple, Type, Union
4
4
 
5
+ from langchain_core.language_models.chat_models import BaseChatModel
6
+ from langgraph.graph.graph import CompiledGraph
7
+ from pydantic import Field
8
+ from pydantic_settings import (
9
+ BaseSettings,
10
+ PydanticBaseSettingsSource,
11
+ SettingsConfigDict,
12
+ YamlConfigSettingsSource,
13
+ )
14
+
5
15
  from beamlit.api.agents import get_agent
6
16
  from beamlit.api.functions import get_function
7
17
  from beamlit.api.models import get_model
@@ -9,11 +19,6 @@ from beamlit.client import AuthenticatedClient
9
19
  from beamlit.common.logger import init as init_logger
10
20
  from beamlit.models import Agent, Function, Model
11
21
  from beamlit.types import UNSET, Unset
12
- from langchain_core.language_models.chat_models import BaseChatModel
13
- from langgraph.graph.graph import CompiledGraph
14
- from pydantic import Field
15
- from pydantic_settings import (BaseSettings, PydanticBaseSettingsSource,
16
- SettingsConfigDict, YamlConfigSettingsSource)
17
22
 
18
23
  global SETTINGS
19
24
  SETTINGS = None
@@ -62,6 +67,7 @@ class Settings(BaseSettings):
62
67
  mcp_hub_url: str = Field(default="https://mcp-hub-server.beamlit.workers.com")
63
68
  registry_url: str = Field(default="https://us.registry.beamlit.com")
64
69
  log_level: str = Field(default="INFO")
70
+ enable_opentelemetry: bool = Field(default=False)
65
71
  agent: SettingsAgent = SettingsAgent()
66
72
  server: SettingsServer = SettingsServer()
67
73
  authentication: SettingsAuthentication = SettingsAuthentication()
@@ -99,7 +105,6 @@ def init_agent(
99
105
  client: AuthenticatedClient,
100
106
  destination: str = f"{os.getcwd()}/src/beamlit_generated.py",
101
107
  ):
102
- from beamlit.api.agents import get_agent_deployment
103
108
  from beamlit.common.generate import generate
104
109
 
105
110
  logger = getLogger(__name__)
@@ -2,12 +2,20 @@ import ast
2
2
  import json
3
3
  import os
4
4
  import sys
5
+ import uuid
5
6
  from logging import getLogger
6
7
  from typing import Literal
7
8
 
8
9
  from beamlit.common.settings import Settings, get_settings, init
9
- from beamlit.models import (Agent, AgentChain, AgentSpec, EnvironmentMetadata,
10
- Flavor, Function, FunctionSpec, Runtime)
10
+ from beamlit.models import (
11
+ Agent,
12
+ AgentSpec,
13
+ EnvironmentMetadata,
14
+ Flavor,
15
+ Function,
16
+ FunctionSpec,
17
+ Runtime,
18
+ )
11
19
 
12
20
  from .format import arg_to_dict, format_agent_chain, format_parameters
13
21
  from .parser import Resource, get_description, get_parameters, get_resources
@@ -15,11 +23,16 @@ from .parser import Resource, get_description, get_parameters, get_resources
15
23
  sys.path.insert(0, os.getcwd())
16
24
  sys.path.insert(0, os.path.join(os.getcwd(), "src"))
17
25
 
26
+ random_id = str(uuid.uuid4())[:8]
27
+ def slugify(name: str) -> str:
28
+ return name.lower().replace(" ", "-").replace("_", "-")
18
29
 
19
30
  def get_runtime_image(type: str, name: str) -> str:
20
31
  settings = get_settings()
21
32
  registry_url = settings.registry_url.replace("https://", "").replace("http://", "")
22
33
  image = f"{registry_url}/{settings.workspace}/{type}s/{name}"
34
+ # Generate a random ID to ensure unique image tags
35
+ image = f"{image}:{random_id}"
23
36
  return image
24
37
 
25
38
 
@@ -110,7 +123,7 @@ def get_agent_yaml(
110
123
  apiVersion: beamlit.com/v1alpha1
111
124
  kind: Agent
112
125
  metadata:
113
- name: {agent.metadata.name}
126
+ name: {slugify(agent.metadata.name)}
114
127
  displayName: {agent.metadata.display_name or agent.metadata.name}
115
128
  environment: {settings.environment}
116
129
  workspace: {settings.workspace}
@@ -144,7 +157,7 @@ def get_function_yaml(function: Function, settings: Settings) -> str:
144
157
  apiVersion: beamlit.com/v1alpha1
145
158
  kind: Function
146
159
  metadata:
147
- name: {function.metadata.name}
160
+ name: {slugify(function.metadata.name)}
148
161
  displayName: {function.metadata.display_name or function.metadata.name}
149
162
  environment: {settings.environment}
150
163
  spec:
@@ -244,21 +257,29 @@ def generate_beamlit_deployment(directory: str):
244
257
  # write deployment file
245
258
  agent_dir = os.path.join(agents_dir, agent.metadata.name)
246
259
  os.makedirs(agent_dir, exist_ok=True)
247
- with open(os.path.join(agent_dir, f"agent.yaml"), "w") as f:
260
+ with open(os.path.join(agent_dir, "agent.yaml"), "w") as f:
248
261
  content = get_agent_yaml(agent, functions, settings)
249
262
  f.write(content)
250
263
  # write dockerfile for build
251
- with open(os.path.join(agent_dir, f"Dockerfile"), "w") as f:
264
+ with open(os.path.join(agent_dir, "Dockerfile"), "w") as f:
252
265
  content = dockerfile("agent", resource, agent)
253
266
  f.write(content)
267
+ # write destination docker
268
+ with open(os.path.join(agent_dir, "destination.txt"), "w") as f:
269
+ content = agent.spec.runtime.image
270
+ f.write(content)
254
271
  for resource, function in functions:
255
272
  # write deployment file
256
273
  function_dir = os.path.join(functions_dir, function.metadata.name)
257
274
  os.makedirs(function_dir, exist_ok=True)
258
- with open(os.path.join(function_dir, f"function.yaml"), "w") as f:
275
+ with open(os.path.join(function_dir, "function.yaml"), "w") as f:
259
276
  content = get_function_yaml(function, settings)
260
277
  f.write(content)
261
278
  # write dockerfile for build
262
- with open(os.path.join(function_dir, f"Dockerfile"), "w") as f:
279
+ with open(os.path.join(function_dir, "Dockerfile"), "w") as f:
263
280
  content = dockerfile("function", resource, function)
264
281
  f.write(content)
282
+ # write destination docker
283
+ with open(os.path.join(function_dir, "destination.txt"), "w") as f:
284
+ content = function.spec.runtime.image
285
+ f.write(content)
@@ -1,7 +1,9 @@
1
1
 
2
2
  import ast
3
+
3
4
  from beamlit.models import AgentChain, StoreFunctionParameter
4
5
 
6
+
5
7
  def arg_to_list(arg: ast.List):
6
8
  value = []
7
9
  for v in arg.elts:
@@ -4,11 +4,12 @@ import json
4
4
  from collections.abc import Callable
5
5
  from logging import getLogger
6
6
 
7
+ from langchain_core.tools import create_schema_from_function
8
+
7
9
  from beamlit.authentication import new_client
8
10
  from beamlit.common.settings import get_settings
9
11
  from beamlit.models import Function, FunctionKit
10
12
  from beamlit.run import RunClient
11
- from langchain_core.tools import create_schema_from_function
12
13
 
13
14
  logger = getLogger(__name__)
14
15
 
@@ -67,10 +68,16 @@ def kit(bl_kit: FunctionKit = None, **kwargs: dict) -> Callable:
67
68
  return wrapper
68
69
 
69
70
 
70
- def function(*args, function: Function = None, kit=False, **kwargs: dict) -> Callable:
71
+ def function(*args, function: Function | dict = None, kit=False, **kwargs: dict) -> Callable:
71
72
  """Create function tools with Beamlit and LangChain integration."""
72
73
  settings = get_settings()
73
-
74
+ if function is not None and not isinstance(function, dict):
75
+ raise Exception(
76
+ 'function must be a dictionary, example: @function(function={"metadata": {"name": "my_function"}})'
77
+ )
78
+ if isinstance(function, dict):
79
+ function = Function(**function)
80
+
74
81
  def wrapper(func: Callable) -> Callable:
75
82
  if function and not func.__doc__ and function.spec and function.spec.description:
76
83
  func.__doc__ = function.spec.description
@@ -7,11 +7,12 @@ import pydantic
7
7
  import pydantic_core
8
8
  import requests
9
9
  import typing_extensions as t
10
- from beamlit.authentication.authentication import AuthenticatedClient
11
- from beamlit.common.settings import get_settings
12
10
  from langchain_core.tools.base import BaseTool, BaseToolkit, ToolException
13
11
  from mcp import ListToolsResult
14
12
 
13
+ from beamlit.authentication.authentication import AuthenticatedClient
14
+ from beamlit.common.settings import get_settings
15
+
15
16
  settings = get_settings()
16
17
 
17
18
  def create_dynamic_schema(name: str, schema: dict[str, t.Any]) -> type[pydantic.BaseModel]:
@@ -1,16 +1,17 @@
1
1
  import asyncio
2
2
  import warnings
3
3
  from dataclasses import dataclass
4
- from typing import Callable, Literal
4
+ from typing import Callable
5
5
 
6
6
  import pydantic
7
7
  import typing_extensions as t
8
+ from langchain_core.tools.base import BaseTool, ToolException
9
+
8
10
  from beamlit.api.functions import get_function
9
11
  from beamlit.authentication.authentication import AuthenticatedClient
10
12
  from beamlit.common.settings import get_settings
11
13
  from beamlit.models import Function, StoreFunctionParameter
12
14
  from beamlit.run import RunClient
13
- from langchain_core.tools.base import BaseTool, ToolException
14
15
 
15
16
 
16
17
  def create_dynamic_schema(name: str, parameters: list[StoreFunctionParameter]) -> type[pydantic.BaseModel]:
@@ -32,7 +32,9 @@ from .function_spec import FunctionSpec
32
32
  from .get_trace_ids_response_200 import GetTraceIdsResponse200
33
33
  from .get_trace_logs_response_200 import GetTraceLogsResponse200
34
34
  from .get_trace_response_200 import GetTraceResponse200
35
- from .get_workspace_service_accounts_response_200_item import GetWorkspaceServiceAccountsResponse200Item
35
+ from .get_workspace_service_accounts_response_200_item import (
36
+ GetWorkspaceServiceAccountsResponse200Item,
37
+ )
36
38
  from .increase_and_rate_metric import IncreaseAndRateMetric
37
39
  from .integration_config import IntegrationConfig
38
40
  from .integration_connection import IntegrationConnection
@@ -75,8 +77,12 @@ from .resource_deployment_metrics_query_per_second_per_region_per_code import (
75
77
  ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
76
78
  )
77
79
  from .resource_environment_metrics import ResourceEnvironmentMetrics
78
- from .resource_environment_metrics_inference_per_region import ResourceEnvironmentMetricsInferencePerRegion
79
- from .resource_environment_metrics_query_per_region_per_code import ResourceEnvironmentMetricsQueryPerRegionPerCode
80
+ from .resource_environment_metrics_inference_per_region import (
81
+ ResourceEnvironmentMetricsInferencePerRegion,
82
+ )
83
+ from .resource_environment_metrics_query_per_region_per_code import (
84
+ ResourceEnvironmentMetricsQueryPerRegionPerCode,
85
+ )
80
86
  from .resource_log import ResourceLog
81
87
  from .resource_metrics import ResourceMetrics
82
88
  from .runtime import Runtime
@@ -8,7 +8,9 @@ from ..types import UNSET, Unset
8
8
  if TYPE_CHECKING:
9
9
  from ..models.metric import Metric
10
10
  from ..models.qps import QPS
11
- from ..models.resource_environment_metrics_inference_per_region import ResourceEnvironmentMetricsInferencePerRegion
11
+ from ..models.resource_environment_metrics_inference_per_region import (
12
+ ResourceEnvironmentMetricsInferencePerRegion,
13
+ )
12
14
  from ..models.resource_environment_metrics_query_per_region_per_code import (
13
15
  ResourceEnvironmentMetricsQueryPerRegionPerCode,
14
16
  )
@@ -2,6 +2,7 @@ import urllib.parse
2
2
  from typing import Any
3
3
 
4
4
  import requests
5
+
5
6
  from beamlit.client import AuthenticatedClient
6
7
  from beamlit.common import HTTPError, get_settings
7
8
 
@@ -7,14 +7,18 @@ from logging import getLogger
7
7
  from uuid import uuid4
8
8
 
9
9
  from asgi_correlation_id import CorrelationIdMiddleware
10
- from beamlit.common import HTTPError, get_settings, init
11
- from beamlit.common.instrumentation import (get_metrics_exporter,
12
- get_resource_attributes,
13
- get_span_exporter, instrument_app)
14
10
  from fastapi import FastAPI, Request, Response
15
11
  from fastapi.responses import JSONResponse
16
12
  from traceloop.sdk import Traceloop
17
13
 
14
+ from beamlit.common import HTTPError, get_settings, init
15
+ from beamlit.common.instrumentation import (
16
+ get_metrics_exporter,
17
+ get_resource_attributes,
18
+ get_span_exporter,
19
+ instrument_app,
20
+ )
21
+
18
22
  from .middlewares import AccessLogMiddleware, AddProcessTimeHeader
19
23
 
20
24
  sys.path.insert(0, os.getcwd())
@@ -37,13 +41,14 @@ logger.info(
37
41
  f" on {settings.server.host}:{settings.server.port}"
38
42
  )
39
43
 
40
- Traceloop.init(
41
- app_name=settings.name,
42
- exporter=get_span_exporter(),
43
- metrics_exporter=get_metrics_exporter(),
44
- resource_attributes=get_resource_attributes(),
45
- should_enrich_metrics=os.getenv("ENRICHED_METRICS", "false") == "true",
46
- )
44
+ if settings.enable_opentelemetry:
45
+ Traceloop.init(
46
+ app_name=settings.name,
47
+ exporter=get_span_exporter(),
48
+ metrics_exporter=get_metrics_exporter(),
49
+ resource_attributes=get_resource_attributes(),
50
+ should_enrich_metrics=os.getenv("ENRICHED_METRICS", "false") == "true",
51
+ )
47
52
 
48
53
  app = FastAPI(docs_url=None, redoc_url=None)
49
54
  app.add_middleware(
@@ -55,6 +60,7 @@ app.add_middleware(AddProcessTimeHeader)
55
60
  app.add_middleware(AccessLogMiddleware)
56
61
  instrument_app(app)
57
62
 
63
+
58
64
  @app.get("/health")
59
65
  async def health():
60
66
  return {"status": "ok"}
@@ -67,7 +73,7 @@ async def root(request: Request):
67
73
  try:
68
74
  body = await request.json()
69
75
 
70
- original_func = getattr(func, '__wrapped__', func)
76
+ original_func = getattr(func, "__wrapped__", func)
71
77
  if asyncio.iscoroutinefunction(func) or asyncio.iscoroutinefunction(original_func):
72
78
  response = await func(body)
73
79
  else:
@@ -13,6 +13,7 @@ from beamlit.agents import agent
13
13
  "spec": {
14
14
  "description": "A chat agent using Beamlit to handle your tasks.",
15
15
  "model": "gpt-4o-mini",
16
+ "policies": ["only-us"],
16
17
  },
17
18
  },
18
19
  )
@@ -0,0 +1,13 @@
1
+ from beamlit.functions import function
2
+
3
+
4
+ @function(
5
+ function={
6
+ "spec": {
7
+ "policies": ["only-us"],
8
+ }
9
+ }
10
+ )
11
+ def helloworld(query: str):
12
+ """A function for saying hello to the world."""
13
+ return "Hello from Beamlit!"