AsyncFlow
LLMFlow module for the AsyncFlow class used for defining and running flows, which are digraphs of steps. The async implementation of this class allows running async flowsteps that have all their required inputs available in parallel.
AsyncFlow
Bases: AsyncBaseFlow
Async implementation of BaseFlow that runs a series of FlowSteps in a Directed Acyclic Graph (DAG) structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
first_step |
AsyncFlowStep
|
The first step of the flow. |
required |
Attributes:
Name | Type | Description |
---|---|---|
_first_step |
AsyncFlowStep
|
The first step in the flow. |
results |
dict
|
Stores the results of the completed flow steps. |
completed_steps |
set
|
Keeps track of the steps that have been completed. |
Source code in llmflows/flows/async_flow.py
start(verbose=False, **inputs)
async
Executes the flow with the provided inputs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verbose |
bool
|
Specifies if the flow step should print their output. |
False
|
**inputs |
dict
|
The inputs to the flow. |
{}
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary of the results from each flow step. |
Raises:
Type | Description |
---|---|
ValueError
|
If any required inputs are missing. |