Skip to content

Incorrect Library Interface #20

@npip99

Description

@npip99

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions