praisonaiagents 0.0.32__tar.gz → 0.0.34__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/PKG-INFO +1 -1
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/agent/agent.py +2 -1
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/agents/agents.py +37 -9
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/process/process.py +0 -2
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents.egg-info/PKG-INFO +1 -1
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/pyproject.toml +1 -1
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/__init__.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/agent/__init__.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/agents/__init__.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/agents/autoagents.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/main.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/memory/memory.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/process/__init__.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/task/__init__.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/task/task.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/__init__.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/arxiv_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/calculator_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/csv_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/duckdb_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/duckduckgo_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/excel_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/file_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/json_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/newspaper_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/pandas_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/python_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/shell_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/spider_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/test.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/wikipedia_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/xml_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/yaml_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents/tools/yfinance_tools.py +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents.egg-info/SOURCES.txt +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents.egg-info/dependency_links.txt +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents.egg-info/requires.txt +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents.egg-info/top_level.txt +0 -0
- {praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/setup.cfg +0 -0
@@ -211,6 +211,11 @@ class PraisonAIAgents:
|
|
211
211
|
|
212
212
|
executor_agent = task.agent
|
213
213
|
|
214
|
+
# Ensure tools are available from both task and agent
|
215
|
+
tools = task.tools or []
|
216
|
+
if executor_agent and executor_agent.tools:
|
217
|
+
tools.extend(executor_agent.tools)
|
218
|
+
|
214
219
|
task_prompt = f"""
|
215
220
|
You need to do the following task: {task.description}.
|
216
221
|
Expected Output: {task.expected_output}.
|
@@ -267,14 +272,14 @@ Here are the results of previous tasks that might be useful:\n
|
|
267
272
|
|
268
273
|
agent_output = await executor_agent.achat(
|
269
274
|
_get_multimodal_message(task_prompt, task.images),
|
270
|
-
tools=
|
275
|
+
tools=tools,
|
271
276
|
output_json=task.output_json,
|
272
277
|
output_pydantic=task.output_pydantic
|
273
278
|
)
|
274
279
|
else:
|
275
280
|
agent_output = await executor_agent.achat(
|
276
281
|
task_prompt,
|
277
|
-
tools=
|
282
|
+
tools=tools,
|
278
283
|
output_json=task.output_json,
|
279
284
|
output_pydantic=task.output_pydantic
|
280
285
|
)
|
@@ -380,11 +385,25 @@ Here are the results of previous tasks that might be useful:\n
|
|
380
385
|
)
|
381
386
|
|
382
387
|
if self.process == "workflow":
|
388
|
+
# Collect all tasks that should run in parallel
|
389
|
+
parallel_tasks = []
|
383
390
|
async for task_id in process.aworkflow():
|
384
|
-
if self.tasks[task_id].async_execution:
|
385
|
-
|
386
|
-
|
387
|
-
|
391
|
+
if self.tasks[task_id].async_execution and self.tasks[task_id].is_start:
|
392
|
+
parallel_tasks.append(task_id)
|
393
|
+
elif parallel_tasks:
|
394
|
+
# Execute collected parallel tasks
|
395
|
+
await asyncio.gather(*[self.arun_task(t) for t in parallel_tasks])
|
396
|
+
parallel_tasks = []
|
397
|
+
# Run the current non-parallel task
|
398
|
+
if self.tasks[task_id].async_execution:
|
399
|
+
await self.arun_task(task_id)
|
400
|
+
else:
|
401
|
+
self.run_task(task_id)
|
402
|
+
|
403
|
+
# Execute any remaining parallel tasks
|
404
|
+
if parallel_tasks:
|
405
|
+
await asyncio.gather(*[self.arun_task(t) for t in parallel_tasks])
|
406
|
+
|
388
407
|
elif self.process == "sequential":
|
389
408
|
async for task_id in process.asequential():
|
390
409
|
if self.tasks[task_id].async_execution:
|
@@ -596,8 +615,12 @@ Here are the results of previous tasks that might be useful:\n
|
|
596
615
|
task.status = "completed"
|
597
616
|
# Run execute_callback for memory operations
|
598
617
|
try:
|
599
|
-
|
600
|
-
|
618
|
+
if asyncio.get_event_loop().is_running():
|
619
|
+
asyncio.create_task(task.execute_callback(task_output))
|
620
|
+
else:
|
621
|
+
loop = asyncio.new_event_loop()
|
622
|
+
asyncio.set_event_loop(loop)
|
623
|
+
loop.run_until_complete(task.execute_callback(task_output))
|
601
624
|
except Exception as e:
|
602
625
|
logger.error(f"Error executing memory callback for task {task_id}: {e}")
|
603
626
|
logger.exception(e)
|
@@ -606,7 +629,12 @@ Here are the results of previous tasks that might be useful:\n
|
|
606
629
|
if task.callback:
|
607
630
|
try:
|
608
631
|
if asyncio.iscoroutinefunction(task.callback):
|
609
|
-
|
632
|
+
if asyncio.get_event_loop().is_running():
|
633
|
+
asyncio.create_task(task.callback(task_output))
|
634
|
+
else:
|
635
|
+
loop = asyncio.new_event_loop()
|
636
|
+
asyncio.set_event_loop(loop)
|
637
|
+
loop.run_until_complete(task.callback(task_output))
|
610
638
|
else:
|
611
639
|
task.callback(task_output)
|
612
640
|
except Exception as e:
|
@@ -150,7 +150,6 @@ Return a JSON object with an 'items' array containing the items to process.
|
|
150
150
|
break
|
151
151
|
|
152
152
|
if not next_task and current_task and current_task.next_tasks:
|
153
|
-
print(current_task.next_tasks)
|
154
153
|
next_task_name = current_task.next_tasks[0]
|
155
154
|
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
|
156
155
|
|
@@ -418,7 +417,6 @@ Return a JSON object with an 'items' array containing the items to process.
|
|
418
417
|
break
|
419
418
|
|
420
419
|
if not next_task and current_task and current_task.next_tasks:
|
421
|
-
print(current_task.next_tasks)
|
422
420
|
next_task_name = current_task.next_tasks[0]
|
423
421
|
next_task = next((t for t in self.tasks.values() if t.name == next_task_name), None)
|
424
422
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{praisonaiagents-0.0.32 → praisonaiagents-0.0.34}/praisonaiagents.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|