beamlit 0.0.24rc21__tar.gz → 0.0.26rc22__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/PKG-INFO +2 -1
  2. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/pyproject.toml +3 -2
  3. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/agents/chat.py +26 -19
  4. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/agents/decorator.py +31 -7
  5. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/authentication/apikey.py +2 -2
  6. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/authentication/authentication.py +2 -2
  7. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/authentication/credentials.py +4 -4
  8. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/common/logger.py +4 -2
  9. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/common/settings.py +7 -6
  10. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/deploy/deploy.py +12 -10
  11. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/deploy/format.py +4 -4
  12. beamlit-0.0.26rc22/src/beamlit/functions/mcp/mcp.py +125 -0
  13. beamlit-0.0.26rc22/src/beamlit/functions/remote/remote.py +103 -0
  14. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/__init__.py +4 -8
  15. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/agent.py +18 -0
  16. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/agent_history_event.py +2 -2
  17. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/api_key.py +2 -2
  18. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/continent.py +2 -2
  19. beamlit-0.0.26rc22/src/beamlit/models/core_status.py +62 -0
  20. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/country.py +2 -2
  21. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/environment_metrics.py +2 -21
  22. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/function.py +18 -0
  23. beamlit-0.0.26rc22/src/beamlit/models/increase_and_rate_metric.py +70 -0
  24. beamlit-0.0.26rc22/src/beamlit/models/integration_config.py +45 -0
  25. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/integration_connection_secret.py +2 -2
  26. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/metrics.py +2 -32
  27. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/model.py +18 -0
  28. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/model_provider.py +2 -2
  29. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/pending_invitation.py +2 -2
  30. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/pending_invitation_render.py +6 -6
  31. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/pending_invitation_render_workspace.py +2 -2
  32. beamlit-0.0.26rc22/src/beamlit/models/resource_environment_metrics.py +168 -0
  33. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_metrics.py +4 -40
  34. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/runtime.py +1 -1
  35. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_agent.py +2 -2
  36. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_configuration.py +4 -4
  37. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_function.py +2 -2
  38. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/workspace.py +2 -2
  39. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/integrationtest/agent.py +13 -7
  40. beamlit-0.0.26rc22/src/integrationtest/beamlit.yaml +2 -0
  41. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/integrationtest/functions/helloworld.py +1 -1
  42. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/uv.lock +33 -0
  43. beamlit-0.0.24rc21/src/beamlit/models/increase_and_rate_metric.py +0 -104
  44. beamlit-0.0.24rc21/src/beamlit/models/resource_environment_metrics.py +0 -282
  45. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/.gitignore +0 -0
  46. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/README.md +0 -0
  47. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/beamlit.yaml +0 -0
  48. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/__init__.py +0 -0
  49. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/agents/__init__.py +0 -0
  50. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/__init__.py +0 -0
  51. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/__init__.py +0 -0
  52. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/create_agent.py +0 -0
  53. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/create_agent_release.py +0 -0
  54. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/delete_agent.py +0 -0
  55. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/delete_agent_history.py +0 -0
  56. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/get_agent.py +0 -0
  57. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/get_agent_environment_logs.py +0 -0
  58. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/get_agent_history.py +0 -0
  59. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/get_agent_metrics.py +0 -0
  60. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/list_agent_history.py +0 -0
  61. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/list_agents.py +0 -0
  62. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/put_agent_history.py +0 -0
  63. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/agents/update_agent.py +0 -0
  64. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/configurations/__init__.py +0 -0
  65. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/configurations/get_configuration.py +0 -0
  66. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/environments/__init__.py +0 -0
  67. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/environments/create_environment.py +0 -0
  68. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/environments/delete_environment.py +0 -0
  69. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/environments/get_environment.py +0 -0
  70. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/environments/get_environment_metrics.py +0 -0
  71. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/environments/list_environments.py +0 -0
  72. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/environments/update_environment.py +0 -0
  73. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/__init__.py +0 -0
  74. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/create_function.py +0 -0
  75. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/create_function_release.py +0 -0
  76. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/delete_function.py +0 -0
  77. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/get_function.py +0 -0
  78. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/get_function_environment_logs.py +0 -0
  79. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/get_function_metrics.py +0 -0
  80. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/list_functions.py +0 -0
  81. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/functions/update_function.py +0 -0
  82. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/history/__init__.py +0 -0
  83. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/history/get_agents_history.py +0 -0
  84. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/history/list_agents_history.py +0 -0
  85. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/__init__.py +0 -0
  86. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/create_integration_connection.py +0 -0
  87. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/delete_integration_connection.py +0 -0
  88. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/get_integration.py +0 -0
  89. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/get_integration_connection.py +0 -0
  90. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/get_integration_connection_model.py +0 -0
  91. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/get_integration_model.py +0 -0
  92. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/list_integration_connection_models.py +0 -0
  93. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/list_integration_connections.py +0 -0
  94. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/list_integration_models.py +0 -0
  95. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/integrations/update_integration_connection.py +0 -0
  96. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/invitations/__init__.py +0 -0
  97. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/invitations/list_all_pending_invitations.py +0 -0
  98. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/locations/__init__.py +0 -0
  99. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/locations/list_locations.py +0 -0
  100. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/metrics/__init__.py +0 -0
  101. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/metrics/get_metrics.py +0 -0
  102. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/model_providers/__init__.py +0 -0
  103. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/model_providers/create_model_provider.py +0 -0
  104. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/model_providers/delete_model_provider.py +0 -0
  105. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/model_providers/get_model_provider.py +0 -0
  106. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/model_providers/list_model_providers.py +0 -0
  107. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/model_providers/update_model_provider.py +0 -0
  108. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/__init__.py +0 -0
  109. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/create_model.py +0 -0
  110. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/delete_model.py +0 -0
  111. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/get_model.py +0 -0
  112. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/get_model_environment_logs.py +0 -0
  113. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/get_model_metrics.py +0 -0
  114. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/list_models.py +0 -0
  115. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/release_model.py +0 -0
  116. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/models/update_model.py +0 -0
  117. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/policies/__init__.py +0 -0
  118. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/policies/create_policy.py +0 -0
  119. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/policies/delete_policy.py +0 -0
  120. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/policies/get_policy.py +0 -0
  121. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/policies/list_policies.py +0 -0
  122. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/policies/update_policy.py +0 -0
  123. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/__init__.py +0 -0
  124. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/create_private_cluster.py +0 -0
  125. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/delete_private_cluster.py +0 -0
  126. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/get_private_cluster.py +0 -0
  127. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/get_private_cluster_health.py +0 -0
  128. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/list_private_clusters.py +0 -0
  129. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/update_private_cluster.py +0 -0
  130. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/privateclusters/update_private_cluster_health.py +0 -0
  131. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/__init__.py +0 -0
  132. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/create_api_key_for_service_account.py +0 -0
  133. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/create_workspace_service_account.py +0 -0
  134. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/delete_api_key_for_service_account.py +0 -0
  135. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/delete_workspace_service_account.py +0 -0
  136. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/get_workspace_service_accounts.py +0 -0
  137. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/list_api_keys_for_service_account.py +0 -0
  138. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/service_accounts/update_workspace_service_account.py +0 -0
  139. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/store/__init__.py +0 -0
  140. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/store/get_store_agent.py +0 -0
  141. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/store/get_store_function.py +0 -0
  142. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/store/list_store_agents.py +0 -0
  143. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/store/list_store_functions.py +0 -0
  144. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/__init__.py +0 -0
  145. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/accept_workspace_invitation.py +0 -0
  146. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/create_worspace.py +0 -0
  147. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/decline_workspace_invitation.py +0 -0
  148. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/delete_workspace.py +0 -0
  149. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/get_workspace.py +0 -0
  150. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/invite_workspace_user.py +0 -0
  151. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/leave_workspace.py +0 -0
  152. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/list_workspace_users.py +0 -0
  153. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/list_workspaces.py +0 -0
  154. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/remove_workspace_user.py +0 -0
  155. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/update_workspace.py +0 -0
  156. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/api/workspaces/update_workspace_user_role.py +0 -0
  157. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/authentication/__init__.py +0 -0
  158. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/authentication/clientcredentials.py +0 -0
  159. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/authentication/device_mode.py +0 -0
  160. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/client.py +0 -0
  161. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/common/__init__.py +0 -0
  162. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/common/generate.py +0 -0
  163. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/common/secrets.py +0 -0
  164. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/common/utils.py +0 -0
  165. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/deploy/__init__.py +0 -0
  166. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/deploy/parser.py +0 -0
  167. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/errors.py +0 -0
  168. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/__init__.py +0 -0
  169. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/decorator.py +0 -0
  170. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/github/__init__.py +0 -0
  171. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/github/github.py +0 -0
  172. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/github/kit/__init__.py +0 -0
  173. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/github/kit/pull_request.py +0 -0
  174. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/math/__init__.py +0 -0
  175. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/math/math.py +0 -0
  176. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/search/__init__.py +0 -0
  177. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/functions/search/search.py +0 -0
  178. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/acl.py +0 -0
  179. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/agent_chain.py +0 -0
  180. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/agent_history.py +0 -0
  181. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/agent_metadata.py +0 -0
  182. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/agent_release.py +0 -0
  183. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/agent_spec.py +0 -0
  184. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/configuration.py +0 -0
  185. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/core_spec.py +0 -0
  186. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/core_spec_configurations.py +0 -0
  187. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/create_api_key_for_service_account_body.py +0 -0
  188. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/create_workspace_service_account_body.py +0 -0
  189. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/create_workspace_service_account_response_200.py +0 -0
  190. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/delete_workspace_service_account_response_200.py +0 -0
  191. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/environment.py +0 -0
  192. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/environment_metadata.py +0 -0
  193. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/environment_spec.py +0 -0
  194. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/flavor.py +0 -0
  195. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/function_kit.py +0 -0
  196. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/function_metadata.py +0 -0
  197. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/function_release.py +0 -0
  198. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/function_spec.py +0 -0
  199. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/get_workspace_service_accounts_response_200_item.py +0 -0
  200. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/integration_connection.py +0 -0
  201. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/integration_connection_config.py +0 -0
  202. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/integration_connection_spec.py +0 -0
  203. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/integration_model.py +0 -0
  204. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/invite_workspace_user_body.py +0 -0
  205. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/location_response.py +0 -0
  206. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/metadata.py +0 -0
  207. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/metadata_labels.py +0 -0
  208. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/metric.py +0 -0
  209. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/model_metadata.py +0 -0
  210. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/model_private_cluster.py +0 -0
  211. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/model_release.py +0 -0
  212. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/model_spec.py +0 -0
  213. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/owner_fields.py +0 -0
  214. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/pending_invitation_accept.py +0 -0
  215. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/pending_invitation_render_invited_by.py +0 -0
  216. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/pending_invitation_workspace_details.py +0 -0
  217. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/pod_template_spec.py +0 -0
  218. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/policy.py +0 -0
  219. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/policy_location.py +0 -0
  220. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/policy_spec.py +0 -0
  221. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/private_cluster.py +0 -0
  222. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/private_location.py +0 -0
  223. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/provider_config.py +0 -0
  224. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/qps.py +0 -0
  225. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_deployment_metrics.py +0 -0
  226. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +0 -0
  227. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +0 -0
  228. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_environment_metrics_inference_per_region.py +0 -0
  229. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +0 -0
  230. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_environment_metrics_query_per_region_per_code.py +0 -0
  231. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +0 -0
  232. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/resource_log.py +0 -0
  233. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/runtime_readiness_probe.py +0 -0
  234. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/runtime_resources.py +0 -0
  235. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/serverless_config.py +0 -0
  236. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/spec_configuration.py +0 -0
  237. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_agent_labels.py +0 -0
  238. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_configuration_option.py +0 -0
  239. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_function_kit.py +0 -0
  240. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_function_labels.py +0 -0
  241. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/store_function_parameter.py +0 -0
  242. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/time_fields.py +0 -0
  243. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/update_workspace_service_account_body.py +0 -0
  244. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/update_workspace_service_account_response_200.py +0 -0
  245. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/update_workspace_user_role_body.py +0 -0
  246. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/websocket_channel.py +0 -0
  247. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/workspace_labels.py +0 -0
  248. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/models/workspace_user.py +0 -0
  249. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/py.typed +0 -0
  250. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/run.py +0 -0
  251. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/serve/app.py +0 -0
  252. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/serve/middlewares/__init__.py +0 -0
  253. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/serve/middlewares/accesslog.py +0 -0
  254. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/serve/middlewares/processtime.py +0 -0
  255. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/beamlit/types.py +0 -0
  256. {beamlit-0.0.24rc21 → beamlit-0.0.26rc22}/src/integrationtest/main.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.24rc21
