beamlit 0.0.32__py3-none-any.whl → 0.0.33rc44__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- beamlit/deploy/deploy.py +1 -1
- beamlit/functions/decorator.py +11 -2
- beamlit/serve/app.py +2 -4
- {beamlit-0.0.32.dist-info → beamlit-0.0.33rc44.dist-info}/METADATA +1 -1
- {beamlit-0.0.32.dist-info → beamlit-0.0.33rc44.dist-info}/RECORD +6 -6
- {beamlit-0.0.32.dist-info → beamlit-0.0.33rc44.dist-info}/WHEEL +0 -0
beamlit/deploy/deploy.py
CHANGED
@@ -130,7 +130,7 @@ metadata:
|
|
130
130
|
spec:
|
131
131
|
enabled: true
|
132
132
|
policies: [{", ".join(agent.spec.policies or [])}]
|
133
|
-
functions: [{", ".join([f"{function.metadata.name}" for (_, function) in functions])}]
|
133
|
+
functions: [{", ".join([f"{slugify(function.metadata.name)}" for (_, function) in functions])}]
|
134
134
|
agentChain: {format_agent_chain(agent.spec.agent_chain)}
|
135
135
|
model: {agent.spec.model}
|
136
136
|
runtime:
|
beamlit/functions/decorator.py
CHANGED
@@ -3,7 +3,9 @@
|
|
3
3
|
import json
|
4
4
|
from collections.abc import Callable
|
5
5
|
from logging import getLogger
|
6
|
+
import functools
|
6
7
|
|
8
|
+
from fastapi import Request
|
7
9
|
from langchain_core.tools import create_schema_from_function
|
8
10
|
|
9
11
|
from beamlit.authentication import new_client
|
@@ -77,7 +79,7 @@ def function(*args, function: Function | dict = None, kit=False, **kwargs: dict)
|
|
77
79
|
)
|
78
80
|
if isinstance(function, dict):
|
79
81
|
function = Function(**function)
|
80
|
-
|
82
|
+
|
81
83
|
def wrapper(func: Callable) -> Callable:
|
82
84
|
if function and not func.__doc__ and function.spec and function.spec.description:
|
83
85
|
func.__doc__ = function.spec.description
|
@@ -90,6 +92,13 @@ def function(*args, function: Function | dict = None, kit=False, **kwargs: dict)
|
|
90
92
|
parse_docstring=func.__doc__,
|
91
93
|
)
|
92
94
|
return remote_func
|
93
|
-
|
95
|
+
|
96
|
+
@functools.wraps(func)
|
97
|
+
async def wrapped(*args, **kwargs):
|
98
|
+
if isinstance(args[0], Request):
|
99
|
+
body = await args[0].json()
|
100
|
+
args = [body.get(param) for param in func.__code__.co_varnames[:func.__code__.co_argcount]]
|
101
|
+
return func(*args, **kwargs)
|
102
|
+
return wrapped
|
94
103
|
|
95
104
|
return wrapper
|
beamlit/serve/app.py
CHANGED
@@ -71,13 +71,11 @@ async def root(request: Request):
|
|
71
71
|
settings = get_settings()
|
72
72
|
logger = getLogger(__name__)
|
73
73
|
try:
|
74
|
-
body = await request.json()
|
75
|
-
|
76
74
|
original_func = getattr(func, "__wrapped__", func)
|
77
75
|
if asyncio.iscoroutinefunction(func) or asyncio.iscoroutinefunction(original_func):
|
78
|
-
response = await func(
|
76
|
+
response = await func(request)
|
79
77
|
else:
|
80
|
-
response = func(
|
78
|
+
response = func(request)
|
81
79
|
|
82
80
|
if isinstance(response, Response):
|
83
81
|
return response
|
@@ -137,11 +137,11 @@ beamlit/common/secrets.py,sha256=sid81bOe3LflkMKDHwBsBs9nIju8bp5-v9qU9gkyNMc,212
|
|
137
137
|
beamlit/common/settings.py,sha256=_4oCVrJZOMaTZoK2Zzo2DWqtUyBsspuOH3iAJ_nU0tw,5923
|
138
138
|
beamlit/common/utils.py,sha256=jouz5igBvT37Xn_e94-foCHyQczVim-UzVcoIF6RWJ4,657
|
139
139
|
beamlit/deploy/__init__.py,sha256=GS7l7Jtm2yKs7iNLKcfjYO-rAhUzggQ3xiYSf3oxLBY,91
|
140
|
-
beamlit/deploy/deploy.py,sha256=
|
140
|
+
beamlit/deploy/deploy.py,sha256=MlFRyKtKNB7Tm9Oo0RJbBtOgch4djm6DTon_z2iPo_k,9945
|
141
141
|
beamlit/deploy/format.py,sha256=PJ8kU7Y1pwiS3tqqyvFaag9LO3jju-4ua574163VPk4,1820
|
142
142
|
beamlit/deploy/parser.py,sha256=Ga0poCZkoRnuTw082QnTcNGCBJncoRAnVsn8-1FsaJE,6907
|
143
143
|
beamlit/functions/__init__.py,sha256=_RPG1Bfg54JGdIPnViAU6n9zD7E1cDNsdXi8oYGskzE,138
|
144
|
-
beamlit/functions/decorator.py,sha256=
|
144
|
+
beamlit/functions/decorator.py,sha256=4J5TbXYWrEm9L5XTDotuLZzqHofH45LH_w1aiBpHnok,3903
|
145
145
|
beamlit/functions/github/__init__.py,sha256=gYnUkeegukOfbymdabuuJkScvH-_ZJygX05BoqkPn0o,49
|
146
146
|
beamlit/functions/github/github.py,sha256=FajzLCNkpXcwfgnC0l9rOGT2eSPLCz8-qrMzK9N_ZNc,598
|
147
147
|
beamlit/functions/github/kit/__init__.py,sha256=jBwPqZv6C23_utukohxqXZwrlicNlI7PYPUj0Den7Cw,136
|
@@ -252,10 +252,10 @@ beamlit/models/websocket_channel.py,sha256=jg3vN7yS_oOIwGtndtIUr1LsyEA58RXLXahqS
|
|
252
252
|
beamlit/models/workspace.py,sha256=l__bIpbA4oJvxXo7UbEoCcqkvu9MiNt5aXXpZ3bgwHg,4309
|
253
253
|
beamlit/models/workspace_labels.py,sha256=WbnUY6eCTkUNdY7hhhSF-KQCl8fWFfkCf7hzCTiNp4A,1246
|
254
254
|
beamlit/models/workspace_user.py,sha256=70CcifQWYbeWG7TDui4pblTzUe5sVK0AS19vNCzKE8g,3423
|
255
|
-
beamlit/serve/app.py,sha256=
|
255
|
+
beamlit/serve/app.py,sha256=DXWxQoMeuA5FYvBMyLrP94OEWQbwLf4GZk3I9fkwSPA,3523
|
256
256
|
beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
|
257
257
|
beamlit/serve/middlewares/accesslog.py,sha256=Mu4T4_9OvHybjA0ApzZFpgi2C8f3X1NbUk-76v634XM,631
|
258
258
|
beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
|
259
|
-
beamlit-0.0.
|
260
|
-
beamlit-0.0.
|
261
|
-
beamlit-0.0.
|
259
|
+
beamlit-0.0.33rc44.dist-info/METADATA,sha256=HryePIbEOTq5hnJ0f7s2TCe0XNxXA6k25opsJzNgutw,2405
|
260
|
+
beamlit-0.0.33rc44.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
261
|
+
beamlit-0.0.33rc44.dist-info/RECORD,,
|
File without changes
|