beamlit 0.0.31rc41__py3-none-any.whl → 0.0.31rc42__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
beamlit/functions/decorator.py
CHANGED
@@ -68,10 +68,16 @@ def kit(bl_kit: FunctionKit = None, **kwargs: dict) -> Callable:
|
|
68
68
|
return wrapper
|
69
69
|
|
70
70
|
|
71
|
-
def function(*args, function: Function = None, kit=False, **kwargs: dict) -> Callable:
|
71
|
+
def function(*args, function: Function | dict = None, kit=False, **kwargs: dict) -> Callable:
|
72
72
|
"""Create function tools with Beamlit and LangChain integration."""
|
73
73
|
settings = get_settings()
|
74
|
-
|
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
|
+
|
75
81
|
def wrapper(func: Callable) -> Callable:
|
76
82
|
if function and not func.__doc__ and function.spec and function.spec.description:
|
77
83
|
func.__doc__ = function.spec.description
|
@@ -141,7 +141,7 @@ beamlit/deploy/deploy.py,sha256=xo2fAdF6jR1cG75sXMzpqsJlG_qGAKVnMwjuDa_8sk8,9936
|
|
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=YNNU8MZXV2C6gIjxaYhp-FSWGLc9I_XLsIE24zQ3fr8,3541
|
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
|
@@ -256,6 +256,6 @@ beamlit/serve/app.py,sha256=QzReZZjGFQWhNA1XBDq81rsn9zpEihtLZLrfZi9ThT0,3554
|
|
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.31rc42.dist-info/METADATA,sha256=9DQPwNYvv6Q3ailPx5xQTQCxOyzOKlD8xuLp6qcBhck,2405
|
260
|
+
beamlit-0.0.31rc42.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
261
|
+
beamlit-0.0.31rc42.dist-info/RECORD,,
|
File without changes
|