[Python] VoyageAI Client embedding functionality makes infinite request

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

  1. Stack

    Stack Membro Participativo

    so im trying to build RAG Searcher, so recently (yesterday) everything worked, i made search request to db, and it gave me response. But today, i wanted to add some changes and everything stopped work, its just infinity loop which doesn't give anything.

    Log example: 2025-04-08 13:51:28,189 [INFO]: Creating embeddings for text: how to find ssrf

    If i try to recreate Docker again, with --no-cache, ill just get other error:

    raise error.ServiceUnavailableError(
    voyageai.error.ServiceUnavailableError: The server is overloaded or not ready yet.


    Because the embedding still continues to work in thread...

    I tried to use git to checkout to commits that worked, but it didn't helped. Here is a code:

    @app.get("/search")
    @jinja.page("search_items.jinja2")
    async def search(
    term: str,
    page: int = Query(1, ge=1),
    page_size: int = Query(20, ge=1, le=100),
    db=Depends(get_db),
    client=Depends(voyageai_client),
    ) -> Dict:
    question_embedding = embed(client, term)

    def embed(client, text):
    log.info("Creating embeddings for text: %s", text)
    embedding = client.embed([text], model="voyage-3-lite")
    return embedding.embeddings[0]


    If you need the commit after which its stopped worked here it is: https://pastebin.com/RVQze1hV

    Also i added some UI, like footer, blog page, redesign of searching page, but im think its not the reason. Ask if you need more information...

    Continue reading...

Compartilhe esta Página