Flow
LLMFlow module for the Flow class used for defining and executing flows, which are
digraphs of steps. Each step is represented by a FlowStep
instance.
Flow
Bases: BaseFlow
Base class for all flows. Each flow is a digraph of steps, represented by FlowStep instances.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
first_step |
BaseFlowStep
|
The first step of the flow. |
required |
Attributes:
Name | Type | Description |
---|---|---|
_first_step |
BaseFlowStep
|
The first step in the flow. |
results |
dict
|
Stores the results of the executed flow steps. |
completed_steps |
set
|
Keeps track of the steps that have been executed. |
Source code in llmflows/flows/flow.py
start(verbose=False, **inputs)
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. |