fix plugin mode bug;Optimize the parsing logic for model response

This commit is contained in:
yhjun1026
2023-06-13 22:38:10 +08:00
parent 30ecd9f005
commit 449515fe13

View File

@@ -155,7 +155,7 @@ class BaseOutputParser(ABC):
cleaned_output = cleaned_output[: -len("```")]
cleaned_output = cleaned_output.strip()
if not cleaned_output.startswith("{") or not cleaned_output.endswith("}"):
logger.info("illegal json processing")
logger.info("illegal json processing:\n" + cleaned_output)
cleaned_output = self.__extract_json(cleaned_output)
cleaned_output = (
cleaned_output.strip()