mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
5f17c57174
Currently `ChatOutputParser` extracts actions by splitting the text on "```", and then load the second part as a json string. But sometimes the LLM will wrap the action in markdown code block like: ````markdown ```json { "action": "foo", "action_input": "bar" } ``` ```` Splitting text on "```" will cause `OutputParserException` in such case. This PR changes the behaviour to extract the `$JSON_BLOB` by regex, so that it can handle both ` ``` ``` ` and ` ```json ``` ` @hinthornw --------- Co-authored-by: Junlin Zhou <jlzhou@zjuici.com> |
||
---|---|---|
.. | ||
agents | ||
callbacks | ||
chains | ||
chat_models | ||
client | ||
data | ||
docstore | ||
document_loaders | ||
evaluation | ||
examples | ||
llms | ||
load | ||
memory | ||
output_parsers | ||
prompts | ||
retrievers | ||
tools | ||
utilities | ||
vectorstores | ||
__init__.py | ||
conftest.py | ||
test_bash.py | ||
test_cache.py | ||
test_dependencies.py | ||
test_document_transformers.py | ||
test_formatting.py | ||
test_math_utils.py | ||
test_pytest_config.py | ||
test_python.py | ||
test_schema.py | ||
test_sql_database_schema.py | ||
test_sql_database.py | ||
test_sqlalchemy.py | ||
test_text_splitter.py | ||
test_utils.py |