praisonaiagents 0.0.30__tar.gz → 0.0.31__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/PKG-INFO +1 -1
  2. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/agent/agent.py +27 -3
  3. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/main.py +32 -8
  4. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents.egg-info/PKG-INFO +1 -1
  5. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/pyproject.toml +1 -1
  6. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/__init__.py +0 -0
  7. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/agent/__init__.py +0 -0
  8. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/agents/__init__.py +0 -0
  9. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/agents/agents.py +0 -0
  10. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/agents/autoagents.py +0 -0
  11. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/memory/memory.py +0 -0
  12. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/process/__init__.py +0 -0
  13. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/process/process.py +0 -0
  14. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/task/__init__.py +0 -0
  15. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/task/task.py +0 -0
  16. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/__init__.py +0 -0
  17. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/arxiv_tools.py +0 -0
  18. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/calculator_tools.py +0 -0
  19. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/csv_tools.py +0 -0
  20. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/duckdb_tools.py +0 -0
  21. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/duckduckgo_tools.py +0 -0
  22. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/excel_tools.py +0 -0
  23. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/file_tools.py +0 -0
  24. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/json_tools.py +0 -0
  25. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/newspaper_tools.py +0 -0
  26. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/pandas_tools.py +0 -0
  27. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/python_tools.py +0 -0
  28. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/shell_tools.py +0 -0
  29. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/spider_tools.py +0 -0
  30. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/test.py +0 -0
  31. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/tools.py +0 -0
  32. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/wikipedia_tools.py +0 -0
  33. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/xml_tools.py +0 -0
  34. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/yaml_tools.py +0 -0
  35. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents/tools/yfinance_tools.py +0 -0
  36. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents.egg-info/SOURCES.txt +0 -0
  37. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents.egg-info/dependency_links.txt +0 -0
  38. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents.egg-info/requires.txt +0 -0
  39. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/praisonaiagents.egg-info/top_level.txt +0 -0
  40. {praisonaiagents-0.0.30 → praisonaiagents-0.0.31}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.30
3
+ Version: 0.0.31
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -381,7 +381,7 @@ Your Goal: {self.goal}
381
381
  display_generating("", start_time),
382
382
  console=self.console,
383
383
  refresh_per_second=4,
384
- transient=False, # Changed to False to preserve output
384
+ transient=True, # Changed to False to preserve output
385
385
  vertical_overflow="ellipsis",
386
386
  auto_refresh=True
387
387
  ) as live:
@@ -466,7 +466,15 @@ Your Goal: {self.goal}
466
466
  display_text = next((item["text"] for item in prompt if item["type"] == "text"), "")
467
467
 
468
468
  if display_text and str(display_text).strip():
469
- display_instruction(f"Agent {self.name} is processing prompt: {display_text}", console=self.console)
469
+ # Pass agent information to display_instruction
470
+ agent_tools = [t.__name__ if hasattr(t, '__name__') else str(t) for t in self.tools]
471
+ display_instruction(
472
+ f"Agent {self.name} is processing prompt: {display_text}",
473
+ console=self.console,
474
+ agent_name=self.name,
475
+ agent_role=self.role,
476
+ agent_tools=agent_tools
477
+ )
470
478
 
471
479
  response = self._chat_completion(messages, temperature=temperature, tools=tools if tools else None)
472
480
  if not response:
@@ -525,7 +533,7 @@ Your Goal: {self.goal}
525
533
  self.chat_history.append({"role": "user", "content": original_prompt})
526
534
  self.chat_history.append({"role": "assistant", "content": response_text})
527
535
  if self.verbose:
528
- logging.info(f"Agent {self.name} final response: {response_text}")
536
+ logging.debug(f"Agent {self.name} final response: {response_text}")
529
537
  display_interaction(original_prompt, response_text, markdown=self.markdown, generation_time=time.time() - start_time, console=self.console)
530
538
  return response_text
531
539
 
@@ -630,6 +638,22 @@ Output MUST be JSON with 'reflection' and 'satisfactory'.
630
638
  item["text"] += "\nReturn ONLY a valid JSON object. No other text or explanation."
631
639
  break
632
640
 
641
+ # Display instruction with agent info if verbose
642
+ if self.verbose:
643
+ display_text = prompt
644
+ if isinstance(prompt, list):
645
+ display_text = next((item["text"] for item in prompt if item["type"] == "text"), "")
646
+
647
+ if display_text and str(display_text).strip():
648
+ agent_tools = [t.__name__ if hasattr(t, '__name__') else str(t) for t in self.tools]
649
+ await adisplay_instruction(
650
+ f"Agent {self.name} is processing prompt: {display_text}",
651
+ console=self.console,
652
+ agent_name=self.name,
653
+ agent_role=self.role,
654
+ agent_tools=agent_tools
655
+ )
656
+
633
657
  # Format tools if provided
634
658
  formatted_tools = []
635
659
  if tools:
