From 4c2a033eecb43cebc856ffe1fb4bf746f92a7085 Mon Sep 17 00:00:00 2001 From: yhjun1026 <460342015@qq.com> Date: Fri, 10 Nov 2023 18:06:19 +0800 Subject: [PATCH] feat(ChatExcel): ChatExcel Use AntV Chart 1.Native Support AntvChart --- pilot/base_modules/agent/commands/command_mange.py | 6 +++--- pilot/scene/chat_data/chat_excel/excel_analyze/chat.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pilot/base_modules/agent/commands/command_mange.py b/pilot/base_modules/agent/commands/command_mange.py index c1e9a5c4f..ab5a00fc2 100644 --- a/pilot/base_modules/agent/commands/command_mange.py +++ b/pilot/base_modules/agent/commands/command_mange.py @@ -274,7 +274,7 @@ class ApiCall: ) if Status.FAILED.value == api_status.status: all_context = all_context.replace( - api_context, "\n" + api_status.err_msg + self.to_view_antv_vis(api_status) + api_context, f'\nError:{api_status.err_msg}\n' + self.to_view_antv_vis(api_status) ) else: all_context = all_context.replace( @@ -367,14 +367,14 @@ class ApiCall: if api_status.name: param["type"] = api_status.name if api_status.args: - param["sql"] = api_status.args["sql"].replace(',', '\\,') + param["sql"] = api_status.args["sql"] if api_status.err_msg: param["err_msg"] = api_status.err_msg if api_status.api_result: param["data"] = api_status.api_result - return json.dumps(param, default=serialize, ensure_ascii=False) + return json.dumps(param, default=serialize, ensure_ascii=False, separators=(',', ':')) def run(self, llm_text): if self.__is_need_wait_plugin_call(llm_text): diff --git a/pilot/scene/chat_data/chat_excel/excel_analyze/chat.py b/pilot/scene/chat_data/chat_excel/excel_analyze/chat.py index a2cf586f1..d0096878c 100644 --- a/pilot/scene/chat_data/chat_excel/excel_analyze/chat.py +++ b/pilot/scene/chat_data/chat_excel/excel_analyze/chat.py @@ -104,6 +104,6 @@ class ChatExcel(BaseChat): with root_tracer.start_span( "ChatExcel.stream_plugin_call.run_display_sql", metadata={"text": text} ): - return self.api_call.run_display_sql( + return self.api_call.display_sql_llmvis( text, self.excel_reader.get_df_by_sql_ex )