3
+ Version: 0.0.26rc22
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -12,6 +12,7 @@ Requires-Dist: langchain-community<0.4.0,>=0.3.3
12
12
  Requires-Dist: langchain-core<0.4.0,>=0.3.13
13
13
  Requires-Dist: langchain-openai<0.3.0,>=0.2.4
14
14
  Requires-Dist: langgraph<0.3.0,>=0.2.40
15
+ Requires-Dist: mcp>=1.1.2
15
16
  Requires-Dist: pydantic-settings<2.7.0,>=2.6.1
16
17
  Requires-Dist: pydantic<2.11.0,>=2.10.3
17
18
  Requires-Dist: python-dateutil>=2.8.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "beamlit"
3
- version = "0.0.24.pre-21"
3
+ version = "0.0.26.pre-22"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -25,6 +25,7 @@ dependencies = [
25
25
  "langgraph>=0.2.40,<0.3.0",
26
26
  "fastapi[standard]>=0.115.4,<0.116.0",
27
27
  "asgi-correlation-id>=4.3.4,<5.0.0",
28
+ "mcp>=1.1.2",
28
29
  ]
29
30
  [dependency-groups]
30
31
  dev = [
@@ -40,4 +41,4 @@ line-length = 100
40
41
 
41
42
  [tool.ruff.lint]
42
43
  select = ["F", "I", "UP"]
43
- ignore = ["UP006", "UP007", "UP035"]
44
+ ignore = ["UP006", "UP007", "UP035"]
@@ -7,9 +7,9 @@ from beamlit.models import Model
7
7
  logger = getLogger(__name__)
8
8
 
9
9
 
10
- def get_base_url(agent_model: Model):
10
+ def get_base_url(name: str):
11
11
  settings = get_settings()
12
- return f"{settings.run_url}/{settings.workspace}/models/{agent_model.metadata.name}/v1"
12
+ return f"{settings.run_url}/{settings.workspace}/models/{name}/v1"
13
13
 
14
14
 
15
15
  def get_mistral_chat_model(**kwargs):
@@ -39,15 +39,16 @@ def get_cohere_chat_model(**kwargs):
39
39
 
40
40
  return ChatCohere(**kwargs)
41
41
 
42
- def get_chat_model(agent_model: Model):
42
+ def get_chat_model(name: str, agent_model: Model):
43
43
  settings = get_settings()
44
44
  client = new_client()
45
45
 
46
+ environment = (agent_model.metadata and agent_model.metadata.environment) or settings.environment
46
47
  headers = get_authentication_headers(settings)
47
- headers["X-Beamlit-Environment"] = agent_model.metadata.environment
48
+ headers["X-Beamlit-Environment"] = environment
48
49
 
49
50
  jwt = headers.get("X-Beamlit-Authorization", "").replace("Bearer ", "")
50
- params = {"environment": agent_model.metadata.environment}
51
+ params = {"environment": environment}
51
52
  chat_classes = {
52
53
  "openai": {
53
54
  "func": get_openai_chat_model,
@@ -70,7 +71,7 @@ def get_chat_model(agent_model: Model):
70
71
  "func": get_xai_chat_model,
71
72
  "kwargs": {
72
73
  "api_key": jwt,
73
- "xai_api_base": get_base_url(),
74
+ "xai_api_base": get_base_url(name),
74
75
  },
75
76
  "remove_kwargs": ["base_url"],
76
77
  },
@@ -82,21 +83,27 @@ def get_chat_model(agent_model: Model):
82
83
  },
83
84
  }
