diff --git a/packages/dbgpt-app/src/dbgpt_app/scene/chat_db/professional_qa/chat.py b/packages/dbgpt-app/src/dbgpt_app/scene/chat_db/professional_qa/chat.py index 13f77fb4c..28529ba7b 100644 --- a/packages/dbgpt-app/src/dbgpt_app/scene/chat_db/professional_qa/chat.py +++ b/packages/dbgpt-app/src/dbgpt_app/scene/chat_db/professional_qa/chat.py @@ -38,9 +38,7 @@ class ChatWithDbQA(BaseChat): if self.database.is_graph_type(): # When the current graph database retrieves source data from ChatDB, the # topk uses the sum of node table and edge table. - self.top_k = len(self.tables["vertex_tables"]) + len( - self.tables["edge_tables"] - ) + self.top_k = len(list(self.tables)) else: logger.info(f"Dialect: {self.database.db_type}") self.top_k = self.curr_config.schema_retrieve_top_k