Skip to content

Feature: Add Python type stubs (.pyi) for IDE autocomplete and type checking #93

@zTgx

Description

@zTgx

Description

The Python SDK is implemented in Rust via PyO3, which means Python IDEs and type checkers (mypy, pyright) cannot infer types from source. Without type stubs, users get no autocomplete, no type hints, and no static analysis for vectorless APIs.

Current State

  • No vectorless/py.typed marker file
  • No .pyi stub files
  • Docstrings exist but are insufficient for type inference

Expected Behavior

Add a vectorless/__init__.pyi (or vectorless/py.typed + inline stubs) with proper type annotations:

# vectorless/__init__.pyi
class Engine:
    def __init__(self, *, api_key: str | None = ..., model: str | None = ..., 
                 endpoint: str | None = ..., config: Config | None = ...): ...
    async def index(self, ctx: IndexContext) -> IndexResult: ...
    async def query(self, ctx: QueryContext) -> QueryResult: ...
    async def list(self) -> list[DocumentInfo]: ...
    async def remove(self, doc_id: str) -> bool: ...
    async def get_graph(self) -> DocumentGraph | None: ...

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