Skip to content

Problem in understanding Langchain SequentialChain with prompts and output_variables #9107

Answered by dosubot bot
rmccorkl asked this question in Q&A
Discussion options

You must be logged in to vote

Answer generated by a 🤖

Answer

Hello,

In the LangChain Python framework, the output_variables attribute in the SequentialChain class is used to specify which variables should be returned as output when the chain is run. It's a list of strings that represent the keys of the output data. After each chain in the sequence is executed, its output is added to a known_values dictionary. At the end of the sequence, a new dictionary is created that only includes the keys specified in output_variables from the known_values dictionary. This new dictionary is then returned as the final output of the SequentialChain.

The output_key attribute in the LLMChain class is used as the key for the output gene…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@rmccorkl
Comment options

@rmccorkl
Comment options

@dosubot
Comment options

Answer selected by rmccorkl
@santiagovasquez1
Comment options

@dosubot
Comment options

@santiagovasquez1
Comment options

Comment options

You must be logged in to vote
1 reply
@santiagovasquez1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants