praisonaiagents 0.0.62__py3-none-any.whl → 0.0.63__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.
@@ -438,20 +438,29 @@ class LLM:
438
438
  function_name = tool_call["function"]["name"]
439
439
  arguments = json.loads(tool_call["function"]["arguments"])
440
440
 
441
- if verbose:
442
- display_tool_call(f"Agent {agent_name} is calling function '{function_name}' with arguments: {arguments}", console=console)
443
-
441
+ logging.debug(f"[TOOL_EXEC_DEBUG] About to execute tool {function_name} with args: {arguments}")
444
442
  tool_result = execute_tool_fn(function_name, arguments)
443
+ logging.debug(f"[TOOL_EXEC_DEBUG] Tool execution result: {tool_result}")
445
444
 
446
- if tool_result:
447
- if verbose:
448
- display_tool_call(f"Function '{function_name}' returned: {tool_result}", console=console)
445
+ if verbose:
446
+ display_message = f"Agent {agent_name} called function '{function_name}' with arguments: {arguments}\n"
447
+ if tool_result:
448
+ display_message += f"Function returned: {tool_result}"
449
+ logging.debug(f"[TOOL_EXEC_DEBUG] Display message with result: {display_message}")
450
+ else:
451
+ display_message += "Function returned no output"
452
+ logging.debug("[TOOL_EXEC_DEBUG] Tool returned no output")
453
+
454
+ logging.debug(f"[TOOL_EXEC_DEBUG] About to display tool call with message: {display_message}")
455
+ display_tool_call(display_message, console=console)
456
+
449
457
  messages.append({
450
458
  "role": "tool",
451
459
  "tool_call_id": tool_call["id"],
452
460
  "content": json.dumps(tool_result)
453
461
  })
454
462
  else:
