praisonaiagents 0.0.34__tar.gz → 0.0.35__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.34 → praisonaiagents-0.0.35}/PKG-INFO +1 -1
  2. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/process/process.py +26 -3
  3. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents.egg-info/PKG-INFO +1 -1
  4. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/pyproject.toml +1 -1
  5. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/__init__.py +0 -0
  6. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/agent/__init__.py +0 -0
  7. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/agent/agent.py +0 -0
  8. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/agents/__init__.py +0 -0
  9. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/agents/agents.py +0 -0
  10. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/agents/autoagents.py +0 -0
  11. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/main.py +0 -0
  12. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/memory/memory.py +0 -0
  13. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/process/__init__.py +0 -0
  14. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/task/__init__.py +0 -0
  15. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/task/task.py +0 -0
  16. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/__init__.py +0 -0
  17. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/arxiv_tools.py +0 -0
  18. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/calculator_tools.py +0 -0
  19. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/csv_tools.py +0 -0
  20. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/duckdb_tools.py +0 -0
  21. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/duckduckgo_tools.py +0 -0
  22. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/excel_tools.py +0 -0
  23. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/file_tools.py +0 -0
  24. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/json_tools.py +0 -0
  25. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/newspaper_tools.py +0 -0
  26. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/pandas_tools.py +0 -0
  27. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/python_tools.py +0 -0
  28. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/shell_tools.py +0 -0
  29. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/spider_tools.py +0 -0
  30. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/test.py +0 -0
  31. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/tools.py +0 -0
  32. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/wikipedia_tools.py +0 -0
  33. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/xml_tools.py +0 -0
  34. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/yaml_tools.py +0 -0
  35. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents/tools/yfinance_tools.py +0 -0
  36. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents.egg-info/SOURCES.txt +0 -0
  37. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents.egg-info/dependency_links.txt +0 -0
  38. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents.egg-info/requires.txt +0 -0
  39. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/praisonaiagents.egg-info/top_level.txt +0 -0
  40. {praisonaiagents-0.0.34 → praisonaiagents-0.0.35}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.34
3
+ Version: 0.0.35
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -10,14 +10,16 @@ class LoopItems(BaseModel):
10
10
  items: List[Any]
11
11
 
12
12
  class Process:
13
- def __init__(self, tasks: Dict[str, Task], agents: List[Agent], manager_llm: Optional[str] = None, verbose: bool = False):
13
+ def __init__(self, tasks: Dict[str, Task], agents: List[Agent], manager_llm: Optional[str] = None, verbose: bool = False, max_iter: int = 10):
14
14
  self.tasks = tasks
15
15
  self.agents = agents
16
16
  self.manager_llm = manager_llm
17
17
  self.verbose = verbose
18
+ self.max_iter = max_iter
18
19
 
19
20
  async def aworkflow(self) -> AsyncGenerator[str, None]:
20
21
  """Async version of workflow method"""
22
+ current_iter = 0 # Track how many times we've looped
21
23
  # Build workflow relationships first
22
24
  for task in self.tasks.values():
23
25
  if task.next_tasks:
@@ -41,7 +43,12 @@ class Process:
41
43
  visited_tasks = set()
42
44
  loop_data = {} # Store loop-specific data
43
45
 
44
- while current_task and current_task.id not in visited_tasks:
46
+ while current_task:
47
+ current_iter += 1
48
+ if current_iter > self.max_iter:
49
+ logging.info(f"Max iteration limit {self.max_iter} reached, ending workflow.")
50
+ break
51
+
45
52
  task_id = current_task.id
46
53
  logging.info(f"Executing workflow task: {current_task.name if current_task.name else task_id}")
47
54
 
@@ -111,6 +118,11 @@ Return a JSON object with an 'items' array containing the items to process.
111
118
  yield task_id
112
119
  visited_tasks.add(task_id)
113
120
 
121
+ # Reset completed task to "not started" so it can run again
122
+ if self.tasks[task_id].status == "completed":
123
+ logging.debug(f"Task {task_id} was completed, resetting to 'not started' for next iteration.")
124
+ self.tasks[task_id].status = "not started"
125
+
114
126
  # Handle loop progression
115
127
  if current_task.task_type == "loop":
116
128
  loop_key = f"loop_{current_task.name}"
@@ -291,6 +303,7 @@ Provide a JSON with the structure:
291
303
 
292
304
  def workflow(self):
293
305
  """Synchronous version of workflow method"""
306
+ current_iter = 0 # Track how many times we've looped
294
307
  # Build workflow relationships first
295
308
  for task in self.tasks.values():
296
309
  if task.next_tasks:
@@ -314,7 +327,12 @@ Provide a JSON with the structure:
314
327
  visited_tasks = set()
315
328
  loop_data = {} # Store loop-specific data
316
329
 
317
- while current_task and current_task.id not in visited_tasks:
330
+ while current_task:
331
+ current_iter += 1
332
+ if current_iter > self.max_iter:
333
+ logging.info(f"Max iteration limit {self.max_iter} reached, ending workflow.")
334
+ break
335
+
318
336
  task_id = current_task.id
319
337
  logging.info(f"Executing workflow task: {current_task.name if current_task.name else task_id}")
320
338
 
@@ -378,6 +396,11 @@ Return a JSON object with an 'items' array containing the items to process.
378
396
  yield task_id
379
397
  visited_tasks.add(task_id)
380
398
 
399
+ # Reset completed task to "not started" so it can run again
400
+ if self.tasks[task_id].status == "completed":
401
+ logging.debug(f"Task {task_id} was completed, resetting to 'not started' for next iteration.")
402
+ self.tasks[task_id].status = "not started"
403
+
381
404
  # Handle loop progression
382
405
  if current_task.task_type == "loop":
383
406
  loop_key = f"loop_{current_task.name}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.34
3
+ Version: 0.0.35
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.34"
7
+ version = "0.0.35"
8
8
  description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
9
9
  authors = [
10
10
  { name="Mervin Praison" }