praisonaiagents 0.0.11__tar.gz → 0.0.12__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/PKG-INFO +1 -1
  2. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/agent/agent.py +23 -7
  3. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/PKG-INFO +1 -1
  4. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/pyproject.toml +1 -1
  5. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/__init__.py +0 -0
  6. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/agent/__init__.py +0 -0
  7. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/agents/__init__.py +0 -0
  8. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/agents/agents.py +0 -0
  9. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/__init__.py +0 -0
  10. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agent/__init__.py +0 -0
  11. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agent/agent.py +0 -0
  12. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agents/__init__.py +0 -0
  13. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/agents/agents.py +0 -0
  14. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/main.py +0 -0
  15. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/task/__init__.py +0 -0
  16. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/build/lib/praisonaiagents/task/task.py +0 -0
  17. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/main.py +0 -0
  18. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/task/__init__.py +0 -0
  19. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents/task/task.py +0 -0
  20. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/SOURCES.txt +0 -0
  21. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/dependency_links.txt +0 -0
  22. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/requires.txt +0 -0
  23. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/praisonaiagents.egg-info/top_level.txt +0 -0
  24. {praisonaiagents-0.0.11 → praisonaiagents-0.0.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: praisonaiagents
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -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 get the function from globals first
201
- func = globals().get(function_name)
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
- # Then try to get from the main module
204
- import __main__
205
- func = getattr(__main__, function_name, None)
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
- return {"error": str(e)}
223
+ error_msg = str(e)
224
+ logging.error(f"Error executing tool {function_name}: {error_msg}")
225
+ return {"error": error_msg}
212
226
 
213
- return {"error": f"Tool '{function_name}' is not callable"}
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 = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: praisonaiagents
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "praisonaiagents"
7
- version = "0.0.11"
7
+ version = "0.0.12"
8
8
  description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
9
9
  authors = [
10
10
  { name="Mervin Praison" }