@@ -116,10 +116,10 @@ def display_interaction(message, response, markdown=True, generation_time=None,
116
116
  console.print(Text(f"Response generated in {generation_time:.1f}s", style="dim"))
117
117
 
118
118
  if markdown:
119
- console.print(Panel.fit(Markdown(message), title="Message", border_style="cyan"))
119
+ console.print(Panel.fit(Markdown(message), title="Task", border_style="cyan"))
120
120
  console.print(Panel.fit(Markdown(response), title="Response", border_style="cyan"))
121
121
  else:
122
- console.print(Panel.fit(Text(message, style="bold green"), title="Message", border_style="cyan"))
122
+ console.print(Panel.fit(Text(message, style="bold green"), title="Task", border_style="cyan"))
123
123
  console.print(Panel.fit(Text(response, style="bold blue"), title="Response", border_style="cyan"))
124
124
 
125
125
  def display_self_reflection(message: str, console=None):
@@ -135,7 +135,7 @@ def display_self_reflection(message: str, console=None):
135
135
 
136
136
  console.print(Panel.fit(Text(message, style="bold yellow"), title="Self Reflection", border_style="magenta"))
137
137
 
138
- def display_instruction(message: str, console=None):
138
+ def display_instruction(message: str, console=None, agent_name: str = None, agent_role: str = None, agent_tools: List[str] = None):
139
139
  if not message or not message.strip():
140
140
  return
141
141
  if console is None:
@@ -146,7 +146,19 @@ def display_instruction(message: str, console=None):
146
146
  if 'instruction' in sync_display_callbacks:
147
147
  sync_display_callbacks['instruction'](message=message)
148
148
 
149
- console.print(Panel.fit(Text(message, style="bold blue"), title="Instruction", border_style="cyan"))
149
+ # Display agent info if available
150
+ if agent_name:
151
+ agent_info = f"[bold #FF9B9B]👤 Agent:[/] [#FFE5E5]{agent_name}[/]"
152
+ if agent_role:
153
+ agent_info += f"\n[bold #B4B4B3]Role:[/] [#FFE5E5]{agent_role}[/]"
154
+ if agent_tools:
155
+ tools_str = ", ".join(f"[italic #B4D4FF]{tool}[/]" for tool in agent_tools)
156
+ agent_info += f"\n[bold #86A789]Tools:[/] {tools_str}"
157
+ console.print(Panel(agent_info, border_style="#D2E3C8", title="[bold]Agent Info[/]", title_align="left", padding=(1, 2)))
158
+
159
+ # Only print if log level is DEBUG
160
+ if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
161
+ console.print(Panel.fit(Text(message, style="bold blue"), title="Instruction", border_style="cyan"))
150
162
 
151
163
  def display_tool_call(message: str, console=None):
152
164
  if not message or not message.strip():
@@ -222,10 +234,10 @@ async def adisplay_interaction(message, response, markdown=True, generation_time
222
234
  console.print(Text(f"Response generated in {generation_time:.1f}s", style="dim"))
223
235
 
224
236
  if markdown:
225
- console.print(Panel.fit(Markdown(message), title="Message", border_style="cyan"))
237
+ console.print(Panel.fit(Markdown(message), title="Task", border_style="cyan"))
226
238
  console.print(Panel.fit(Markdown(response), title="Response", border_style="cyan"))
227
239
  else:
228
- console.print(Panel.fit(Text(message, style="bold green"), title="Message", border_style="cyan"))
240
+ console.print(Panel.fit(Text(message, style="bold green"), title="Task", border_style="cyan"))
229
241
  console.print(Panel.fit(Text(response, style="bold blue"), title="Response", border_style="cyan"))
230
242
 
231
243
  async def adisplay_self_reflection(message: str, console=None):
@@ -241,7 +253,7 @@ async def adisplay_self_reflection(message: str, console=None):
241
253
 
242
254
  console.print(Panel.fit(Text(message, style="bold yellow"), title="Self Reflection", border_style="magenta"))
243
255
 
244
- async def adisplay_instruction(message: str, console=None):
256
+ async def adisplay_instruction(message: str, console=None, agent_name: str = None, agent_role: str = None, agent_tools: List[str] = None):
245
257
  """Async version of display_instruction."""
246
258
  if not message or not message.strip():
247
259
  return
@@ -252,7 +264,19 @@ async def adisplay_instruction(message: str, console=None):
252
264
  if 'instruction' in async_display_callbacks:
253
265
  await async_display_callbacks['instruction'](message=message)
254
266
 
255
- console.print(Panel.fit(Text(message, style="bold blue"), title="Instruction", border_style="cyan"))
267
+ # Display agent info if available
268
+ if agent_name:
269
+ agent_info = f"[bold #FF9B9B]👤 Agent:[/] [#FFE5E5]{agent_name}[/]"
270
+ if agent_role:
271
+ agent_info += f"\n[bold #B4B4B3]Role:[/] [#FFE5E5]{agent_role}[/]"
272
+ if agent_tools:
273
+ tools_str = ", ".join(f"[italic #B4D4FF]{tool}[/]" for tool in agent_tools)
274
+ agent_info += f"\n[bold #86A789]Tools:[/] {tools_str}"
275
+ console.print(Panel(agent_info, border_style="#D2E3C8", title="[bold]Agent Info[/]", title_align="left", padding=(1, 2)))
276
+
277
+ # Only print if log level is DEBUG
278
+ if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
279
+ console.print(Panel.fit(Text(message, style="bold blue"), title="Instruction", border_style="cyan"))
256
280
 
257
281
  async def adisplay_tool_call(message: str, console=None):
258
282
  """Async version of display_tool_call."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.30
3
+ Version: 0.0.31
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.30"
7
+ version = "0.0.31"
8
8
  description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
9
9
  authors = [
10
10
  { name="Mervin Praison" }