Skip to content

Commit cc07624

Browse files
committed
feat: Vector retrieval matches tables
1 parent 090df35 commit cc07624

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend/apps/datasource/crud/table.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import List
55

66
from sqlalchemy import and_, select, update
7+
from sqlalchemy.orm.session import Session
78

89
from apps.ai_model.embedding import EmbeddingModelCache
910
from common.core.config import settings
@@ -30,18 +31,19 @@ def update_table(session: SessionDep, item: CoreTable):
3031
session.commit()
3132

3233

33-
def run_fill_empty_table_embedding(session: SessionDep):
34+
def run_fill_empty_table_embedding(session: Session):
3435
if not settings.EMBEDDING_ENABLED:
3536
return
3637

38+
SQLBotLogUtil.info('get tables')
3739
stmt = select(CoreTable.id).where(and_(CoreTable.embedding.is_(None)))
3840
results = session.execute(stmt).scalars().all()
3941
SQLBotLogUtil.info(json.dumps(results))
4042

4143
save_table_embedding(session, results)
4244

4345

44-
def save_table_embedding(session: SessionDep, ids: List[int]):
46+
def save_table_embedding(session: Session, ids: List[int]):
4547
if not settings.EMBEDDING_ENABLED:
4648
return
4749

0 commit comments

Comments
 (0)