Future-House / paper-qa

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

Fixes `gather_with_concurrency` typing #714

Open maykcaldas opened 1 day ago

maykcaldas commented 1 day ago

Changes the type hint of gather_with_concurrency from

gather_with_concurrency(n: int, coros: list[Coroutine]) -> list[Any]:

to

T = TypeVar("T")
async def gather_with_concurrency(n: int, coros: Iterable[Awaitable[T]]) -> list[T]:

~Also pinned pydantic version to <2.10 until they release the v2.10 bugfix.~