mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-27 17:08:47 +00:00
Update json.py
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
parent
aa8b4120a8
commit
cbe18057b0
@ -179,7 +179,7 @@ class SimpleJsonOutputParser(BaseCumulativeTransformOutputParser[Any]):
|
|||||||
def parse(self, text: str) -> Any:
|
def parse(self, text: str) -> Any:
|
||||||
text = text.strip()
|
text = text.strip()
|
||||||
try:
|
try:
|
||||||
return parse_json_markdown(text.strip(), parse_partial_json)
|
return parse_json_markdown(text.strip(), parser=parse_partial_json)
|
||||||
except JSONDecodeError as e:
|
except JSONDecodeError as e:
|
||||||
raise OutputParserException(f"Invalid json output: {text}") from e
|
raise OutputParserException(f"Invalid json output: {text}") from e
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user