Improve missing-vector warning logic in vector similarity
- Check for any missing vectors - Separate no-vector vs partial-vector warnings - Ensure early return on empty vectors
This commit is contained in:
parent
5c7ae8721b
commit
a11e8d77eb
1 changed files with 9 additions and 4 deletions
|
|
@ -1713,10 +1713,15 @@ async def vector_similarity_sorting(
|
|||
f"Vector similarity chunk selection: {len(chunk_vectors)} chunk vectors Retrieved"
|
||||
)
|
||||
|
||||
if not chunk_vectors:
|
||||
logger.warning(
|
||||
"Vector similarity chunk selection: no vectors retrieved from chunks_vdb"
|
||||
)
|
||||
if not chunk_vectors or len(chunk_vectors) != len(all_chunk_ids):
|
||||
if not chunk_vectors:
|
||||
logger.warning(
|
||||
"Vector similarity chunk selection: no vectors retrieved from chunks_vdb"
|
||||
)
|
||||
else:
|
||||
logger.warning(
|
||||
f"Vector similarity chunk selection: found {len(chunk_vectors)} but expecting {len(all_chunk_ids)}"
|
||||
)
|
||||
return []
|
||||
|
||||
# Calculate cosine similarities
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue