feat: Vector retrieval matches tables

This commit is contained in:
junjun
2025-10-10 16:37:15 +08:00
committed by Junjun
parent 009a1ba84c
commit 2ebac00f87
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -419,7 +419,8 @@ class LLMService:
full_thinking_text = ''
full_text = ''
if not ignore_auto_select:
if settings.TABLE_EMBEDDING_ENABLED:
if settings.TABLE_EMBEDDING_ENABLED and (
not self.current_assistant or (self.current_assistant and self.current_assistant.type != 1)):
ds = get_ds_embedding(self.session, self.current_user, _ds_list, self.out_ds_instance,
self.chat_question.question, self.current_assistant)
yield {'content': '{"id":' + str(ds.get('id')) + '}'}
+2 -2
View File
@@ -173,8 +173,8 @@ class AssistantOutDs:
tables.append(t_obj)
# do table embedding
if embedding and tables and settings.TABLE_EMBEDDING_ENABLED:
tables = get_table_embedding(tables, question)
# if embedding and tables and settings.TABLE_EMBEDDING_ENABLED:
# tables = get_table_embedding(tables, question)
if tables:
for s in tables:
+1 -1
View File
@@ -105,7 +105,7 @@ class Settings(BaseSettings):
PG_POOL_RECYCLE: int = 3600
PG_POOL_PRE_PING: bool = True
TABLE_EMBEDDING_ENABLED: bool = False
TABLE_EMBEDDING_ENABLED: bool = True
TABLE_EMBEDDING_COUNT: int = 10