From 73b3b7069f02e0bc51b96ea93bc9f9fb3e36ae61 Mon Sep 17 00:00:00 2001 From: yhjun1026 Date: Thu, 13 Jul 2023 10:19:33 +0800 Subject: [PATCH] WEB API independent --- pilot/scene/chat_dashboard/prompt.py | 3 ++- pilot/scene/chat_db/auto_execute/chat.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pilot/scene/chat_dashboard/prompt.py b/pilot/scene/chat_dashboard/prompt.py index ae73c5825..b339d6334 100644 --- a/pilot/scene/chat_dashboard/prompt.py +++ b/pilot/scene/chat_dashboard/prompt.py @@ -23,10 +23,11 @@ According to the characteristics of the analyzed data, choose the most suitable {supported_chat_type} Pay attention to the length of the output content of the analysis result, do not exceed 4000tokens +Do not use unprovided fields and field value in data analysis SQL, Do not use column pay_status as a query condition in SQL. + According to the characteristics of the analyzed data, choose the best one from the charts provided below to display, use different types of charts as much as possible,chart types: {supported_chat_type} -Do not use unprovided fields and field value in data analysis SQL. Give {dialect} data analysis SQL, analysis title, display method and analytical thinking,respond in the following json format: {response} Ensure the response is correct json and can be parsed by Python json.loads diff --git a/pilot/scene/chat_db/auto_execute/chat.py b/pilot/scene/chat_db/auto_execute/chat.py index 9f5f919a2..8ed726a16 100644 --- a/pilot/scene/chat_db/auto_execute/chat.py +++ b/pilot/scene/chat_db/auto_execute/chat.py @@ -48,8 +48,8 @@ class ChatWithDbAutoExecute(BaseChat): "input": self.current_user_input, "top_k": str(self.top_k), "dialect": self.database.dialect, - "table_info": self.database.table_simple_info(self.db_connect) - # "table_info": client.get_similar_tables(dbname=self.db_name, query=self.current_user_input, topk=self.top_k) + # "table_info": self.database.table_simple_info(self.db_connect) + "table_info": client.get_similar_tables(dbname=self.db_name, query=self.current_user_input, topk=self.top_k) } return input_values