Handling JSONDecodeError; Invalid /escape in JsonOutputParser #26655
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Ɑ: core
Related to langchain-core
investigate
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
File "langchain_core\output_parsers\json.py", line 87, in parse_result
raise OutputParserException(msg, llm_output=text) from e
langchain_core.exceptions.OutputParserException: Invalid json output: {'response': "The user question does not align with the structure or data within our database tables. The tables are relational in terms and follow the naming convention of 'galvatron' or'mac_', however the user question appears unrelated to the type of data and structure of the tables."}
Description
I'm not entirely sure if it is a bug. I found it really strange that when string contains escape character we have such an issue. We can resolve the issue by dumping it to JSON first.
System Info
System Information
Package Information
The text was updated successfully, but these errors were encountered: