Add Option to Disable Output Parser in create_stuff_documents_chain #24620
dheerajt10
announced in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Currently, the create_stuff_documents_chain function does not provide an option to disable the output_parser. This can be problematic when an output parser is unnecessary, or a custom output parser is already being used in an individual chain.
Motivation
The issue arises when creating a conversational RAG with chat history using a structured LLM. When the LLM output is already structured (e.g., using pydantic.BaseModel), passing the output through the default output parser, StrOutputParser, can result in a validation error.
Proposal (If applicable)
I suggest adding a provision to disable the output_parser altogether in the create_stuff_documents_chain function. This feature is crucial because the function is a commonly used LCEL Chain constructor. Allowing the option to disable the output parser would provide greater flexibility and prevent unnecessary validation errors when the output is already in the desired format.
Beta Was this translation helpful? Give feedback.
All reactions