Skip to content

Commit

Permalink
remove bindparams
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Dec 28, 2024
1 parent 2f6acf8 commit 04cd8c8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions api/core/rag/datasource/vdb/tidb_vector/tidb_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import sqlalchemy
from pydantic import BaseModel, model_validator
from sqlalchemy import JSON, TEXT, Column, DateTime, Float, Integer, String, Table, bindparam, create_engine, insert
from sqlalchemy import JSON, TEXT, Column, DateTime, String, Table, create_engine, insert
from sqlalchemy import text as sql_text
from sqlalchemy.orm import Session, declarative_base

Expand Down Expand Up @@ -216,11 +216,7 @@ def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Doc
WHERE distance <= :distance
ORDER BY distance ASC
LIMIT :top_k
""").bindparams(
bindparam("query_vector_str", type_=String),
bindparam("distance", type_=Float),
bindparam("top_k", type_=Integer),
)
""")
res = session.execute(
select_statement,
params={
Expand Down

0 comments on commit 04cd8c8

Please # to comment.