feat(datasource): Support reasoning for ChatDashboard (#2401)

This commit is contained in:
Fangyin Cheng
2025-03-06 15:16:08 +08:00
committed by GitHub
parent 3bd75d8de2
commit bfd7fe8888
65 changed files with 391 additions and 216 deletions

View File

@@ -106,9 +106,13 @@ class DBSummaryClient:
)
if not table_vector_connector.vector_name_exists():
from dbgpt_ext.rag.assembler.db_schema import DBSchemaAssembler
from dbgpt_ext.rag.summary.rdbms_db_summary import _DEFAULT_COLUMN_SEPARATOR
chunk_parameters = ChunkParameters(
text_splitter=RDBTextSplitter(separator="--table-field-separator--")
text_splitter=RDBTextSplitter(
column_separator=_DEFAULT_COLUMN_SEPARATOR,
separator="--table-field-separator--",
)
)
db_assembler = DBSchemaAssembler.load_from_connection(
connector=db_summary_client.db,

View File

@@ -59,7 +59,7 @@ class VectorStoreConnector:
self.app_config = self._system_app.config.configs.get("app_config")
self._register()
vector_store_type = self.__rewrite_index_store_type(vector_store_type)
vector_store_type = self._rewrite_index_store_type(vector_store_type)
if self._match(vector_store_type):
self.connector_class, self.config_class = connector[vector_store_type]
else:
@@ -94,11 +94,16 @@ class VectorStoreConnector:
logger.error("connect vector store failed: %s", e)
raise e
def __rewrite_index_store_type(self, index_store_type):
def _rewrite_index_store_type(self, index_store_type):
# Rewrite Knowledge Graph Type
if self.app_config.rag.storage.graph.get("enable_summary").lower() == "true":
if index_store_type == "KnowledgeGraph":
return "CommunitySummaryKnowledgeGraph"
if self.app_config.rag.storage.graph:
graph_dict = self.app_config.rag.storage.graph
if (
isinstance(graph_dict, dict)
and graph_dict.get("enable_summary", "false").lower() == "true"
):
if index_store_type == "KnowledgeGraph":
return "CommunitySummaryKnowledgeGraph"
return index_store_type
@classmethod