84
85
 
85
- if agent_model is None:
86
- raise ValueError("agent_model not found in configuration")
87
- if agent_model.spec.runtime is None:
88
- raise ValueError("runtime not found in agent model")
89
- if agent_model.spec.runtime.type_ is None:
90
- raise ValueError("type not found in runtime")
91
- if agent_model.spec.runtime.model is None:
92
- raise ValueError("model not found in runtime")
93
-
94
- provider = agent_model.spec.runtime.type_
95
- model = agent_model.spec.runtime.model
86
+ provider = (
87
+ agent_model.spec
88
+ and agent_model.spec.runtime
89
+ and agent_model.spec.runtime.type_
90
+ )
91
+ if not provider:
92
+ logger.warning("Provider not found in agent model, defaulting to OpenAI")
93
+ provider = "openai"
94
+
95
+ model = (
96
+ agent_model.spec
97
+ and agent_model.spec.runtime
98
+ and agent_model.spec.runtime.model
99
+ )
100
+ if not model:
101
+ logger.warning("Model not found in agent model, defaulting to gpt-4o-mini")
102
+ model = "gpt-4o-mini"
96
103
 
97
104
  kwargs = {
98
105
  "model": model,
99
- "base_url": get_base_url(agent_model),
106
+ "base_url": get_base_url(name),
100
107
  "default_query": params,
101
108
  "default_headers": headers,
102
109
  "api_key": "fake_api_key",
@@ -111,4 +118,4 @@ def get_chat_model(agent_model: Model):
111
118
  if "remove_kwargs" in chat_class:
112
119
  for key in chat_class["remove_kwargs"]:
113
120
  kwargs.pop(key, None)
114
- return chat_class["func"](**kwargs)
121
+ return chat_class["func"](**kwargs), provider, model
@@ -8,9 +8,11 @@ from logging import getLogger
8
8
 
9
9
  from beamlit.api.models import get_model
10
10
  from beamlit.authentication import new_client
11
- from beamlit.common.settings import get_settings, init
11
+ from beamlit.common.settings import init
12
12
  from beamlit.errors import UnexpectedStatus
13
- from beamlit.models import Agent, AgentSpec, Metadata
13
+ from beamlit.functions.mcp.mcp import MCPClient, MCPToolkit
14
+ from beamlit.functions.remote.remote import RemoteToolkit
15
+ from beamlit.models import Agent, AgentMetadata, AgentSpec
14
16
  from langchain_core.tools import Tool
15
17
  from langgraph.checkpoint.memory import MemorySaver
16
18
  from langgraph.prebuilt import create_react_agent
@@ -24,6 +26,7 @@ def get_functions(dir="src/functions", from_decorator="function"):
24
26
 
25
27
  # Walk through all Python files in functions directory and subdirectories
26
28
  if not os.path.exists(dir):
29
+ logger.warn(f"Functions directory {dir} not found")
27
30
  return []
28
31
  for root, _, files in os.walk(dir):
29
32
  for file in files:
@@ -103,6 +106,8 @@ def agent(
103
106
  agent: Agent | dict = None,
104
107
  override_chat_model=None,
105
108
  override_agent=None,
109
+ mcp_hub=None,
110
+ remote_functions=None,
106
111
  ):
107
112
  logger = getLogger(__name__)
108
113
  try:
@@ -111,6 +116,7 @@ def agent(
111
116
  'agent must be a dictionary, example: @agent(agent={"metadata": {"name": "my_agent"}})'
112
117
  )
113
118
 
119
+ client = new_client()
114
120
  chat_model = override_chat_model or None
115
121
  settings = init()
116
122
 
@@ -132,11 +138,10 @@ def agent(
132
138
  settings.agent.functions = functions
133
139
 
134
140
  if agent is not None:
135
- metadata = Metadata(**agent.get("metadata", {}))
141
+ metadata = AgentMetadata(**agent.get("metadata", {}))
136
142
  spec = AgentSpec(**agent.get("spec", {}))
137
143
  agent = Agent(metadata=metadata, spec=spec)
138
144
  if agent.spec.model and chat_model is None:
139
- client = new_client()
140
145
  try:
141
146
  response = get_model.sync_detailed(
142
147
  agent.spec.model, environment=settings.environment, client=client
@@ -158,10 +163,29 @@ def agent(
158
163
  raise e
159
164
 
160
165
  if settings.agent.model:
161
- chat_model = get_chat_model(settings.agent.model)
166
+ chat_model, provider, model = get_chat_model(agent.spec.model, settings.agent.model)
162
167
  settings.agent.chat_model = chat_model
163
- runtime = settings.agent.model.spec.runtime
164
- logger.info(f"Chat model configured, using: {runtime.type_}:{runtime.model}")
168
+ logger.info(f"Chat model configured, using: {provider}:{model}")
169
+
170
+ if mcp_hub:
171
+ for server in mcp_hub:
172
+ try:
173
+ mcp_client = MCPClient(client, server)
174
+ toolkit = MCPToolkit(client=mcp_client)
175
+ toolkit.initialize()
176
+ functions.extend(toolkit.get_tools())
177
+ except Exception as e:
178
+ logger.warn(f"Failed to initialize MCP server {server}: {e!s}")
179
+
180
+ if remote_functions:
181
+
182
+ for function in remote_functions:
183
+ try:
184
+ toolkit = RemoteToolkit(client, function)
185
+ toolkit.initialize()
186
+ functions.extend(toolkit.get_tools())
187
+ except Exception as e:
188
+ logger.warn(f"Failed to initialize remote function {function}: {e!s}")
165
189
 
166
190
  if override_agent is None and len(functions) == 0:
167
191
  raise ValueError(
@@ -10,11 +10,11 @@ class ApiKeyProvider(Auth):
10
10
 
11
11
  def get_headers(self):
12
12
  return {
13
- "X-Beamlit-Api-Key": self.credentials.api_key,
13
+ "X-Beamlit-Api-Key": self.credentials.apiKey,
14
14
  "X-Beamlit-Workspace": self.workspace_name,
15
15
  }
16
16
 
17
17
  def auth_flow(self, request: Request) -> Generator[Request, Response, None]:
18
- request.headers["X-Beamlit-Api-Key"] = self.credentials.api_key
18
+ request.headers["X-Beamlit-Api-Key"] = self.credentials.apiKey
19
19
  request.headers["X-Beamlit-Workspace"] = self.workspace_name
20
20
  yield request
@@ -60,7 +60,7 @@ def new_client():
60
60
 
61
61
  def new_client_with_credentials(config: RunClientWithCredentials):
62
62
  provider: Auth = None
63
- if config.credentials.api_key:
63
+ if config.credentials.apiKey:
64
64
  provider = ApiKeyProvider(config.credentials, config.workspace)
65
65
  elif config.credentials.access_token:
66
66
  provider = BearerToken(config.credentials, config.workspace, config.api_url)
@@ -85,7 +85,7 @@ def get_authentication_headers(settings: Settings) -> Dict[str, str]:
85
85
  workspace=settings.workspace,
86
86
  )
87
87
  provider = None
88
- if config.credentials.api_key:
88
+ if config.credentials.apiKey:
89
89
  provider = ApiKeyProvider(config.credentials, config.workspace)
90
90
  elif config.credentials.access_token:
91
91
  provider = BearerToken(config.credentials, config.workspace, config.api_url)
@@ -12,7 +12,7 @@ logger = getLogger(__name__)
12
12
 
13
13
  @dataclass
14
14
  class Credentials:
15
- api_key: str = ""
15
+ apiKey: str = ""
16
16
  access_token: str = ""
17
17
  refresh_token: str = ""
18
18
  expires_in: int = 0
@@ -49,7 +49,7 @@ class Config:
49
49
  {
50
50
  "name": ws.name,
51
51
  "credentials": {
52
- "api_key": ws.credentials.api_key,
52
+ "apiKey": ws.credentials.apiKey,
53
53
  "access_token": ws.credentials.access_token,
54
54
  "refresh_token": ws.credentials.refresh_token,
55
55
  "expires_in": ws.credentials.expires_in,
@@ -129,7 +129,7 @@ def load_credentials(workspace_name: str) -> Credentials:
129
129
 
130
130
  def load_credentials_from_settings(settings: Settings) -> Credentials:
131
131
  return Credentials(
132
- api_key=settings.authentication.api_key,
132
+ apiKey=settings.authentication.apiKey,
133
133
  client_credentials=settings.authentication.client.credentials,
134
134
  )
135
135
 
@@ -154,7 +154,7 @@ def create_home_dir_if_missing():
154
154
 
155
155
  def save_credentials(workspace_name: str, credentials: Credentials):
156
156
  create_home_dir_if_missing()
157
- if not credentials.access_token and not credentials.api_key:
157
+ if not credentials.access_token and not credentials.apiKey:
158
158
  logger.info("No credentials to save, error")
159
159
  return
160
160
 
@@ -11,8 +11,10 @@ class ColoredFormatter(logging.Formatter):
11
11
  }
12
12
 
13
13
  def format(self, record):
14
+ n_spaces = len("CRITICAL") - len(record.levelname)
15
+ tab = " " * n_spaces
14
16
  color = self.COLORS.get(record.levelname, "\033[0m")
15
- record.levelname = f"{color}{record.levelname}\033[0m"
17
+ record.levelname = f"{color}{record.levelname}\033[0m:{tab}"
16
18
  return super().format(record)
17
19
 
18
20
 
@@ -25,5 +27,5 @@ def init(log_level: str):
25
27
  logging.getLogger("httpx").propagate = False
26
28
 
27
29
  handler = logging.StreamHandler()
28
- handler.setFormatter(ColoredFormatter("%(levelname)s:\t %(name)s - %(message)s"))
30
+ handler.setFormatter(ColoredFormatter(f"%(levelname)s %(name)s - %(message)s"))
29
31
  logging.basicConfig(level=log_level, handlers=[handler])
@@ -38,7 +38,7 @@ class SettingsAuthenticationClient(BaseSettings):
38
38
 
39
39
 
40
40
  class SettingsAuthentication(BaseSettings):
41
- api_key: Union[None, str] = None
41
+ apiKey: Union[None, str] = None
42
42
  jwt: Union[None, str] = None
43
43
  client: SettingsAuthenticationClient = SettingsAuthenticationClient()
44
44
 
@@ -64,6 +64,7 @@ class Settings(BaseSettings):
64
64
  name: str = Field(default="beamlit-agent")
65
65
  base_url: str = Field(default="https://api.beamlit.dev/v0")
66
66
  run_url: str = Field(default="https://run.beamlit.dev")
67
+ mcp_hub_url: str = Field(default="https://mcp-hub-server.beamlit.workers.dev")
67
68
  registry_url: str = Field(default="https://serverless-registry-production.beamlit.workers.dev")
68
69
  log_level: str = Field(default="INFO")
69
70
  agent: SettingsAgent = SettingsAgent()
@@ -117,13 +118,13 @@ def init_agent(
117
118
  functions.append(function)
118
119
  settings.agent.functions = functions
119
120
 
120
- if agent.spec.agent_chain:
121
- for chain in agent.spec.agent_chain:
121
+ if agent.spec.agentChain:
122
+ for chain in agent.spec.agentChain:
122
123
  if chain.enabled:
123
- agent_chain = get_agent.sync(chain.name, environment=env, client=client)
124
+ agentChain = get_agent.sync(chain.name, environment=env, client=client)
124
125
  if chain.description:
125
- agent_chain.spec.description = chain.description
126
- agents_chain.append(agent_chain)
126
+ agentChain.spec.description = chain.description
127
+ agents_chain.append(agentChain)
127
128
  settings.agent.chain = agents_chain
128
129
  if agent.spec.model:
129
130
  model = get_model.sync(agent.spec.model, environment=env, client=client)
@@ -6,10 +6,12 @@ from logging import getLogger
6
6
  from typing import Literal
7
7
 
8
8
  from beamlit.common.settings import Settings, get_settings, init
9
- from beamlit.models import (Agent, EnvironmentMetadata, AgentSpec, AgentChain, Flavor, Function, FunctionSpec,
10
- Runtime)
11
- from .format import arg_to_dict, format_parameters, format_agent_chain
12
- from .parser import get_resources, Resource, get_parameters, get_description
9
+ from beamlit.models import (Agent, AgentChain, AgentSpec, EnvironmentMetadata,
10
+ Flavor, Function, FunctionSpec, Runtime)
11
+
12
+ from .format import arg_to_dict, format_agent_chain, format_parameters
13
+ from .parser import Resource, get_description, get_parameters, get_resources
14
+
13
15
  sys.path.insert(0, os.getcwd())
14
16
  sys.path.insert(0, os.path.join(os.getcwd(), "src"))
15
17
 
@@ -27,8 +29,8 @@ def set_default_values(resource: Resource, deployment: Agent | Function):
27
29
  deployment.metadata.environment = settings.environment
28
30
  if not deployment.metadata.name:
29
31
  deployment.metadata.name = resource.name
30
- if not deployment.metadata.display_name:
31
- deployment.metadata.display_name = deployment.metadata.name
32
+ if not deployment.metadata.displayName:
33
+ deployment.metadata.displayName = deployment.metadata.name
32
34
  if not deployment.spec.description:
33
35
  deployment.spec.description = get_description(None, resource)
34
36
  if not deployment.spec.runtime:
@@ -97,7 +99,7 @@ def get_agent_yaml(
97
99
  Generates YAML configuration for an agent deployment.
98
100
 
99
101
  Args:
100
- agent (AgentDeployment): Agent deployment configuration
102
+ agent (Agent): Agent deployment configuration
101
103
  functions (list[tuple[Resource, FunctionDeployment]]): List of associated functions
102
104
  settings (Settings): Application settings
103
105
 
@@ -109,14 +111,14 @@ apiVersion: beamlit.com/v1alpha1
109
111
  kind: Agent
110
112
  metadata:
111
113
  name: {agent.metadata.name}
112
- display_name: {agent.metadata.display_name or agent.metadata.name}
114
+ displayName: {agent.metadata.displayName or agent.metadata.name}
113
115
  environment: {settings.environment}
114
116
  workspace: {settings.workspace}
115
117
  spec:
116
118
  enabled: true
117
119
  policies: [{", ".join(agent.spec.policies or [])}]
118
120
  functions: [{", ".join([f"{function.metadata.name}" for (_, function) in functions])}]
119
- agent_chain: {format_agent_chain(agent.spec.agent_chain)}
121
+ agentChain: {format_agent_chain(agent.spec.agentChain)}
120
122
  model: {agent.spec.model}
121
123
  runtime:
122
124
  image: {agent.spec.runtime.image}
@@ -143,7 +145,7 @@ apiVersion: beamlit.com/v1alpha1
143
145
  kind: Function
144
146
  metadata:
145
147
  name: {function.metadata.name}
146
- display_name: {function.metadata.display_name or function.metadata.name}
148
+ displayName: {function.metadata.displayName or function.metadata.name}
147
149
  environment: {settings.environment}
148
150
  spec:
149
151
  enabled: true
@@ -47,21 +47,21 @@ def format_parameters(parameters: list[StoreFunctionParameter]) -> str:
47
47
  return "\n".join(formatted)
48
48
 
49
49
 
50
- def format_agent_chain(agent_chain: list[AgentChain]) -> str:
50
+ def format_agent_chain(agentChain: list[AgentChain]) -> str:
51
51
  """
52
52
  Formats agent chain configuration into YAML-compatible string.
53
53
 
54
54
  Args:
55
- agent_chain (list[AgentChain]): List of agent chain configurations
55
+ agentChain (list[AgentChain]): List of agent chain configurations
56
56
 
57
57
  Returns:
58
58
  str: YAML-formatted string of agent chain
59
59
  """
60
- if not agent_chain:
60
+ if not agentChain:
61
61
  return "[]"
62
62
  formatted = []
63
63
 
64
- for agent in agent_chain:
64
+ for agent in agentChain:
65
65
  formatted.append(f"""
66
66
  - agent: {agent.name}
67
67
  enabled: {agent.enabled}""")
@@ -0,0 +1,125 @@
1
+ import asyncio
2
+ import urllib.parse
3
+ import warnings
4
+ from typing import Any, Callable
5
+
6
+ import pydantic
7
+ import pydantic_core
8
+ import requests
9
+ import typing_extensions as t
10
+ from beamlit.authentication.authentication import AuthenticatedClient
11
+ from beamlit.common.settings import get_settings
12
+ from langchain_core.tools.base import BaseTool, BaseToolkit, ToolException
13
+ from mcp import ListToolsResult
14
+ from pydantic.json_schema import JsonSchemaValue
15
+ from pydantic_core import core_schema as cs
16
+
17
+ settings = get_settings()
18
+
19
+
20
+ def create_schema_model(schema: dict[str, t.Any]) -> type[pydantic.BaseModel]:
21
+ # Create a new model class that returns our JSON schema.
22
+ # LangChain requires a BaseModel class.
23
+ class Schema(pydantic.BaseModel):
24
+ model_config = pydantic.ConfigDict(extra="allow")
25
+
26
+ @t.override
27
+ @classmethod
28
+ def __get_pydantic_json_schema__(
29
+ cls, core_schema: cs.CoreSchema, handler: pydantic.GetJsonSchemaHandler
30
+ ) -> JsonSchemaValue:
31
+ return schema
32
+
33
+ return Schema
34
+
35
+
36
+ class MCPClient:
37
+ def __init__(self, client: AuthenticatedClient, server_name: str):
38
+ self.client = client
39
+ self.server_name = server_name
40
+ self.headers = {"Api-Key": "1234567890"}
41
+
42
+ def list_tools(self) -> requests.Response:
43
+ client = self.client.get_httpx_client()
44
+ url = urllib.parse.urljoin(settings.mcp_hub_url, f"{self.server_name}/tools/list")
45
+
46
+ response = client.request("GET", url, headers=self.headers)
47
+ response.raise_for_status()
48
+ return response
49
+
50
+ def call_tool(self, tool_name: str, arguments: dict[str, Any] = None) -> requests.Response:
51
+ client = self.client.get_httpx_client()
52
+ url = urllib.parse.urljoin(settings.mcp_hub_url, f"{self.server_name}/tools/call")
53
+ response = client.request(
54
+ "POST",
55
+ url,
56
+ json={"name": tool_name, "arguments": arguments},
57
+ headers=self.headers,
58
+ )
59
+ response.raise_for_status()
60
+ return response
61
+
62
+ class MCPTool(BaseTool):
63
+ """
64
+ MCP server tool
65
+ """
66
+
67
+ client: MCPClient
68
+ handle_tool_error: bool | str | Callable[[ToolException], str] | None = True
69
+
70
+ @t.override
71
+ def _run(self, *args: t.Any, **kwargs: t.Any) -> t.Any:
72
+ warnings.warn(
73
+ "Invoke this tool asynchronousely using `ainvoke`. This method exists only to satisfy standard tests.",
74
+ stacklevel=1,
75
+ )
76
+ return asyncio.run(self._arun(*args, **kwargs))
77
+
78
+ @t.override
79
+ async def _arun(self, *args: t.Any, **kwargs: t.Any) -> t.Any:
80
+ result = self.client.call_tool(self.name, arguments=kwargs)
81
+ response = result.json()
82
+ content = pydantic_core.to_json(response["content"]).decode()
83
+ if response["isError"]:
84
+ raise ToolException(content)
85
+ return content
86
+
87
+ @t.override
88
+ @property
89
+ def tool_call_schema(self) -> type[pydantic.BaseModel]:
90
+ assert self.args_schema is not None # noqa: S101
91
+ return self.args_schema
92
+
93
+ class MCPToolkit(BaseToolkit):
94
+ """
95
+ MCP server toolkit
96
+ """
97
+
98
+ client: MCPClient
99
+ """The MCP session used to obtain the tools"""
100
+
101
+ _tools: ListToolsResult | None = None
102
+
103
+ model_config = pydantic.ConfigDict(arbitrary_types_allowed=True)
104
+
105
+ def initialize(self) -> None:
106
+ """Initialize the session and retrieve tools list"""
107
+ if self._tools is None:
108
+ response = self.client.list_tools()
109
+ self._tools = ListToolsResult(**response.json())
110
+
111
+ @t.override
112
+ def get_tools(self) -> list[BaseTool]:
113
+ if self._tools is None:
114
+ raise RuntimeError("Must initialize the toolkit first")
115
+
116
+ return [
117
+ MCPTool(
118
+ client=self.client,
119
+ name=tool.name,
120
+ description=tool.description or "",
121
+ args_schema=create_schema_model(tool.inputSchema),
122
+ )
123
+ # list_tools returns a PaginatedResult, but I don't see a way to pass the cursor to retrieve more tools
124
+ for tool in self._tools.tools
125
+ ]
@@ -0,0 +1,103 @@
1
+ import asyncio
2
+ import urllib.parse
3
+ import warnings
4
+ from typing import Any, Callable
5
+
6
+ import pydantic
7
+ import pydantic_core
8
+ import typing_extensions as t
9
+ from beamlit.api.functions import get_function
10
+ from beamlit.authentication.authentication import AuthenticatedClient
11
+ from beamlit.models.function import Function
12
+ from langchain_core.tools.base import BaseTool, BaseToolkit, ToolException
13
+ from pydantic.json_schema import JsonSchemaValue
14
+ from pydantic_core import core_schema as cs
15
+
16
+
17
+ def create_schema_model(schema: dict[str, t.Any]) -> type[pydantic.BaseModel]:
18
+ # Create a new model class that returns our JSON schema.
19
+ # LangChain requires a BaseModel class.
20
+ class Schema(pydantic.BaseModel):
21
+ model_config = pydantic.ConfigDict(extra="allow")
22
+
23
+ @t.override
24
+ @classmethod
25
+ def __get_pydantic_json_schema__(
26
+ cls, core_schema: cs.CoreSchema, handler: pydantic.GetJsonSchemaHandler
27
+ ) -> JsonSchemaValue:
28
+ return schema
29
+
30
+ return Schema
31
+
32
+
33
+ class RemoteTool(BaseTool):
34
+ """
35
+ Remote tool
36
+ """
37
+
38
+ client: AuthenticatedClient
39
+ handle_tool_error: bool | str | Callable[[ToolException], str] | None = True
40
+
41
+ @t.override
42
+ def _run(self, *args: t.Any, **kwargs: t.Any) -> t.Any:
43
+ warnings.warn(
44
+ "Invoke this tool asynchronousely using `ainvoke`. This method exists only to satisfy standard tests.",
45
+ stacklevel=1,
46
+ )
47
+ return asyncio.run(self._arun(*args, **kwargs))
48
+
49
+ @t.override
50
+ async def _arun(self, *args: t.Any, **kwargs: t.Any) -> t.Any:
51
+ result = self.client.call_tool(self.name, arguments=kwargs)
52
+ response = result.json()
53
+ content = pydantic_core.to_json(response["content"]).decode()
54
+ if response["isError"]:
55
+ raise ToolException(content)
56
+ return content
57
+
58
+ @t.override
59
+ @property
60
+ def tool_call_schema(self) -> type[pydantic.BaseModel]:
61
+ assert self.args_schema is not None # noqa: S101
62
+ return self.args_schema
63
+
64
+ class RemoteToolkit(BaseToolkit):
65
+ """
66
+ Remote toolkit
67
+ """
68
+
69
+ client: AuthenticatedClient
70
+ function: str
71
+ _function: Function | None = None
72
+
73
+ model_config = pydantic.ConfigDict(arbitrary_types_allowed=True)
74
+
75
+ def initialize(self) -> None:
76
+ """Initialize the session and retrieve tools list"""
77
+ if self._function is None:
78
+ self._function = get_function(self.function, client=self.client)
79
+
80
+ @t.override
81
+ def get_tools(self) -> list[BaseTool]:
82
+ if self._tools is None:
83
+ raise RuntimeError("Must initialize the toolkit first")
84
+
85
+ if self._function.spec.kit:
86
+ return [
87
+ RemoteTool(
88
+ client=self.client,
89
+ name=func.name,
90
+ description=func.description or "",
91
+ args_schema=create_schema_model(func.parameters),
92
+ )
93
+ for func in self._function.spec.kit
94
+ ]
95
+
96
+ return [
97
+ RemoteTool(
98
+ client=self.client,
99
+ name=self._function.metadata.name,
100
+ description=self._function.spec.description or "",
101
+ args_schema=create_schema_model(self._function.spec.parameters),
102
+ )
103
+ ]