463
+ logging.debug("[TOOL_EXEC_DEBUG] Verbose mode off, not displaying tool call")
455
464
  messages.append({
456
465
  "role": "tool",
457
466
  "tool_call_id": tool_call["id"],
@@ -923,14 +932,15 @@ Output MUST be JSON with 'reflection' and 'satisfactory'.
923
932
  function_name = tool_call.function.name
924
933
  arguments = json.loads(tool_call.function.arguments)
925
934
 
926
- if verbose:
927
- display_tool_call(f"Agent {agent_name} is calling function '{function_name}' with arguments: {arguments}", console=console)
928
-
929
935
  tool_result = await execute_tool_fn(function_name, arguments)
930
936
 
931
- if tool_result:
932
- if verbose:
933
- display_tool_call(f"Function '{function_name}' returned: {tool_result}", console=console)
937
+ if verbose:
938
+ display_message = f"Agent {agent_name} called function '{function_name}' with arguments: {arguments}\n"
939
+ if tool_result:
940
+ display_message += f"Function returned: {tool_result}"
941
+ else:
942
+ display_message += "Function returned no output"
943
+ display_tool_call(display_message, console=console)
934
944
  messages.append({
935
945
  "role": "tool",
936
946
  "tool_call_id": tool_call.id,
praisonaiagents/main.py CHANGED
@@ -86,6 +86,7 @@ async def execute_callback(display_type: str, **kwargs):
86
86
  def _clean_display_content(content: str, max_length: int = 20000) -> str:
87
87
  """Helper function to clean and truncate content for display."""
88
88
  if not content or not str(content).strip():
89
+ logging.debug(f"Empty content received in _clean_display_content: {repr(content)}")
89
90
  return ""
90
91
 
91
92
  content = str(content)
@@ -174,11 +175,14 @@ def display_instruction(message: str, console=None, agent_name: str = None, agen
174
175
  console.print(Panel.fit(Text(message, style="bold blue"), title="Instruction", border_style="cyan"))
175
176
 
176
177
  def display_tool_call(message: str, console=None):
178
+ logging.debug(f"display_tool_call called with message: {repr(message)}")
177
179
  if not message or not message.strip():
180
+ logging.debug("Empty message in display_tool_call, returning early")
178
181
  return
179
182
  if console is None:
180
183
  console = Console()
181
184
  message = _clean_display_content(str(message))
185
+ logging.debug(f"Cleaned message in display_tool_call: {repr(message)}")
182
186
 
183
187
  # Execute callback if registered
184
188
  if 'tool_call' in sync_display_callbacks:
@@ -202,7 +206,8 @@ def display_error(message: str, console=None):
202
206
 
203
207
  def display_generating(content: str = "", start_time: Optional[float] = None):
204
208
  if not content or not str(content).strip():
205
- return Panel("", title="", border_style="green")
209
+ logging.debug("Empty content in display_generating, returning early")
210
+ return None
206
211
 
207
212
  elapsed_str = ""
208
213
  if start_time is not None:
@@ -293,11 +298,14 @@ async def adisplay_instruction(message: str, console=None, agent_name: str = Non
293
298
 
294
299
  async def adisplay_tool_call(message: str, console=None):
295
300
  """Async version of display_tool_call."""
301
+ logging.debug(f"adisplay_tool_call called with message: {repr(message)}")
296
302
  if not message or not message.strip():
303
+ logging.debug("Empty message in adisplay_tool_call, returning early")
297
304
  return
298
305
  if console is None:
299
306
  console = Console()
300
307
  message = _clean_display_content(str(message))
308
+ logging.debug(f"Cleaned message in adisplay_tool_call: {repr(message)}")
301
309
 
302
310
  if 'tool_call' in async_display_callbacks:
303
311
  await async_display_callbacks['tool_call'](message=message)
@@ -321,7 +329,8 @@ async def adisplay_error(message: str, console=None):
321
329
  async def adisplay_generating(content: str = "", start_time: Optional[float] = None):
322
330
  """Async version of display_generating."""
323
331
  if not content or not str(content).strip():
324
- return Panel("", title="", border_style="green")
332
+ logging.debug("Empty content in adisplay_generating, returning early")
333
+ return None
325
334
 
326
335
  elapsed_str = ""
327
336
  if start_time is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.62
3
+ Version: 0.0.63
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -1,5 +1,5 @@
1
1
  praisonaiagents/__init__.py,sha256=frdIvimDY-kU9j-9yXV1z4NtXypfPvyvlnac5mgBCuQ,1288
2
- praisonaiagents/main.py,sha256=0kB9gn9meXtr4EIrdgA2lAioKIHCRJ61audsGDwuTm4,14428
2
+ praisonaiagents/main.py,sha256=l29nGEbV2ReBi4szURbnH0Fk0w2F_QZTmECysyZjYcA,15066
3
3
  praisonaiagents/agent/__init__.py,sha256=j0T19TVNbfZcClvpbZDDinQxZ0oORgsMrMqx16jZ-bA,128
4
4
  praisonaiagents/agent/agent.py,sha256=h3s0-1M88zujllDHnKijHmYeVihD75d-K9s2Y3IHLY4,61850
5
5
  praisonaiagents/agent/image_agent.py,sha256=-5MXG594HVwSpFMcidt16YBp7udtik-Cp7eXlzLE1fY,8696
@@ -10,7 +10,7 @@ praisonaiagents/knowledge/__init__.py,sha256=xL1Eh-a3xsHyIcU4foOWF-JdWYIYBALJH9b
10
10
  praisonaiagents/knowledge/chunking.py,sha256=FzoNY0q8MkvG4gADqk4JcRhmH3lcEHbRdonDgitQa30,6624
11
11
  praisonaiagents/knowledge/knowledge.py,sha256=fQNREDiwdoisfIxJBLVkteXgq_8Gbypfc3UaZbxf5QY,13210
12
12
  praisonaiagents/llm/__init__.py,sha256=ttPQQJQq6Tah-0updoEXDZFKWtJAM93rBWRoIgxRWO8,689
13
- praisonaiagents/llm/llm.py,sha256=pYXKXuvJgbqItO8MDmAZVYZwb5es1HDfn10refHz0Ck,73025
13
+ praisonaiagents/llm/llm.py,sha256=hByGXJFHC4BPcsu2b1RZN239mfNp4sz5WuTJDallfaQ,73982
14
14
  praisonaiagents/memory/memory.py,sha256=I8dOTkrl1i-GgQbDcrFOsSruzJ7MiI6Ys37DK27wrUs,35537
15
15
  praisonaiagents/process/__init__.py,sha256=lkYbL7Hn5a0ldvJtkdH23vfIIZLIcanK-65C0MwaorY,52
16
16
  praisonaiagents/process/process.py,sha256=HPw84OhnKQW3EyrDkpoQu0DcpxThbrzR2hWUgwQh9Pw,59955
@@ -37,7 +37,7 @@ praisonaiagents/tools/xml_tools.py,sha256=iYTMBEk5l3L3ryQ1fkUnNVYK-Nnua2Kx2S0dxN
37
37
  praisonaiagents/tools/yaml_tools.py,sha256=uogAZrhXV9O7xvspAtcTfpKSQYL2nlOTvCQXN94-G9A,14215
38
38
  praisonaiagents/tools/yfinance_tools.py,sha256=s2PBj_1v7oQnOobo2fDbQBACEHl61ftG4beG6Z979ZE,8529
39
39
  praisonaiagents/tools/train/data/generatecot.py,sha256=H6bNh-E2hqL5MW6kX3hqZ05g9ETKN2-kudSjiuU_SD8,19403
40
- praisonaiagents-0.0.62.dist-info/METADATA,sha256=w9bbiQEKBjIErkraz8jMhhN1qkeA4WBPf2ylGn9Skz4,830
41
- praisonaiagents-0.0.62.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
42
- praisonaiagents-0.0.62.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
43
- praisonaiagents-0.0.62.dist-info/RECORD,,
40
+ praisonaiagents-0.0.63.dist-info/METADATA,sha256=oZNwr62vIILdar4v3DrKgAuVnYEzvNNUH_o9Ndy7NMI,830
41
+ praisonaiagents-0.0.63.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
42
+ praisonaiagents-0.0.63.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
43
+ praisonaiagents-0.0.63.dist-info/RECORD,,