AsyncFlowStep
This module the AsyncFlowStep class, which can execute a language model, record execution times, and optionally invoke callbacks on the results. The async implementation allows async flowsteps to be executed in parallel if multiple flowsteps have all the required inputs available.
AsyncFlowStep
Bases: AsyncBaseFlowStep
Represents a specific async step in an async Flow.
An AsyncFlowStep calls a language model using a prompt template, records the run time, and optionally invokes callback functions on the results. Async Flowsteps can be run in parallel in an AsyncFlow if all the required inputs are available.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the flow step. |
required |
llm |
BaseLLM
|
The language model to be used in the flow step. |
required |
prompt_template |
PromptTemplate
|
Template for the prompt to be used with the language model. |
required |
callbacks |
Union[list[AsyncBaseCallback], None]
|
Callbacks to be invoked when running the flow |
None
|
Attributes:
Name | Type | Description |
---|---|---|
llm |
BaseLLM
|
The language model to be used in the flow step. |
prompt_template |
PromptTemplate
|
Template for the prompt to be used with the language model. |
required_keys |
set[str]
|
The keys required for the flow step to run. |