API Reference
Process Module
Documentation for the praisonaiagents.process.process module
Module praisonaiagents.process.process
Classes
Process
The main class for handling task execution processes in different modes (sequential, hierarchical, workflow).
Parameters
tasks: Dict[str, Task]
- Dictionary of tasks to be executedagents: List[Agent]
- List of available agentsmanager_llm: Optional[str] = None
- Language model for manager agent in hierarchical processverbose: bool = False
- Enable verbose logging
Methods
workflow(self)
- Execute tasks in a workflow pattern with support for loops and conditionssequential(self)
- Execute tasks in sequential orderhierarchical(self)
- Execute tasks in hierarchical order with a manager agent
Async Methods
aworkflow(self) -> AsyncGenerator[str, None]
- Async version of workflow processasequential(self) -> AsyncGenerator[str, None]
- Async version of sequential processahierarchical(self) -> AsyncGenerator[str, None]
- Async version of hierarchical process
Async Process Support
Each process type has an async counterpart that supports non-blocking execution:
Example usage:
Async Process Features
- Non-blocking task execution
- Parallel task processing
- Mixed sync/async task support
- Efficient resource utilization
- Async manager coordination (hierarchical)
- Dynamic task scheduling (workflow)
LoopItems
A Pydantic model for handling loop data in workflow process.
Parameters
items: List[Any]
- List of items to be processed in a loop
Process Types
Sequential Process
- Tasks are executed one after another in a linear fashion
- Each task is completed before moving to the next one
- Simplest form of task execution
Hierarchical Process
- Uses a manager agent to coordinate task execution
- Manager decides task order and agent assignments
- Provides more complex task orchestration
- Requires manager_llm parameter
- Supports dynamic agent assignment
Workflow Process
- Supports complex task relationships
- Features:
- Task dependencies
- Conditional execution
- Loops
- Context sharing between tasks
- Maintains task state and relationships
- Handles data flow between tasks
Was this page helpful?