voyageai-python icon indicating copy to clipboard operation
voyageai-python copied to clipboard

Incorrect Library Interface

Open npip99 opened this issue 1 year ago • 0 comments

I'm currently getting this warning when trying to import AsyncClient from voyageai.

Screenshot 2025-01-12 at 1 04 06 AM

This is because https://github.com/voyage-ai/voyageai-python/blob/012d16bd708c797766beb26555e56b10db8d09fd/voyageai/init.py#L25C35-L25C46 isn't following PEP 561 correctly. More details here.


Using __all__ to specify the exports would fix this. (e.g., here are OpenAI's exports: https://github.com/openai/openai-python/blob/33e40854beef0cb18c0790bea953678c30b6fb5c/src/openai/init.py#L37-L78)

Alternatively, from voyageai.client_async import AsyncClient as AsyncClient would also work (Analogous to https://github.com/openai/openai-python/blob/33e40854beef0cb18c0790bea953678c30b6fb5c/src/openai/init.py#L81-L82).

Same for all of the other imports in __init__.py.

npip99 avatar Jan 12 '25 09:01 npip99