mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-10 22:43:29 +00:00
chore: remove unused helper function
This commit is contained in:
parent
40e80113ca
commit
4346605286
1 changed files with 0 additions and 23 deletions
|
|
@ -47,29 +47,6 @@ log = logging.getLogger(__name__)
|
|||
router = APIRouter()
|
||||
|
||||
|
||||
############################
|
||||
# Helper Functions
|
||||
############################
|
||||
|
||||
def check_duplicate_in_vector_db(collection_name: str, file_hash: str) -> bool:
|
||||
"""Check if a file with the given hash already exists in the vector DB."""
|
||||
if not file_hash or not collection_name:
|
||||
return False
|
||||
|
||||
try:
|
||||
result = VECTOR_DB_CLIENT.query(
|
||||
collection_name=collection_name,
|
||||
filter={"hash": file_hash},
|
||||
)
|
||||
|
||||
if result is not None and result.ids and result.ids[0]:
|
||||
return True
|
||||
except Exception as e:
|
||||
log.debug(f"Error checking duplicate in vector DB: {e}")
|
||||
|
||||
return False
|
||||
|
||||
|
||||
############################
|
||||
# Response Models
|
||||
############################
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue