praisonaiagents 0.0.62__py3-none-any.whl → 0.0.64__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.
@@ -171,6 +171,8 @@ class LLM:
171
171
 
172
172
  # Enable error dropping for cleaner output
173
173
  litellm.drop_params = True
174
+ # Enable parameter modification for providers like Anthropic
175
+ litellm.modify_params = True
174
176
  self._setup_event_tracking(events)
175
177
 
176
178
  # Log all initialization parameters when in debug mode
@@ -438,20 +440,29 @@ class LLM:
438
440
  function_name = tool_call["function"]["name"]
439
441
  arguments = json.loads(tool_call["function"]["arguments"])
440
442
 
441
- if verbose:
442
- display_tool_call(f"Agent {agent_name} is calling function '{function_name}' with arguments: {arguments}", console=console)
443
-
443
+ logging.debug(f"[TOOL_EXEC_DEBUG] About to execute tool {function_name} with args: {arguments}")
444
444
  tool_result = execute_tool_fn(function_name, arguments)
445
+ logging.debug(f"[TOOL_EXEC_DEBUG] Tool execution result: {tool_result}")
445
446
 
446
- if tool_result:
447
- if verbose:
448
- display_tool_call(f"Function '{function_name}' returned: {tool_result}", console=console)
447
+ if verbose:
448
+ display_message = f"Agent {agent_name} called function '{function_name}' with arguments: {arguments}\n"
449
+ if tool_result:
450
+ display_message += f"Function returned: {tool_result}"
451
+ logging.debug(f"[TOOL_EXEC_DEBUG] Display message with result: {display_message}")
452
+ else:
453
+ display_message += "Function returned no output"
454
+ logging.debug("[TOOL_EXEC_DEBUG] Tool returned no output")
455
+
456
+ logging.debug(f"[TOOL_EXEC_DEBUG] About to display tool call with message: {display_message}")
457
+ display_tool_call(display_message, console=console)
458
+
449
459
  messages.append({
450
460
  "role": "tool",
451
461
  "tool_call_id": tool_call["id"],
452
462
  "content": json.dumps(tool_result)
453
463
  })
454
464
  else:
465
+ logging.debug("[TOOL_EXEC_DEBUG] Verbose mode off, not displaying tool call")
455
466
  messages.append({
456
467
  "role": "tool",
457
468
  "tool_call_id": tool_call["id"],
@@ -923,14 +934,15 @@ Output MUST be JSON with 'reflection' and 'satisfactory'.
923
934
  function_name = tool_call.function.name
924
935
  arguments = json.loads(tool_call.function.arguments)
925
936
 
926
- if verbose:
927
- display_tool_call(f"Agent {agent_name} is calling function '{function_name}' with arguments: {arguments}", console=console)
928
-
929
937
  tool_result = await execute_tool_fn(function_name, arguments)
930
938
 
931
- if tool_result:
932
- if verbose:
933
- display_tool_call(f"Function '{function_name}' returned: {tool_result}", console=console)
939
+ if verbose:
940
+ display_message = f"Agent {agent_name} called function '{function_name}' with arguments: {arguments}\n"
941
+ if tool_result:
942
+ display_message += f"Function returned: {tool_result}"
943
+ else:
944
+ display_message += "Function returned no output"
945
+ display_tool_call(display_message, console=console)
934
946
  messages.append({
935
947
  "role": "tool",
936
948
  "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.64
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=6QMRW47fgFozibzaqxa3dwxlD756rMLCRjL3eNsw8QQ,74088
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.64.dist-info/METADATA,sha256=-tEl9Hf9UGdFXGT1K9IF2XoT4RvsA5WDrzNr1P9L5OU,830
41
+ praisonaiagents-0.0.64.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
42
+ praisonaiagents-0.0.64.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
43
+ praisonaiagents-0.0.64.dist-info/RECORD,,