mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-29 05:10:56 +00:00
feat(ChatExcel): ChatExcel Use AntV Chart
1.Native Support AntvChart
This commit is contained in:
parent
bd7b6fc004
commit
4c2a033eec
@ -274,7 +274,7 @@ class ApiCall:
|
|||||||
)
|
)
|
||||||
if Status.FAILED.value == api_status.status:
|
if Status.FAILED.value == api_status.status:
|
||||||
all_context = all_context.replace(
|
all_context = all_context.replace(
|
||||||
api_context, "\n" + api_status.err_msg + self.to_view_antv_vis(api_status)
|
api_context, f'\n<span style="color:red">Error:</span>{api_status.err_msg}\n' + self.to_view_antv_vis(api_status)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
all_context = all_context.replace(
|
all_context = all_context.replace(
|
||||||
@ -367,14 +367,14 @@ class ApiCall:
|
|||||||
if api_status.name:
|
if api_status.name:
|
||||||
param["type"] = api_status.name
|
param["type"] = api_status.name
|
||||||
if api_status.args:
|
if api_status.args:
|
||||||
param["sql"] = api_status.args["sql"].replace(',', '\\,')
|
param["sql"] = api_status.args["sql"]
|
||||||
if api_status.err_msg:
|
if api_status.err_msg:
|
||||||
param["err_msg"] = api_status.err_msg
|
param["err_msg"] = api_status.err_msg
|
||||||
|
|
||||||
if api_status.api_result:
|
if api_status.api_result:
|
||||||
param["data"] = 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):
|
def run(self, llm_text):
|
||||||
if self.__is_need_wait_plugin_call(llm_text):
|
if self.__is_need_wait_plugin_call(llm_text):
|
||||||
|
@ -104,6 +104,6 @@ class ChatExcel(BaseChat):
|
|||||||
with root_tracer.start_span(
|
with root_tracer.start_span(
|
||||||
"ChatExcel.stream_plugin_call.run_display_sql", metadata={"text": text}
|
"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
|
text, self.excel_reader.get_df_by_sql_ex
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user