beamlit 0.0.33rc47__py3-none-any.whl → 0.0.33rc49__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,8 +12,8 @@ from langgraph.prebuilt import create_react_agent
12
12
 
13
13
  from beamlit.api.models import get_model
14
14
  from beamlit.authentication import new_client
15
- from beamlit.common.settings import init, get_settings
16
15
  from beamlit.common import slugify
16
+ from beamlit.common.settings import get_settings, init
17
17
  from beamlit.errors import UnexpectedStatus
18
18
  from beamlit.functions.mcp.mcp import MCPClient, MCPToolkit
19
19
  from beamlit.functions.remote.remote import RemoteToolkit
@@ -2,8 +2,8 @@ from .error import HTTPError
2
2
  from .logger import init as init_logger
3
3
  from .secrets import Secret
4
4
  from .settings import Settings, get_settings, init, init_agent
5
- from .utils import copy_folder
6
5
  from .slugify import slugify
6
+ from .utils import copy_folder
7
7
 
8
8
  __all__ = [
9
9
  "Secret",
beamlit/deploy/deploy.py CHANGED
@@ -6,6 +6,7 @@ import uuid
6
6
  from logging import getLogger
7
7
  from typing import Literal
8
8
 
9
+ from beamlit.common import slugify
9
10
  from beamlit.common.settings import Settings, get_settings, init
10
11
  from beamlit.models import (
11
12
  Agent,
@@ -16,7 +17,7 @@ from beamlit.models import (
16
17
  FunctionSpec,
17
18
  Runtime,
18
19
  )
19
- from beamlit.common import slugify
20
+
20
21
  from .format import arg_to_dict, format_agent_chain, format_parameters
21
22
  from .parser import Resource, get_description, get_parameters, get_resources
22
23
 
@@ -1,13 +1,11 @@
1
1
  """Decorators for creating function tools with Beamlit and LangChain integration."""
2
-
2
+ import asyncio
3
3
  import functools
4
- import json
5
4
  from collections.abc import Callable
6
5
  from logging import getLogger
7
6
 
8
7
  from fastapi import Request
9
8
 
10
- from beamlit.common.settings import get_settings
11
9
  from beamlit.models import Function, FunctionKit
12
10
 
13
11
  logger = getLogger(__name__)
@@ -25,7 +23,6 @@ def kit(bl_kit: FunctionKit = None, **kwargs: dict) -> Callable:
25
23
 
26
24
  def function(*args, function: Function | dict = None, kit=False, **kwargs: dict) -> Callable:
27
25
  """Create function tools with Beamlit and LangChain integration."""
28
- settings = get_settings()
29
26
  if function is not None and not isinstance(function, dict):
30
27
  raise Exception(
31
28
  'function must be a dictionary, example: @function(function={"metadata": {"name": "my_function"}})'
@@ -42,7 +39,7 @@ def function(*args, function: Function | dict = None, kit=False, **kwargs: dict)
42
39
  if len(args) > 0 and isinstance(args[0], Request):
43
40
  body = await args[0].json()
44
41
  args = [body.get(param) for param in func.__code__.co_varnames[:func.__code__.co_argcount]]
45
- return func(*args, **kwargs)
42
+ return await func(*args, **kwargs) if asyncio.iscoroutinefunction(func) else func(*args, **kwargs)
46
43
  return wrapped
47
44
 
48
45
  return wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.33rc47
3
+ Version: 0.0.33rc49
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -7,7 +7,7 @@ beamlit/types.py,sha256=E1hhDh_zXfsSQ0NCt9-uw90_Mr5iIlsdfnfvxv5HarU,1005
7
7
  beamlit/agents/__init__.py,sha256=nf1iwQwGtCG6nDqyVhxfWoqR6dv6X3bvSpCeqkTCFaM,101
8
8
  beamlit/agents/chain.py,sha256=vfCjiFHuu02uTTGicxMlFzjyICQkIjpXrBGs-7uJEsg,2826
9
9
  beamlit/agents/chat.py,sha256=gVyv4FGBdQTDhdutX8l64OUNa6Fdqaw4eCfEDRH0IPQ,3558
10
- beamlit/agents/decorator.py,sha256=5PnVu7G5a4kyK7P3h6QgHQXudOBhxl6EwK8FpxBRcjE,10297
10
+ beamlit/agents/decorator.py,sha256=PUw5xfG4KmmVeSbgI-Ac7KAm5n0addPhg5MysfxLpWk,10297
11
11
  beamlit/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
12
12
  beamlit/api/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  beamlit/api/agents/create_agent.py,sha256=t5Pr62My2EhQlcIY71MrI73-0_q5Djr3a_Ybt9MIiQQ,3587
@@ -128,7 +128,7 @@ beamlit/authentication/authentication.py,sha256=ODQCc00RvCOZNaiGG5ctylNnE-JVCuge
128
128
  beamlit/authentication/clientcredentials.py,sha256=cxZPPu--CgizwqX0pdfFQ91gJt1EFKwyy-aBB_dXX7I,3990
129
129
  beamlit/authentication/credentials.py,sha256=p_1xenabCbQuRz7BiFk7oTK4uCxAt_zoyku5o-jcKGE,5343
130
130
  beamlit/authentication/device_mode.py,sha256=tmr22gllKOZwBRub_QjF5pYa425x-nE8tQNpZ_EGR6g,3644
131
- beamlit/common/__init__.py,sha256=4zSon2Pf7mSvTT8931UIb5Qb6xhlETa9lU9u92bkiL4,384
131
+ beamlit/common/__init__.py,sha256=UjOMfg6BeoXqalI3p98qMpgdh__AstwvdUz_9lx8lUY,384
132
132
  beamlit/common/error.py,sha256=f9oJDFxhoHK-vpjxBgEp0NwWIk0N_THPemUI7uQxVzU,270
133
133
  beamlit/common/generate.py,sha256=LtdCju_QayRS4lZrrb_0VHqWWvTcv4Mbf-iV1TB_Qko,7522
134
134
  beamlit/common/instrumentation.py,sha256=GVYeat7qCcqzDoKSYig3s8ZCC172R9JiQIr3Evv3kik,4293
@@ -138,11 +138,11 @@ beamlit/common/settings.py,sha256=_4oCVrJZOMaTZoK2Zzo2DWqtUyBsspuOH3iAJ_nU0tw,59
138
138
  beamlit/common/slugify.py,sha256=nR29r37IdWS2i44ZC6ZsXRgqKPYmvMGtFQ7BuIQUTlc,90
139
139
  beamlit/common/utils.py,sha256=jouz5igBvT37Xn_e94-foCHyQczVim-UzVcoIF6RWJ4,657
140
140
  beamlit/deploy/__init__.py,sha256=GS7l7Jtm2yKs7iNLKcfjYO-rAhUzggQ3xiYSf3oxLBY,91
141
- beamlit/deploy/deploy.py,sha256=junQAo5zf9vC81cS6_6-0AOy4xRvvXlX710-kUK6hRE,9888
141
+ beamlit/deploy/deploy.py,sha256=YKY1iN0ZofQr_n9efvDJ5pK9HpyLZO9wyHmh8W9PAaE,9889
142
142
  beamlit/deploy/format.py,sha256=PJ8kU7Y1pwiS3tqqyvFaag9LO3jju-4ua574163VPk4,1820
143
143
  beamlit/deploy/parser.py,sha256=Ga0poCZkoRnuTw082QnTcNGCBJncoRAnVsn8-1FsaJE,6907
144
144
  beamlit/functions/__init__.py,sha256=_RPG1Bfg54JGdIPnViAU6n9zD7E1cDNsdXi8oYGskzE,138
145
- beamlit/functions/decorator.py,sha256=TyN1ddXg9buQEfqq6DwhH0OzsixcyK3liXdVkkntwVw,1721
145
+ beamlit/functions/decorator.py,sha256=ZtSQsPLI70WKwi2jPhA7DaqREQUINpqt9BDVugeV_sg,1714
146
146
  beamlit/functions/github/__init__.py,sha256=gYnUkeegukOfbymdabuuJkScvH-_ZJygX05BoqkPn0o,49
147
147
  beamlit/functions/github/github.py,sha256=FajzLCNkpXcwfgnC0l9rOGT2eSPLCz8-qrMzK9N_ZNc,598
148
148
  beamlit/functions/github/kit/__init__.py,sha256=jBwPqZv6C23_utukohxqXZwrlicNlI7PYPUj0Den7Cw,136
@@ -257,6 +257,6 @@ beamlit/serve/app.py,sha256=DXWxQoMeuA5FYvBMyLrP94OEWQbwLf4GZk3I9fkwSPA,3523
257
257
  beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
258
258
  beamlit/serve/middlewares/accesslog.py,sha256=Mu4T4_9OvHybjA0ApzZFpgi2C8f3X1NbUk-76v634XM,631
259
259
  beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
260
- beamlit-0.0.33rc47.dist-info/METADATA,sha256=vBtjbc3XlaoeqiBKNLg3oNK6DOHutXs9zIYpqwpYyE0,2405
261
- beamlit-0.0.33rc47.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
262
- beamlit-0.0.33rc47.dist-info/RECORD,,
260
+ beamlit-0.0.33rc49.dist-info/METADATA,sha256=5_QMzORLYGZDg98cqBd7UP0O94nUxM1VXacm933d1PA,2405
261
+ beamlit-0.0.33rc49.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
262
+ beamlit-0.0.33rc49.dist-info/RECORD,,