m-ahmad-official commited on
Commit
09b3403
·
1 Parent(s): c1388f2
Files changed (1) hide show
  1. retrieve.py +2 -7
retrieve.py CHANGED
@@ -43,16 +43,11 @@ def search(
43
  try:
44
  # First try: if embeddings is directly a list of embeddings
45
  if isinstance(embedding_response.embeddings, list):
46
- query_embedding = embedding_response.embeddings[0]
47
  else:
48
  # Convert to list if it's an iterable object
49
  embeddings_list = [e for e in embedding_response.embeddings]
50
- query_embedding = embeddings_list[0]
51
- except (TypeError, IndexError) as e:
52
- logger.error(f"Failed to extract embedding: {type(e).__name__}: {e}")
53
- raise
54
-
55
- logger.debug(f"Generated embedding dimension: {len(query_embedding)}")
56
 
57
  # Search in Qdrant
58
  logger.info(f"Searching Qdrant collection: {collection_name}")
 
43
  try:
44
  # First try: if embeddings is directly a list of embeddings
45
  if isinstance(embedding_response.embeddings, list):
46
+ query_embedding = list(embedding_response.embeddings[0])
47
  else:
48
  # Convert to list if it's an iterable object
49
  embeddings_list = [e for e in embedding_response.embeddings]
50
+ query_embedding = list(embeddings_list[0])
 
 
 
 
 
51
 
52
  # Search in Qdrant
53
  logger.info(f"Searching Qdrant collection: {collection_name}")