beamlit 0.0.29rc27__py3-none-any.whl → 0.0.29rc28__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
beamlit/agents/decorator.py
CHANGED
@@ -17,16 +17,18 @@ from langchain_core.tools import Tool
|
|
17
17
|
from langgraph.checkpoint.memory import MemorySaver
|
18
18
|
from langgraph.prebuilt import create_react_agent
|
19
19
|
|
20
|
-
from .chat import get_chat_model
|
21
20
|
from .chain import ChainToolkit
|
21
|
+
from .chat import get_chat_model
|
22
|
+
|
22
23
|
|
23
|
-
def get_functions(dir="src/functions", from_decorator="function"):
|
24
|
+
def get_functions(dir="src/functions", from_decorator="function", remote_functions_empty=True):
|
24
25
|
functions = []
|
25
26
|
logger = getLogger(__name__)
|
26
27
|
|
27
28
|
# Walk through all Python files in functions directory and subdirectories
|
28
29
|
if not os.path.exists(dir):
|
29
|
-
|
30
|
+
if remote_functions_empty:
|
31
|
+
logger.warn(f"Functions directory {dir} not found")
|
30
32
|
return []
|
31
33
|
for root, _, files in os.walk(dir):
|
32
34
|
for file in files:
|
@@ -74,6 +76,7 @@ def get_functions(dir="src/functions", from_decorator="function"):
|
|
74
76
|
kit_functions = get_functions(
|
75
77
|
dir=os.path.join(root),
|
76
78
|
from_decorator="kit",
|
79
|
+
remote_functions_empty=remote_functions_empty,
|
77
80
|
)
|
78
81
|
functions.extend(kit_functions)
|
79
82
|
|
@@ -134,7 +137,10 @@ def agent(
|
|
134
137
|
return wrapped
|
135
138
|
|
136
139
|
# Initialize functions array to store decorated functions
|
137
|
-
functions = get_functions(
|
140
|
+
functions = get_functions(
|
141
|
+
dir=settings.agent.functions_directory,
|
142
|
+
remote_functions_empty=not remote_functions,
|
143
|
+
)
|
138
144
|
settings.agent.functions = functions
|
139
145
|
|
140
146
|
if agent is not None:
|
@@ -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=HzBs3nI4xaH86I_r-M-HGGp6roXsJxMx-qXl_GrJaY0,2831
|
9
9
|
beamlit/agents/chat.py,sha256=gVyv4FGBdQTDhdutX8l64OUNa6Fdqaw4eCfEDRH0IPQ,3558
|
10
|
-
beamlit/agents/decorator.py,sha256=
|
10
|
+
beamlit/agents/decorator.py,sha256=4KxPcu6hPoB__1OdzpEJVD5N3QVa_syKd_Y6n6lVEjQ,9715
|
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
|
@@ -254,6 +254,6 @@ beamlit/serve/app.py,sha256=OpwPjRdyHZK6J-ziPwhiRDGGa2mvCrFVcBFE6alJVOM,3071
|
|
254
254
|
beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
|
255
255
|
beamlit/serve/middlewares/accesslog.py,sha256=Mu4T4_9OvHybjA0ApzZFpgi2C8f3X1NbUk-76v634XM,631
|
256
256
|
beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
|
257
|
-
beamlit-0.0.
|
258
|
-
beamlit-0.0.
|
259
|
-
beamlit-0.0.
|
257
|
+
beamlit-0.0.29rc28.dist-info/METADATA,sha256=UVbjc-yv-ZhbPjwVM9Ngq4A0igVBwugwKpP-EoZVodQ,2405
|
258
|
+
beamlit-0.0.29rc28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
259
|
+
beamlit-0.0.29rc28.dist-info/RECORD,,
|
File without changes
|