praisonaiagents 0.0.39__py3-none-any.whl → 0.0.40__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.
- praisonaiagents/agent/agent.py +19 -6
- {praisonaiagents-0.0.39.dist-info → praisonaiagents-0.0.40.dist-info}/METADATA +1 -1
- {praisonaiagents-0.0.39.dist-info → praisonaiagents-0.0.40.dist-info}/RECORD +5 -5
- {praisonaiagents-0.0.39.dist-info → praisonaiagents-0.0.40.dist-info}/WHEEL +0 -0
- {praisonaiagents-0.0.39.dist-info → praisonaiagents-0.0.40.dist-info}/top_level.txt +0 -0
praisonaiagents/agent/agent.py
CHANGED
@@ -71,10 +71,15 @@ class Agent:
|
|
71
71
|
|
72
72
|
import inspect
|
73
73
|
# Langchain tools
|
74
|
-
if inspect.isclass(func) and hasattr(func, 'run'):
|
74
|
+
if inspect.isclass(func) and hasattr(func, 'run') and not hasattr(func, '_run'):
|
75
75
|
original_func = func
|
76
76
|
func = func.run
|
77
77
|
function_name = original_func.__name__
|
78
|
+
# CrewAI tools
|
79
|
+
elif inspect.isclass(func) and hasattr(func, '_run'):
|
80
|
+
original_func = func
|
81
|
+
func = func._run
|
82
|
+
function_name = original_func.__name__
|
78
83
|
|
79
84
|
sig = inspect.signature(func)
|
80
85
|
logging.debug(f"Function signature: {sig}")
|
@@ -313,14 +318,22 @@ Your Goal: {self.goal}
|
|
313
318
|
|
314
319
|
if func:
|
315
320
|
try:
|
316
|
-
# If it's a class with run
|
317
|
-
if inspect.isclass(func) and hasattr(func, 'run'):
|
321
|
+
# Langchain: If it's a class with run but not _run, instantiate and call run
|
322
|
+
if inspect.isclass(func) and hasattr(func, 'run') and not hasattr(func, '_run'):
|
318
323
|
instance = func()
|
319
|
-
# Extract only the parameters that run() expects
|
320
324
|
run_params = {k: v for k, v in arguments.items()
|
321
|
-
|
322
|
-
|
325
|
+
if k in inspect.signature(instance.run).parameters
|
326
|
+
and k != 'self'}
|
323
327
|
return instance.run(**run_params)
|
328
|
+
|
329
|
+
# CrewAI: If it's a class with an _run method, instantiate and call _run
|
330
|
+
elif inspect.isclass(func) and hasattr(func, '_run'):
|
331
|
+
instance = func()
|
332
|
+
run_params = {k: v for k, v in arguments.items()
|
333
|
+
if k in inspect.signature(instance._run).parameters
|
334
|
+
and k != 'self'}
|
335
|
+
return instance._run(**run_params)
|
336
|
+
|
324
337
|
# Otherwise treat as regular function
|
325
338
|
elif callable(func):
|
326
339
|
return func(**arguments)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
praisonaiagents/__init__.py,sha256=MCgAj12hVJ0YZmVmdmZgYAAMfPdWSoNSiDlRJCvrJqA,1276
|
2
2
|
praisonaiagents/main.py,sha256=uMBdwxjnJKHLPUzr_5vXlkuhCUO6EW5O8XC0M-h47sE,13915
|
3
3
|
praisonaiagents/agent/__init__.py,sha256=sKO8wGEXvtCrvV1e834r1Okv0XAqAxqZCqz6hKLiTvA,79
|
4
|
-
praisonaiagents/agent/agent.py,sha256=
|
4
|
+
praisonaiagents/agent/agent.py,sha256=4yRT-bl4Tg6jXO_P3gXXhh2xiQ2TT-wKnCyZrCNyQ4w,37596
|
5
5
|
praisonaiagents/agents/__init__.py,sha256=_1d6Pqyk9EoBSo7E68sKyd1jDRlN1vxvVIRpoMc0Jcw,168
|
6
6
|
praisonaiagents/agents/agents.py,sha256=M-nR53A7Qcz_pJ-gyNc4xgM13Nhof7oM-5hXWzr85ho,31250
|
7
7
|
praisonaiagents/agents/autoagents.py,sha256=bjC2O5oZmoJItJXIMPTWc2lsp_AJC9tMiTQOal2hwPA,13532
|
@@ -33,7 +33,7 @@ praisonaiagents/tools/wikipedia_tools.py,sha256=pGko-f33wqXgxJTv8db7TbizY5XnzBQR
|
|
33
33
|
praisonaiagents/tools/xml_tools.py,sha256=iYTMBEk5l3L3ryQ1fkUnNVYK-Nnua2Kx2S0dxNMMs1A,17122
|
34
34
|
praisonaiagents/tools/yaml_tools.py,sha256=uogAZrhXV9O7xvspAtcTfpKSQYL2nlOTvCQXN94-G9A,14215
|
35
35
|
praisonaiagents/tools/yfinance_tools.py,sha256=s2PBj_1v7oQnOobo2fDbQBACEHl61ftG4beG6Z979ZE,8529
|
36
|
-
praisonaiagents-0.0.
|
37
|
-
praisonaiagents-0.0.
|
38
|
-
praisonaiagents-0.0.
|
39
|
-
praisonaiagents-0.0.
|
36
|
+
praisonaiagents-0.0.40.dist-info/METADATA,sha256=EzWmqwSIwOhOfnxHix9_P4VY10kLgzhVoun1N_SvJhQ,664
|
37
|
+
praisonaiagents-0.0.40.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
38
|
+
praisonaiagents-0.0.40.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
|
39
|
+
praisonaiagents-0.0.40.dist-info/RECORD,,
|
File without changes
|
File without changes
|