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:
@@ -145,7 +145,7 @@ async def stream_sql(session: SessionDep, current_user: CurrentUser, request_que
|
||||
"""
|
||||
|
||||
try:
|
||||
llm_service = await LLMService.create(current_user, request_question, current_assistant)
|
||||
llm_service = await LLMService.create(current_user, request_question, current_assistant, embedding=True)
|
||||
llm_service.init_record()
|
||||
llm_service.run_task_async()
|
||||
except Exception as e:
|
||||
|
||||
@@ -85,7 +85,7 @@ class LLMService:
|
||||
|
||||
def __init__(self, current_user: CurrentUser, chat_question: ChatQuestion,
|
||||
current_assistant: Optional[CurrentAssistant] = None, no_reasoning: bool = False,
|
||||
config: LLMConfig = None):
|
||||
embedding: bool = False, config: LLMConfig = None):
|
||||
self.chunk_list = []
|
||||
# engine = create_engine(str(settings.SQLALCHEMY_DATABASE_URI))
|
||||
# session_maker = sessionmaker(bind=engine)
|
||||
@@ -115,7 +115,7 @@ class LLMService:
|
||||
raise SingleMessageError("No available datasource configuration found")
|
||||
chat_question.engine = (ds.type_name if ds.type != 'excel' else 'PostgreSQL') + get_version(ds)
|
||||
chat_question.db_schema = get_table_schema(session=self.session, current_user=current_user, ds=ds,
|
||||
question=chat_question.question)
|
||||
question=chat_question.question, embedding=embedding)
|
||||
|
||||
self.generate_sql_logs = list_generate_sql_logs(session=self.session, chart_id=chat_id)
|
||||
self.generate_chart_logs = list_generate_chart_logs(session=self.session, chart_id=chat_id)
|
||||
|
||||
Reference in New Issue
Block a user