mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: Vector retrieval matches tables
This commit is contained in:
@@ -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')) + '}'}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user