Skip to content

Commit 2ebac00

Browse files
committed
feat: Vector retrieval matches tables
1 parent 009a1ba commit 2ebac00

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

backend/apps/chat/task/llm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ def select_datasource(self):
419419
full_thinking_text = ''
420420
full_text = ''
421421
if not ignore_auto_select:
422-
if settings.TABLE_EMBEDDING_ENABLED:
422+
if settings.TABLE_EMBEDDING_ENABLED and (
423+
not self.current_assistant or (self.current_assistant and self.current_assistant.type != 1)):
423424
ds = get_ds_embedding(self.session, self.current_user, _ds_list, self.out_ds_instance,
424425
self.chat_question.question, self.current_assistant)
425426
yield {'content': '{"id":' + str(ds.get('id')) + '}'}

backend/apps/system/crud/assistant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ def get_db_schema(self, ds_id: int, question: str, embedding: bool = True) -> st
173173
tables.append(t_obj)
174174

175175
# do table embedding
176-
if embedding and tables and settings.TABLE_EMBEDDING_ENABLED:
177-
tables = get_table_embedding(tables, question)
176+
# if embedding and tables and settings.TABLE_EMBEDDING_ENABLED:
177+
# tables = get_table_embedding(tables, question)
178178

179179
if tables:
180180
for s in tables:

backend/common/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn | str:
105105
PG_POOL_RECYCLE: int = 3600
106106
PG_POOL_PRE_PING: bool = True
107107

108-
TABLE_EMBEDDING_ENABLED: bool = False
108+
TABLE_EMBEDDING_ENABLED: bool = True
109109
TABLE_EMBEDDING_COUNT: int = 10
110110

111111

0 commit comments

Comments
 (0)