Skip to content

Extracting a structured (pydantic) output from documents #28371

Answered by nitinahuja
idan-ben-ami asked this question in Q&A
Discussion options

You must be logged in to vote

Ran into he same issue and here is what I did to override the default StrOutputParser
Ensure that the model you use has tool calling.

custom_parser = lambda x: x
stuff_chain = create_stuff_documents_chain(llm, prompt=my_prompt, output_parser=custom_parser)
# Then invoke normally - this replaces the default StrIOutputParser with this no-op lambda

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@idan-ben-ami
Comment options

@SetonLiang
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by idan-ben-ami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants