diff --git a/stubs/hnswlib/hnswlib.pyi b/stubs/hnswlib/hnswlib.pyi index 4a84d55d99f8..cb52fd7fbee7 100644 --- a/stubs/hnswlib/hnswlib.pyi +++ b/stubs/hnswlib/hnswlib.pyi @@ -25,13 +25,15 @@ class Index: def get_ids_list(self) -> list[int]: ... @overload - def get_items(self, ids: ArrayLike | None = ..., return_type: Literal["list"] = ...) -> list[float]: ... + def get_items(self, ids: ArrayLike | None = None, return_type: Literal["numpy"] = "numpy") -> NDArray[np.float32]: ... @overload - def get_items(self, ids: ArrayLike | None = ..., return_type: Literal["numpy"] = ...) -> NDArray[np.float32]: ... + def get_items(self, ids: ArrayLike | None, return_type: Literal["list"]) -> list[list[float]]: ... + @overload + def get_items(self, ids: ArrayLike | None = None, *, return_type: Literal["list"]) -> list[list[float]]: ... @overload def get_items( self, ids: ArrayLike | None = None, return_type: Literal["numpy", "list"] = "numpy" - ) -> NDArray[np.float32] | list[float]: ... + ) -> NDArray[np.float32] | list[list[float]]: ... def get_max_elements(self) -> int: ... def index_file_size(self) -> int: ...