praisonaiagents 0.0.31__py3-none-any.whl → 0.0.32__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -130,22 +130,29 @@ Return a JSON object with an 'items' array containing the items to process.
130
130
 
131
131
  # Determine next task based on result
132
132
  next_task = None
133
- if current_task.result:
133
+ if current_task and current_task.result:
134
134
  if current_task.task_type in ["decision", "loop"]:
135
135
  result = current_task.result.raw.lower()
136
136
  # Check conditions
137
137
  for condition, tasks in current_task.condition.items():
138
- if condition.lower() in result and tasks:
139
- next_task_name = tasks[0]
138
+ if condition.lower() in result:
139
+ # Handle both list and direct string values
140
+ task_value = tasks[0] if isinstance(tasks, list) else tasks
141
+ if not task_value or task_value == "exit": # If empty or explicit exit
142
+ logging.info("Workflow exit condition met, ending workflow")
143
+ current_task = None
144
+ break
145
+ next_task_name = task_value
140
146
  next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
141
147
  # For loops, allow revisiting the same task
142
148
  if next_task and next_task.id == current_task.id:
143
149
  visited_tasks.discard(current_task.id)
144
150
  break
145
151
 
146
- if not next_task and current_task.next_tasks:
147
- next_task_name = current_task.next_tasks[0]
148
- next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
152
+ if not next_task and current_task and current_task.next_tasks:
153
+ print(current_task.next_tasks)
154
+ next_task_name = current_task.next_tasks[0]
155
+ next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
149
156
 
150
157
  current_task = next_task
151
158
  if not current_task:
@@ -391,22 +398,29 @@ Return a JSON object with an 'items' array containing the items to process.
391
398
 
392
399
  # Determine next task based on result
393
400
  next_task = None
394
- if current_task.result:
401
+ if current_task and current_task.result:
395
402
  if current_task.task_type in ["decision", "loop"]:
396
403
  result = current_task.result.raw.lower()
397
404
  # Check conditions
398
405
  for condition, tasks in current_task.condition.items():
399
- if condition.lower() in result and tasks:
400
- next_task_name = tasks[0]
406
+ if condition.lower() in result:
407
+ # Handle both list and direct string values
408
+ task_value = tasks[0] if isinstance(tasks, list) else tasks
409
+ if not task_value or task_value == "exit": # If empty or explicit exit
410
+ logging.info("Workflow exit condition met, ending workflow")
411
+ current_task = None
412
+ break
413
+ next_task_name = task_value
401
414
  next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
402
415
  # For loops, allow revisiting the same task
403
416
  if next_task and next_task.id == current_task.id:
404
417
  visited_tasks.discard(current_task.id)
405
418
  break
406
419
 
407
- if not next_task and current_task.next_tasks:
408
- next_task_name = current_task.next_tasks[0]
409
- next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
420
+ if not next_task and current_task and current_task.next_tasks:
421
+ print(current_task.next_tasks)
422
+ next_task_name = current_task.next_tasks[0]
423
+ next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
410
424
 
411
425
  current_task = next_task
412
426
  if not current_task:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.31
3
+ Version: 0.0.32
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -7,7 +7,7 @@ praisonaiagents/agents/agents.py,sha256=N55Ae3JkjNgGQ6pXBaBpI73sA80Y-pPUZLOd1Ngt
7
7
  praisonaiagents/agents/autoagents.py,sha256=bjC2O5oZmoJItJXIMPTWc2lsp_AJC9tMiTQOal2hwPA,13532
8
8
  praisonaiagents/memory/memory.py,sha256=ZxqSpOUxk9jeTKGW0ZiTifC0uZtym-EZILP3kuOOKkU,35626
9
9
  praisonaiagents/process/__init__.py,sha256=lkYbL7Hn5a0ldvJtkdH23vfIIZLIcanK-65C0MwaorY,52
10
- praisonaiagents/process/process.py,sha256=4qXdrCDQPH5MtvHvdJVURXKNgSl6ae3OYTiqAF_A2ZU,24295
10
+ praisonaiagents/process/process.py,sha256=zMoGYJSrIE-v9lKUkPpPbUspF9cPHeh8l5HM8tyttjU,25303
11
11
  praisonaiagents/task/__init__.py,sha256=VL5hXVmyGjINb34AalxpBMl-YW9m5EDcRkMTKkSSl7c,80
12
12
  praisonaiagents/task/task.py,sha256=mwmk98nesfz102qTnHSE5VuuPIgHiPDxjeEX7b7g2BA,10023
13
13
  praisonaiagents/tools/__init__.py,sha256=-0lV5n5cG54vYW6REjXIfuJnCLKnfQIDlXsySCaPB9s,7347
@@ -30,7 +30,7 @@ praisonaiagents/tools/wikipedia_tools.py,sha256=pGko-f33wqXgxJTv8db7TbizY5XnzBQR
30
30
  praisonaiagents/tools/xml_tools.py,sha256=iYTMBEk5l3L3ryQ1fkUnNVYK-Nnua2Kx2S0dxNMMs1A,17122
31
31
  praisonaiagents/tools/yaml_tools.py,sha256=uogAZrhXV9O7xvspAtcTfpKSQYL2nlOTvCQXN94-G9A,14215
32
32
  praisonaiagents/tools/yfinance_tools.py,sha256=nmzjS7G_5GqMQD4r867mt17dHg5xvtsYDDfOPh68SgE,8105
33
- praisonaiagents-0.0.31.dist-info/METADATA,sha256=NRAZ9s36jGyIjg0HXKjwVh3_GYmCAERoDtuYH5H2SK0,306
34
- praisonaiagents-0.0.31.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
35
- praisonaiagents-0.0.31.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
36
- praisonaiagents-0.0.31.dist-info/RECORD,,
33
+ praisonaiagents-0.0.32.dist-info/METADATA,sha256=4tDDA-cB-DcwEM-UfhyImUXHmMpXI5rmkq4HEppM4NU,306
34
+ praisonaiagents-0.0.32.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
35
+ praisonaiagents-0.0.32.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
36
+ praisonaiagents-0.0.32.dist-info/RECORD,,