fix: output parser bugs in xml.py and pydantic.py#35641
fix: output parser bugs in xml.py and pydantic.py#35641jnMetaCode wants to merge 2 commits intolangchain-ai:masterfrom
Conversation
The error message strings were concatenated without spaces, resulting in "...parser.You can install..." instead of "...parser. You can install...". Signed-off-by: JiangNan <1394485448@qq.com>
The `partial` parameter was not being forwarded to the parent `super().parse_result()` call, causing partial parsing to not work correctly in PydanticOutputParser. Signed-off-by: JiangNan <1394485448@qq.com>
Merging this PR will not alter performance
|
Summary
xml.py: Adjacent string literals in twoImportErrormessages were missing spaces between them, resulting in concatenated words like "parser.You" and "defusedxml`See".partialparameter not forwarded inPydanticOutputParser.parse_result: Thepartialparameter was accepted but not passed tosuper().parse_result(), so partial parsing mode had no effect.Files Changed
libs/core/langchain_core/output_parsers/xml.py— Added trailing spaces to adjacent string literals in two error messageslibs/core/langchain_core/output_parsers/pydantic.py— Forwardpartial=partialtosuper().parse_result()Test plan
parse_resultnow respectspartial=Trueby forwarding to parent class