ChatFlowStep
This file contains the ChatFlowStep class, which represents a step in a Flow that is using a chat LLM.
ChatFlowStep
Bases: BaseFlowStep
Represents a step in a Flow that is utilizing a chat Language Learning Model (LLM).
A ChatFlowStep calls a language model using a system prompt and a message prompt, records the run time, and optionally invokes callback functions on the results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the flow step. |
required |
llm |
OpenAIChat
|
The language model to be used in the flow step. |
required |
output_key |
str
|
The key for the output of the flow step. |
required |
message_history |
Union[MessageHistory, None]
|
predefined conversation history |
None
|
message_key |
str
|
Key used to extract message from inputs. |
required |
message_prompt_template |
PromptTemplate
|
Prompt template for the message used with the language model. |
None
|
callbacks |
Union[list[AsyncBaseCallback], None]
|
Callbacks to be invoked within the flowstep |
None
|
Attributes:
Name | Type | Description |
---|---|---|
llm |
OpenAIChat
|
The language model to be used in the flow step. |
message_key |
str
|
Key specifying which input should be used for a message. |
message_history |
MessageHistory
|
Message history for the ChatLLM if not passed, an empty Message history is created. |
message_prompt_template |
PromptTemplate
|
Prompt template for the message used with the language model. |
required_keys |
set[str]
|
The keys required for the flow step to run. |