Future-House / paper-qa

High accuracy RAG for answering questions from scientific documents with citations
Apache License 2.0
6.44k stars 618 forks source link

Cleaned and clarified deferred embeddings code #597

Closed jamesbraza closed 1 month ago

jamesbraza commented 1 month ago

https://github.com/Future-House/paper-qa/pull/289 changed the logic of add_texts such that the retrying logic of OpenAI rate limits is no longer relevant. Other comments were stale too, so this PR just cleans them up

jamesbraza commented 1 month ago

should probably add a better unit test to call query, then add a few more, then call query again to get coverage of mixed to_embed != self.texts But can wait until future for that

@whitead this was actually somewhat hard to test (which is a good sign) because our API has so many checks in place for this. That being said, I have written a test test_partly_embedded_texts that fails on main and passes here. Cheers 🥳