chore: Roll back json parsing code (#637)

See
[here](https://github.com/eosphoros-ai/DB-GPT/pull/626#discussion_r1336569182)
This commit is contained in:
Aries-ckt 2023-09-28 14:48:58 +08:00 committed by GitHub
commit 48aa8b8c85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,9 +21,9 @@ class ChatDashboardOutputParser(BaseOutputParser):
super().__init__(sep=sep, is_stream_out=is_stream_out)
def parse_prompt_response(self, model_out_text):
# clean_str = super().parse_prompt_response(model_out_text)
print("clean prompt response:", model_out_text)
response = json.loads(model_out_text)
clean_str = super().parse_prompt_response(model_out_text)
print("clean prompt response:", clean_str)
response = json.loads(clean_str)
chart_items: List[ChartItem] = []
if not isinstance(response, list):
response = [response]