Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/apps/chat/task/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ def select_datasource(self):
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')) + '}'}
Expand Down
4 changes: 2 additions & 2 deletions backend/apps/system/crud/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def get_db_schema(self, ds_id: int, question: str, embedding: bool = True) -> st
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:
Expand Down
2 changes: 1 addition & 1 deletion backend/common/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn | str:
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


Expand Down