feat: add system param: SAMPLE_DATA_ENABLED

This commit is contained in:
ulleo
2026-09-15 11:46:16 +08:00
parent c705bafb13
commit 0b5588b5bf
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -555,7 +555,7 @@ class LLMService:
keywords=keywords)
# Get sample data for all tables
if not self.out_ds_instance:
if not self.out_ds_instance and settings.SAMPLE_DATA_ENABLED:
self.chat_question.sample_data = get_tables_sample_data(
session=_session,
current_user=self.current_user,
+2
View File
@@ -130,6 +130,7 @@ class Settings(BaseSettings):
TABLE_EMBEDDING_COUNT: int = 10
TABLE_EMBEDDING_ALPHA: float = 0.4 # weight for vector score; (1-alpha) is keyword weight
TABLE_EMBEDDING_KEYWORD_ENABLED: bool = True
SAMPLE_DATA_ENABLED: bool = True # 是否获取表示例数据,关闭可提升响应速度
DS_EMBEDDING_COUNT: int = 10
ORACLE_CLIENT_PATH: str = '/opt/sqlbot/db_client/oracle_instant_client'
@@ -141,6 +142,7 @@ class Settings(BaseSettings):
'PG_POOL_PRE_PING',
'TABLE_EMBEDDING_ENABLED',
'TABLE_EMBEDDING_KEYWORD_ENABLED',
'SAMPLE_DATA_ENABLED',
mode='before')
@classmethod
def lowercase_bool(cls, v: Any) -> Any: