[Python] Code is unreachable pylance in VS code for my function but it should be reachable as...

Discussão em 'Python' iniciado por Stack, Abril 18, 2025.

  1. Stack

    Stack Membro Participativo

    Code is unreachable pylance in vs code from "query_vector.." to "return list...." in the given method.

    def search_similar_chunks(user_query):
    embedding_response = client.embeddings.create(
    input=[user_query],
    model=os.getenv("EMBED_MODEL")
    )
    query_vector = embedding_response.data[0].embedding

    pipeline = [
    {
    "$vectorSearch": {
    "queryVector": query_vector,
    "path": "application_details_embedding",
    "numCandidates": 100,
    "limit": 5,
    "index": "test_vector_index"
    }
    }
    ]
    return list(embedding_collection.aggregate(pipeline))

    Continue reading...

Compartilhe esta Página