Skip to content

Conversation

ThomasRochefortB
Copy link
Contributor

This PR converts the VectorStore.add_texts_and_embeddings functions to async as discussed in #776

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Dec 23, 2024
@jamesbraza
Copy link
Collaborator

Thanks for doing this @ThomasRochefortB, I triggered CI for this. Please forgive us for the bad contributor experience at the moment

That being said, locally testing your code I still get this error:

paperqa/docs.py: note: In member "_build_texts_index" of class "Docs":
paperqa/docs.py:519:9: error: Value of type "Coroutine[Any, Any, None]" must be
used  [unused-coroutine]
            self.texts_index.add_texts_and_embeddings(texts)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paperqa/docs.py:519:9: note: Are you missing an await?

Can you add an await there in Docs._build_texts_index?

@ThomasRochefortB
Copy link
Contributor Author

ThomasRochefortB commented Dec 30, 2024

@jamesbraza I have added the appopriate await in docs.py. The following pytest now passes:

pytest "tests/test_paperqa.py::test_docs_with_custom_embedding[QdrantVectorStore]"

I'll tackle the linting issues next.

@jamesbraza
Copy link
Collaborator

Nice work here, thanks.

Let's leave other mypy stuff to #770.

Merging now

@jamesbraza jamesbraza merged commit 525bb32 into Future-House:main Dec 30, 2024
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants