praisonaiagents 0.0.63__py3-none-any.whl → 0.0.65__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.
@@ -477,8 +477,14 @@ Context:
477
477
  else:
478
478
  self.run_task(task_id)
479
479
 
480
- async def astart(self, content=None, **kwargs):
481
- """Async version of start method"""
480
+ async def astart(self, content=None, return_dict=False, **kwargs):
481
+ """Async version of start method
482
+
483
+ Args:
484
+ content: Optional content to add to all tasks' context
485
+ return_dict: If True, returns the full results dictionary instead of only the final response
486
+ **kwargs: Additional arguments
487
+ """
482
488
  if content:
483
489
  # Add content to context of all tasks
484
490
  for task in self.tasks.values():
@@ -488,10 +494,25 @@ Context:
488
494
  task.context.append(content)
489
495
 
490
496
  await self.arun_all_tasks()
491
- return {
497
+
498
+ # Get results
499
+ results = {
492
500
  "task_status": self.get_all_tasks_status(),
493
501
  "task_results": {task_id: self.get_task_result(task_id) for task_id in self.tasks}
494
502
  }
503
+
504
+ # By default, return only the final agent's response
505
+ if not return_dict:
506
+ # Get the last task (assuming sequential processing)
507
+ task_ids = list(self.tasks.keys())
508
+ if task_ids:
509
+ last_task_id = task_ids[-1]
510
+ last_result = self.get_task_result(last_task_id)
511
+ if last_result:
512
+ return last_result.raw
513
+
514
+ # Return full results dict if return_dict is True or if no final result was found
515
+ return results
495
516
 
496
517
  def save_output_to_file(self, task, task_output):
497
518
  if task.output_file:
@@ -801,8 +822,14 @@ Context:
801
822
  return str(agent[0])
802
823
  return None
803
824
 
804
- def start(self, content=None, **kwargs):
805
- """Start agent execution with optional content and config"""
825
+ def start(self, content=None, return_dict=False, **kwargs):
826
+ """Start agent execution with optional content and config
827
+
828
+ Args:
829
+ content: Optional content to add to all tasks' context
830
+ return_dict: If True, returns the full results dictionary instead of only the final response
831
+ **kwargs: Additional arguments
832
+ """
806
833
  if content:
807
834
  # Add content to context of all tasks
808
835
  for task in self.tasks.values():
@@ -815,10 +842,25 @@ Context:
815
842
 
816
843
  # Run tasks as before
817
844
  self.run_all_tasks()
818
- return {
845
+
846
+ # Get results
847
+ results = {
819
848
  "task_status": self.get_all_tasks_status(),
820
849
  "task_results": {task_id: self.get_task_result(task_id) for task_id in self.tasks}
821
850
  }
851
+
852
+ # By default, return only the final agent's response
853
+ if not return_dict:
854
+ # Get the last task (assuming sequential processing)
855
+ task_ids = list(self.tasks.keys())
856
+ if task_ids:
857
+ last_task_id = task_ids[-1]
858
+ last_result = self.get_task_result(last_task_id)
859
+ if last_result:
860
+ return last_result.raw
861
+
862
+ # Return full results dict if return_dict is True or if no final result was found
863
+ return results
822
864
 
823
865
  def set_state(self, key: str, value: Any) -> None:
824
866
  """Set a state value"""
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.63
3
+ Version: 0.0.65
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,13 +4,13 @@ praisonaiagents/agent/__init__.py,sha256=j0T19TVNbfZcClvpbZDDinQxZ0oORgsMrMqx16j
4
4
  praisonaiagents/agent/agent.py,sha256=h3s0-1M88zujllDHnKijHmYeVihD75d-K9s2Y3IHLY4,61850
5
5
  praisonaiagents/agent/image_agent.py,sha256=-5MXG594HVwSpFMcidt16YBp7udtik-Cp7eXlzLE1fY,8696
6
6
  praisonaiagents/agents/__init__.py,sha256=_1d6Pqyk9EoBSo7E68sKyd1jDRlN1vxvVIRpoMc0Jcw,168
7
- praisonaiagents/agents/agents.py,sha256=94YPQl-hl-EPY6-Xk2Rj9wlIs9YtiLQbsutSOXWX8QI,36156
7
+ praisonaiagents/agents/agents.py,sha256=KLfSuz6nGEJM-n4xCXdtIkES6cUI-LwvMxI3R-MjrD0,37862
8
8
  praisonaiagents/agents/autoagents.py,sha256=olYDn--rlJp-SckxILqmREkkgNlzCgEEcAUzfMj-54E,13518
9
9
  praisonaiagents/knowledge/__init__.py,sha256=xL1Eh-a3xsHyIcU4foOWF-JdWYIYBALJH9bge0Ujuto,246
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=hByGXJFHC4BPcsu2b1RZN239mfNp4sz5WuTJDallfaQ,73982
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.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,,
40
+ praisonaiagents-0.0.65.dist-info/METADATA,sha256=yns65YUATN0vnXt8y4TMvoNUTgvp1fPkKKjqZAVSjcY,830
41
+ praisonaiagents-0.0.65.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
42
+ praisonaiagents-0.0.65.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
43
+ praisonaiagents-0.0.65.dist-info/RECORD,,