diff --git a/packages/ragbits-common/src/ragbits/common/py.typed b/packages/ragbits-common/src/ragbits/py.typed similarity index 100% rename from packages/ragbits-common/src/ragbits/common/py.typed rename to packages/ragbits-common/src/ragbits/py.typed diff --git a/packages/ragbits-dev-kit/src/ragbits/dev_kit/app/main.py b/packages/ragbits-dev-kit/src/ragbits/dev_kit/app/main.py index 8c21e259..ff5ea90c 100644 --- a/packages/ragbits-dev-kit/src/ragbits/dev_kit/app/main.py +++ b/packages/ragbits-dev-kit/src/ragbits/dev_kit/app/main.py @@ -5,10 +5,10 @@ import jinja2 import typer from pydantic import BaseModel -from ragbits.dev_kit.discovery.prompt_discovery import PromptDiscovery from ragbits.common.llms import LiteLLM from ragbits.common.llms.clients import LiteLLMOptions +from ragbits.dev_kit.discovery.prompt_discovery import PromptDiscovery class PromptState: diff --git a/packages/ragbits-document-search/src/ragbits/document_search/py.typed b/packages/ragbits-dev-kit/src/ragbits/py.typed similarity index 100% rename from packages/ragbits-document-search/src/ragbits/document_search/py.typed rename to packages/ragbits-dev-kit/src/ragbits/py.typed diff --git a/packages/ragbits-document-search/examples/simple_text.py b/packages/ragbits-document-search/examples/simple_text.py index ec18092f..db559913 100644 --- a/packages/ragbits-document-search/examples/simple_text.py +++ b/packages/ragbits-document-search/examples/simple_text.py @@ -1,11 +1,10 @@ import asyncio +from ragbits.common.embeddings.litellm import LiteLLMEmbeddings from ragbits.document_search import DocumentSearch from ragbits.document_search.documents.document import DocumentMeta from ragbits.document_search.vector_store.in_memory import InMemoryVectorStore -from ragbits.common.embeddings.litellm import LiteLLMEmbeddings - documents = [ DocumentMeta.create_text_document_from_literal("RIP boiled water. You will be mist."), DocumentMeta.create_text_document_from_literal( diff --git a/packages/ragbits-document-search/src/ragbits/document_search/_main.py b/packages/ragbits-document-search/src/ragbits/document_search/_main.py index 2817b495..0d47c853 100644 --- a/packages/ragbits-document-search/src/ragbits/document_search/_main.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/_main.py @@ -1,3 +1,4 @@ +from ragbits.common.embeddings.base import Embeddings from ragbits.document_search.documents.document import DocumentMeta from ragbits.document_search.documents.element import Element from ragbits.document_search.ingestion.document_processor import DocumentProcessor @@ -7,8 +8,6 @@ from ragbits.document_search.retrieval.rerankers.noop import NoopReranker from ragbits.document_search.vector_store.base import VectorStore -from ragbits.common.embeddings.base import Embeddings - class DocumentSearch: """ diff --git a/packages/ragbits-document-search/src/ragbits/document_search/documents/document.py b/packages/ragbits-document-search/src/ragbits/document_search/documents/document.py index 90ad62ec..8469d8eb 100644 --- a/packages/ragbits-document-search/src/ragbits/document_search/documents/document.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/documents/document.py @@ -4,6 +4,7 @@ from typing import Union from pydantic import BaseModel, Field + from ragbits.document_search.documents.sources import LocalFileSource diff --git a/packages/ragbits-document-search/src/ragbits/document_search/documents/element.py b/packages/ragbits-document-search/src/ragbits/document_search/documents/element.py index faef6e98..3c02daeb 100644 --- a/packages/ragbits-document-search/src/ragbits/document_search/documents/element.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/documents/element.py @@ -2,6 +2,7 @@ from typing import ClassVar from pydantic import BaseModel + from ragbits.document_search.documents.document import DocumentMeta from ragbits.document_search.vector_store.base import VectorDBEntry @@ -26,7 +27,7 @@ def get_key(self) -> str: """ @classmethod - def __pydantic_init_subclass__(cls, **kwargs): # pylint: disable=unused-argument + def __pydantic_init_subclass__(cls, **kwargs: dict) -> None: # pylint: disable=unused-argument element_type_default = cls.model_fields["element_type"].default if element_type_default is None: diff --git a/packages/ragbits-document-search/src/ragbits/document_search/vector_store/in_memory.py b/packages/ragbits-document-search/src/ragbits/document_search/vector_store/in_memory.py index 9f8a98b2..4d9e6fd0 100644 --- a/packages/ragbits-document-search/src/ragbits/document_search/vector_store/in_memory.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/vector_store/in_memory.py @@ -1,4 +1,5 @@ import numpy as np + from ragbits.document_search.vector_store.base import VectorDBEntry, VectorStore @@ -7,8 +8,8 @@ class InMemoryVectorStore(VectorStore): A simple in-memory implementation of Vector Store, storing vectors in memory. """ - def __init__(self): - self._storage = {} + def __init__(self) -> None: + self._storage: dict[str, VectorDBEntry] = {} async def store(self, entries: list[VectorDBEntry]) -> None: """ diff --git a/packages/ragbits-document-search/src/ragbits/py.typed b/packages/ragbits-document-search/src/ragbits/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/pyproject.toml b/pyproject.toml index d163c0c0..8221a0e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,7 +81,12 @@ warn_unused_ignores = false show_error_codes = true check_untyped_defs = true no_implicit_optional = true -mypy_path = ['packages'] +explicit_package_bases = true +mypy_path = [ + 'packages/ragbits-common/src', + 'packages/ragbits-dev-kit/src', + 'packages/ragbits-document-search/src', +] [[tool.mypy.overrides]] module = "ragbits.*"