Extracting a structured (pydantic) output from documents #28371
Unanswered
idan-ben-ami
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked other resources
Commit to Help
Example Code
Description
The problem is that when creating the chain with
create_stuff_documents_chain
it adds an unwanted StrOutputParser (output_parser: Output parser. Defaults to StrOutputParser.), and since I already use thewith_structured_output
which adds a PydanticOutputParser - the input to the (unwanted) StrOutputParser is a Pydantic instance rather than a string.I ended up patching the "create_stuff_documents_chain" to ignore output_parser when not supplied (or worse - reimplement it in my code).
What is the right way of using it?
System Info
System Information
Package Information
Beta Was this translation helpful? Give feedback.
All reactions