praisonaiagents 0.0.10__tar.gz → 0.0.12__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/PKG-INFO +1 -1
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/agent/agent.py +23 -7
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/PKG-INFO +1 -1
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/pyproject.toml +1 -1
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/agent/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/agents/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/agents/agents.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agent/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agent/agent.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agents/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agents/agents.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/main.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/task/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/task/task.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/main.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/task/__init__.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/task/task.py +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/SOURCES.txt +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/dependency_links.txt +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/requires.txt +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/top_level.txt +0 -0
- {praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/setup.cfg +0 -0
@@ -197,20 +197,36 @@ class Agent:
|
|
197
197
|
"""
|
198
198
|
logging.debug(f"{self.name} executing tool {function_name} with arguments: {arguments}")
|
199
199
|
|
200
|
-
# Try to
|
201
|
-
func =
|
200
|
+
# Try to find the function in the agent's tools list first
|
201
|
+
func = None
|
202
|
+
for tool in self.tools:
|
203
|
+
if callable(tool) and getattr(tool, '__name__', '') == function_name:
|
204
|
+
func = tool
|
205
|
+
break
|
206
|
+
|
207
|
+
logging.debug(f"Looking for {function_name} in agent tools: {func is not None}")
|
208
|
+
|
209
|
+
# If not found in tools, try globals and main
|
202
210
|
if not func:
|
203
|
-
|
204
|
-
|
205
|
-
|
211
|
+
func = globals().get(function_name)
|
212
|
+
logging.debug(f"Looking for {function_name} in globals: {func is not None}")
|
213
|
+
|
214
|
+
if not func:
|
215
|
+
import __main__
|
216
|
+
func = getattr(__main__, function_name, None)
|
217
|
+
logging.debug(f"Looking for {function_name} in __main__: {func is not None}")
|
206
218
|
|
207
219
|
if func and callable(func):
|
208
220
|
try:
|
209
221
|
return func(**arguments)
|
210
222
|
except Exception as e:
|
211
|
-
|
223
|
+
error_msg = str(e)
|
224
|
+
logging.error(f"Error executing tool {function_name}: {error_msg}")
|
225
|
+
return {"error": error_msg}
|
212
226
|
|
213
|
-
|
227
|
+
error_msg = f"Tool '{function_name}' is not callable"
|
228
|
+
logging.error(error_msg)
|
229
|
+
return {"error": error_msg}
|
214
230
|
|
215
231
|
def clear_history(self):
|
216
232
|
self.chat_history = []
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/main.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.10 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|