diff --git a/packages/ragbits-common/examples/llm_example.py b/packages/ragbits-common/examples/llm_example.py index 4a2c29bd..59d5d908 100644 --- a/packages/ragbits-common/examples/llm_example.py +++ b/packages/ragbits-common/examples/llm_example.py @@ -2,8 +2,8 @@ from pydantic import BaseModel -from ragbits_common.llms.litellm import LiteLLM -from ragbits_common.prompt import Prompt +from ragbits.common.llms.litellm import LiteLLM +from ragbits.common.prompt import Prompt class LoremPromptInput(BaseModel): diff --git a/packages/ragbits-common/examples/prompt_example.py b/packages/ragbits-common/examples/prompt_example.py index 70bcb5e1..c6ceff75 100644 --- a/packages/ragbits-common/examples/prompt_example.py +++ b/packages/ragbits-common/examples/prompt_example.py @@ -1,6 +1,6 @@ from pydantic import BaseModel -from ragbits_common.prompt import Prompt +from ragbits.common.prompt import Prompt class LoremPromptInput(BaseModel): diff --git a/packages/ragbits-common/setup.cfg b/packages/ragbits-common/setup.cfg index d92bc947..66cb32ad 100644 --- a/packages/ragbits-common/setup.cfg +++ b/packages/ragbits-common/setup.cfg @@ -22,7 +22,7 @@ classifiers = [options] package_dir= =src -packages=find: +packages=find_namespace: zip_safe = False platforms = any include_package_data = True diff --git a/packages/ragbits-common/src/ragbits_common/__init__.py b/packages/ragbits-common/src/ragbits/common/__init__.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/__init__.py rename to packages/ragbits-common/src/ragbits/common/__init__.py diff --git a/packages/ragbits-common/src/ragbits_common/embeddings/__init__.py b/packages/ragbits-common/src/ragbits/common/embeddings/__init__.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/embeddings/__init__.py rename to packages/ragbits-common/src/ragbits/common/embeddings/__init__.py diff --git a/packages/ragbits-common/src/ragbits_common/embeddings/base.py b/packages/ragbits-common/src/ragbits/common/embeddings/base.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/embeddings/base.py rename to packages/ragbits-common/src/ragbits/common/embeddings/base.py diff --git a/packages/ragbits-common/src/ragbits_common/embeddings/exceptions.py b/packages/ragbits-common/src/ragbits/common/embeddings/exceptions.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/embeddings/exceptions.py rename to packages/ragbits-common/src/ragbits/common/embeddings/exceptions.py diff --git a/packages/ragbits-common/src/ragbits_common/embeddings/litellm.py b/packages/ragbits-common/src/ragbits/common/embeddings/litellm.py similarity index 96% rename from packages/ragbits-common/src/ragbits_common/embeddings/litellm.py rename to packages/ragbits-common/src/ragbits/common/embeddings/litellm.py index 76014147..105bcd96 100644 --- a/packages/ragbits-common/src/ragbits_common/embeddings/litellm.py +++ b/packages/ragbits-common/src/ragbits/common/embeddings/litellm.py @@ -7,8 +7,8 @@ except ImportError: HAS_LITELLM = False -from ragbits_common.embeddings.base import Embeddings -from ragbits_common.embeddings.exceptions import EmbeddingConnectionError, EmbeddingResponseError, EmbeddingStatusError +from ragbits.common.embeddings.base import Embeddings +from ragbits.common.embeddings.exceptions import EmbeddingConnectionError, EmbeddingResponseError, EmbeddingStatusError class LiteLLMEmbeddings(Embeddings): diff --git a/packages/ragbits-common/src/ragbits_common/llms/__init__.py b/packages/ragbits-common/src/ragbits/common/llms/__init__.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/llms/__init__.py rename to packages/ragbits-common/src/ragbits/common/llms/__init__.py diff --git a/packages/ragbits-common/src/ragbits_common/llms/base.py b/packages/ragbits-common/src/ragbits/common/llms/base.py similarity index 98% rename from packages/ragbits-common/src/ragbits_common/llms/base.py rename to packages/ragbits-common/src/ragbits/common/llms/base.py index 2b628a3e..0ae021c2 100644 --- a/packages/ragbits-common/src/ragbits_common/llms/base.py +++ b/packages/ragbits-common/src/ragbits/common/llms/base.py @@ -2,7 +2,7 @@ from functools import cached_property from typing import Generic, Optional, Type, cast, overload -from ragbits_common.prompt.base import BasePrompt, BasePromptWithParser, OutputT +from ragbits.common.prompt.base import BasePrompt, BasePromptWithParser, OutputT from .clients.base import LLMClient, LLMClientOptions, LLMOptions diff --git a/packages/ragbits-common/src/ragbits_common/llms/clients/__init__.py b/packages/ragbits-common/src/ragbits/common/llms/clients/__init__.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/llms/clients/__init__.py rename to packages/ragbits-common/src/ragbits/common/llms/clients/__init__.py diff --git a/packages/ragbits-common/src/ragbits_common/llms/clients/base.py b/packages/ragbits-common/src/ragbits/common/llms/clients/base.py similarity index 98% rename from packages/ragbits-common/src/ragbits_common/llms/clients/base.py rename to packages/ragbits-common/src/ragbits/common/llms/clients/base.py index 2cbd3766..cdbbed9a 100644 --- a/packages/ragbits-common/src/ragbits_common/llms/clients/base.py +++ b/packages/ragbits-common/src/ragbits/common/llms/clients/base.py @@ -4,7 +4,7 @@ from pydantic import BaseModel -from ragbits_common.prompt import ChatFormat +from ragbits.common.prompt import ChatFormat from ..types import NotGiven diff --git a/packages/ragbits-common/src/ragbits_common/llms/clients/exceptions.py b/packages/ragbits-common/src/ragbits/common/llms/clients/exceptions.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/llms/clients/exceptions.py rename to packages/ragbits-common/src/ragbits/common/llms/clients/exceptions.py diff --git a/packages/ragbits-common/src/ragbits_common/llms/clients/litellm.py b/packages/ragbits-common/src/ragbits/common/llms/clients/litellm.py similarity index 99% rename from packages/ragbits-common/src/ragbits_common/llms/clients/litellm.py rename to packages/ragbits-common/src/ragbits/common/llms/clients/litellm.py index 30ff43ca..751e7dde 100644 --- a/packages/ragbits-common/src/ragbits_common/llms/clients/litellm.py +++ b/packages/ragbits-common/src/ragbits/common/llms/clients/litellm.py @@ -11,7 +11,7 @@ HAS_LITELLM = False -from ragbits_common.prompt import ChatFormat +from ragbits.common.prompt import ChatFormat from ..types import NOT_GIVEN, NotGiven from .base import LLMClient, LLMOptions diff --git a/packages/ragbits-common/src/ragbits_common/llms/clients/local.py b/packages/ragbits-common/src/ragbits/common/llms/clients/local.py similarity index 98% rename from packages/ragbits-common/src/ragbits_common/llms/clients/local.py rename to packages/ragbits-common/src/ragbits/common/llms/clients/local.py index a0941f7a..8cc55eb6 100644 --- a/packages/ragbits-common/src/ragbits_common/llms/clients/local.py +++ b/packages/ragbits-common/src/ragbits/common/llms/clients/local.py @@ -11,7 +11,7 @@ except ImportError: HAS_LOCAL_LLM = False -from ragbits_common.prompt import ChatFormat +from ragbits.common.prompt import ChatFormat from ..types import NOT_GIVEN, NotGiven from .base import LLMClient, LLMOptions diff --git a/packages/ragbits-common/src/ragbits_common/llms/litellm.py b/packages/ragbits-common/src/ragbits/common/llms/litellm.py similarity index 98% rename from packages/ragbits-common/src/ragbits_common/llms/litellm.py rename to packages/ragbits-common/src/ragbits/common/llms/litellm.py index 2c3e1b30..03f19f0a 100644 --- a/packages/ragbits-common/src/ragbits_common/llms/litellm.py +++ b/packages/ragbits-common/src/ragbits/common/llms/litellm.py @@ -8,7 +8,7 @@ except ImportError: HAS_LITELLM = False -from ragbits_common.prompt.base import BasePrompt +from ragbits.common.prompt.base import BasePrompt from .base import LLM from .clients.litellm import LiteLLMClient, LiteLLMOptions diff --git a/packages/ragbits-common/src/ragbits_common/llms/local.py b/packages/ragbits-common/src/ragbits/common/llms/local.py similarity index 97% rename from packages/ragbits-common/src/ragbits_common/llms/local.py rename to packages/ragbits-common/src/ragbits/common/llms/local.py index 9b3000a8..7d87d751 100644 --- a/packages/ragbits-common/src/ragbits_common/llms/local.py +++ b/packages/ragbits-common/src/ragbits/common/llms/local.py @@ -8,7 +8,7 @@ except ImportError: HAS_LOCAL_LLM = False -from ragbits_common.prompt.base import BasePrompt +from ragbits.common.prompt.base import BasePrompt from .base import LLM from .clients.local import LocalLLMClient, LocalLLMOptions diff --git a/packages/ragbits-common/src/ragbits_common/llms/types.py b/packages/ragbits-common/src/ragbits/common/llms/types.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/llms/types.py rename to packages/ragbits-common/src/ragbits/common/llms/types.py diff --git a/packages/ragbits-common/src/ragbits/common/prompt/__init__.py b/packages/ragbits-common/src/ragbits/common/prompt/__init__.py new file mode 100644 index 00000000..068e405f --- /dev/null +++ b/packages/ragbits-common/src/ragbits/common/prompt/__init__.py @@ -0,0 +1,3 @@ +from ragbits.common.prompt.prompt import ChatFormat, Prompt + +__all__ = ["Prompt", "ChatFormat"] diff --git a/packages/ragbits-common/src/ragbits_common/prompt/base.py b/packages/ragbits-common/src/ragbits/common/prompt/base.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/prompt/base.py rename to packages/ragbits-common/src/ragbits/common/prompt/base.py diff --git a/packages/ragbits-common/src/ragbits_common/prompt/parsers.py b/packages/ragbits-common/src/ragbits/common/prompt/parsers.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/prompt/parsers.py rename to packages/ragbits-common/src/ragbits/common/prompt/parsers.py diff --git a/packages/ragbits-common/src/ragbits_common/prompt/prompt.py b/packages/ragbits-common/src/ragbits/common/prompt/prompt.py similarity index 100% rename from packages/ragbits-common/src/ragbits_common/prompt/prompt.py rename to packages/ragbits-common/src/ragbits/common/prompt/prompt.py 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-common/src/ragbits_common/prompt/__init__.py b/packages/ragbits-common/src/ragbits_common/prompt/__init__.py deleted file mode 100644 index 8417e3c0..00000000 --- a/packages/ragbits-common/src/ragbits_common/prompt/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from ragbits_common.prompt.prompt import ChatFormat, Prompt - -__all__ = ["Prompt", "ChatFormat"] diff --git a/packages/ragbits-common/tests/unit/llms/test_litellm.py b/packages/ragbits-common/tests/unit/llms/test_litellm.py index 705e0fce..d3167176 100644 --- a/packages/ragbits-common/tests/unit/llms/test_litellm.py +++ b/packages/ragbits-common/tests/unit/llms/test_litellm.py @@ -1,9 +1,9 @@ from pydantic import BaseModel -from ragbits_common.llms.clients.litellm import LiteLLMOptions -from ragbits_common.llms.litellm import LiteLLM -from ragbits_common.prompt import Prompt -from ragbits_common.prompt.base import BasePrompt, BasePromptWithParser, ChatFormat +from ragbits.common.llms.clients.litellm import LiteLLMOptions +from ragbits.common.llms.litellm import LiteLLM +from ragbits.common.prompt import Prompt +from ragbits.common.prompt.base import BasePrompt, BasePromptWithParser, ChatFormat class MockPrompt(BasePrompt): diff --git a/packages/ragbits-common/tests/unit/prompts/test_parsers.py b/packages/ragbits-common/tests/unit/prompts/test_parsers.py index a8302cba..a5f4378e 100644 --- a/packages/ragbits-common/tests/unit/prompts/test_parsers.py +++ b/packages/ragbits-common/tests/unit/prompts/test_parsers.py @@ -2,8 +2,8 @@ import pytest -from ragbits_common.prompt import Prompt -from ragbits_common.prompt.parsers import ResponseParsingError +from ragbits.common.prompt import Prompt +from ragbits.common.prompt.parsers import ResponseParsingError from .test_prompt import _PromptOutput diff --git a/packages/ragbits-common/tests/unit/prompts/test_prompt.py b/packages/ragbits-common/tests/unit/prompts/test_prompt.py index 0f4e757c..cce0f70c 100644 --- a/packages/ragbits-common/tests/unit/prompts/test_prompt.py +++ b/packages/ragbits-common/tests/unit/prompts/test_prompt.py @@ -1,7 +1,7 @@ import pydantic import pytest -from ragbits_common.prompt import Prompt +from ragbits.common.prompt import Prompt class _PromptInput(pydantic.BaseModel): diff --git a/packages/ragbits-dev-kit/setup.cfg b/packages/ragbits-dev-kit/setup.cfg index f3ed1ad1..57438300 100644 --- a/packages/ragbits-dev-kit/setup.cfg +++ b/packages/ragbits-dev-kit/setup.cfg @@ -22,7 +22,7 @@ classifiers = [options] package_dir= =src -packages=find: +packages=find_namespace: zip_safe = False platforms = any include_package_data = True diff --git a/packages/ragbits-dev-kit/src/ragbits_dev_kit/__init__.py b/packages/ragbits-dev-kit/src/ragbits/dev_kit/__init__.py similarity index 100% rename from packages/ragbits-dev-kit/src/ragbits_dev_kit/__init__.py rename to packages/ragbits-dev-kit/src/ragbits/dev_kit/__init__.py diff --git a/packages/ragbits-dev-kit/src/ragbits_dev_kit/app/__init__.py b/packages/ragbits-dev-kit/src/ragbits/dev_kit/app/__init__.py similarity index 100% rename from packages/ragbits-dev-kit/src/ragbits_dev_kit/app/__init__.py rename to packages/ragbits-dev-kit/src/ragbits/dev_kit/app/__init__.py 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 similarity index 98% rename from packages/ragbits-dev-kit/src/ragbits_dev_kit/app/main.py rename to packages/ragbits-dev-kit/src/ragbits/dev_kit/app/main.py index d0db70d2..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.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-dev-kit/src/ragbits/dev_kit/discovery/__init__.py b/packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/__init__.py new file mode 100644 index 00000000..4c5850f0 --- /dev/null +++ b/packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/__init__.py @@ -0,0 +1,3 @@ +from ragbits.dev_kit.discovery.prompt_discovery import PromptDiscovery + +__all__ = ["PromptDiscovery"] diff --git a/packages/ragbits-dev-kit/src/ragbits_dev_kit/discovery/prompt_discovery.py b/packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/prompt_discovery.py similarity index 98% rename from packages/ragbits-dev-kit/src/ragbits_dev_kit/discovery/prompt_discovery.py rename to packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/prompt_discovery.py index 38be1157..f2d73366 100644 --- a/packages/ragbits-dev-kit/src/ragbits_dev_kit/discovery/prompt_discovery.py +++ b/packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/prompt_discovery.py @@ -4,7 +4,7 @@ from collections import namedtuple from typing import Any -from ragbits_common.prompt import Prompt +from ragbits.common.prompt import Prompt PromptDetails = namedtuple("PromptDetails", ["system_prompt", "user_prompt", "input_type", "object"]) 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-dev-kit/src/ragbits_dev_kit/discovery/__init__.py b/packages/ragbits-dev-kit/src/ragbits_dev_kit/discovery/__init__.py deleted file mode 100644 index ee2fecf0..00000000 --- a/packages/ragbits-dev-kit/src/ragbits_dev_kit/discovery/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from ragbits_dev_kit.discovery.prompt_discovery import PromptDiscovery - -__all__ = ["PromptDiscovery"] diff --git a/packages/ragbits-dev-kit/tests/unit/discovery/prompt_classes_for_tests.py b/packages/ragbits-dev-kit/tests/unit/discovery/prompt_classes_for_tests.py index 5922b3e1..1aa1a3f4 100644 --- a/packages/ragbits-dev-kit/tests/unit/discovery/prompt_classes_for_tests.py +++ b/packages/ragbits-dev-kit/tests/unit/discovery/prompt_classes_for_tests.py @@ -2,7 +2,7 @@ from pydantic import BaseModel -from ragbits_common.prompt import Prompt +from ragbits.common.prompt import Prompt class PromptForTestInput(BaseModel): diff --git a/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt1.py b/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt1.py index 0a0c403d..b323a6bb 100644 --- a/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt1.py +++ b/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt1.py @@ -1,6 +1,6 @@ from pydantic import BaseModel -from ragbits_common.prompt import Prompt +from ragbits.common.prompt import Prompt class PromptForTestInputA(BaseModel): diff --git a/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt2.py b/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt2.py index 99289d33..cde8c453 100644 --- a/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt2.py +++ b/packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt2.py @@ -1,6 +1,6 @@ from pydantic import BaseModel -from ragbits_common.prompt import Prompt +from ragbits.common.prompt import Prompt class PromptForTestInputB(BaseModel): diff --git a/packages/ragbits-dev-kit/tests/unit/discovery/test_prompt_discovery.py b/packages/ragbits-dev-kit/tests/unit/discovery/test_prompt_discovery.py index 0f44ba50..9aa1bcf9 100644 --- a/packages/ragbits-dev-kit/tests/unit/discovery/test_prompt_discovery.py +++ b/packages/ragbits-dev-kit/tests/unit/discovery/test_prompt_discovery.py @@ -1,7 +1,7 @@ import sys from pathlib import Path -from ragbits_dev_kit.discovery.prompt_discovery import PromptDiscovery +from ragbits.dev_kit.discovery.prompt_discovery import PromptDiscovery def test_prompt_discovery_from_file(): diff --git a/packages/ragbits-document-search/examples/simple_text.py b/packages/ragbits-document-search/examples/simple_text.py index 43bbc96c..db559913 100644 --- a/packages/ragbits-document-search/examples/simple_text.py +++ b/packages/ragbits-document-search/examples/simple_text.py @@ -1,10 +1,9 @@ import asyncio -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 +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 documents = [ DocumentMeta.create_text_document_from_literal("RIP boiled water. You will be mist."), diff --git a/packages/ragbits-document-search/setup.cfg b/packages/ragbits-document-search/setup.cfg index a187a55a..b8d55946 100644 --- a/packages/ragbits-document-search/setup.cfg +++ b/packages/ragbits-document-search/setup.cfg @@ -23,7 +23,7 @@ classifiers = [options] package_dir= =src -packages=find: +packages=find_namespace: zip_safe = False platforms = any include_package_data = True diff --git a/packages/ragbits-document-search/src/ragbits_document_search/__init__.py b/packages/ragbits-document-search/src/ragbits/document_search/__init__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/__init__.py rename to packages/ragbits-document-search/src/ragbits/document_search/__init__.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/__version__.py b/packages/ragbits-document-search/src/ragbits/document_search/__version__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/__version__.py rename to packages/ragbits-document-search/src/ragbits/document_search/__version__.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/_main.py b/packages/ragbits-document-search/src/ragbits/document_search/_main.py similarity index 80% rename from packages/ragbits-document-search/src/ragbits_document_search/_main.py rename to packages/ragbits-document-search/src/ragbits/document_search/_main.py index a0a1257d..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,13 +1,12 @@ -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 -from ragbits_document_search.retrieval.rephrasers.base import QueryRephraser -from ragbits_document_search.retrieval.rephrasers.noop import NoopQueryRephraser -from ragbits_document_search.retrieval.rerankers.base import Reranker -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 +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 +from ragbits.document_search.retrieval.rephrasers.base import QueryRephraser +from ragbits.document_search.retrieval.rephrasers.noop import NoopQueryRephraser +from ragbits.document_search.retrieval.rerankers.base import Reranker +from ragbits.document_search.retrieval.rerankers.noop import NoopReranker +from ragbits.document_search.vector_store.base import VectorStore class DocumentSearch: diff --git a/packages/ragbits-document-search/src/ragbits_document_search/documents/__init__.py b/packages/ragbits-document-search/src/ragbits/document_search/documents/__init__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/documents/__init__.py rename to packages/ragbits-document-search/src/ragbits/document_search/documents/__init__.py 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 similarity index 97% rename from packages/ragbits-document-search/src/ragbits_document_search/documents/document.py rename to packages/ragbits-document-search/src/ragbits/document_search/documents/document.py index e6a55105..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,7 +4,8 @@ from typing import Union from pydantic import BaseModel, Field -from ragbits_document_search.documents.sources import LocalFileSource + +from ragbits.document_search.documents.sources import LocalFileSource class DocumentType(str, Enum): 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 similarity index 89% rename from packages/ragbits-document-search/src/ragbits_document_search/documents/element.py rename to packages/ragbits-document-search/src/ragbits/document_search/documents/element.py index 596e4af1..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,8 +2,9 @@ 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 + +from ragbits.document_search.documents.document import DocumentMeta +from ragbits.document_search.vector_store.base import VectorDBEntry class Element(BaseModel, ABC): @@ -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/documents/sources.py b/packages/ragbits-document-search/src/ragbits/document_search/documents/sources.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/documents/sources.py rename to packages/ragbits-document-search/src/ragbits/document_search/documents/sources.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/ingestion/__init__.py b/packages/ragbits-document-search/src/ragbits/document_search/ingestion/__init__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/ingestion/__init__.py rename to packages/ragbits-document-search/src/ragbits/document_search/ingestion/__init__.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/ingestion/document_processor.py b/packages/ragbits-document-search/src/ragbits/document_search/ingestion/document_processor.py similarity index 88% rename from packages/ragbits-document-search/src/ragbits_document_search/ingestion/document_processor.py rename to packages/ragbits-document-search/src/ragbits/document_search/ingestion/document_processor.py index 8e445552..f11b4277 100644 --- a/packages/ragbits-document-search/src/ragbits_document_search/ingestion/document_processor.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/ingestion/document_processor.py @@ -4,8 +4,8 @@ from typing import List -from ragbits_document_search.documents.document import DocumentMeta, TextDocument -from ragbits_document_search.documents.element import Element, TextElement +from ragbits.document_search.documents.document import DocumentMeta, TextDocument +from ragbits.document_search.documents.element import Element, TextElement class DocumentProcessor: diff --git a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/__init__.py b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/__init__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/retrieval/__init__.py rename to packages/ragbits-document-search/src/ragbits/document_search/retrieval/__init__.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rephrasers/__init__.py b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/__init__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/retrieval/rephrasers/__init__.py rename to packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/__init__.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rephrasers/base.py b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/base.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/retrieval/rephrasers/base.py rename to packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/base.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rephrasers/noop.py b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/noop.py similarity index 87% rename from packages/ragbits-document-search/src/ragbits_document_search/retrieval/rephrasers/noop.py rename to packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/noop.py index 30e88e33..8e6b92fd 100644 --- a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rephrasers/noop.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/noop.py @@ -1,4 +1,4 @@ -from ragbits_document_search.retrieval.rephrasers.base import QueryRephraser +from ragbits.document_search.retrieval.rephrasers.base import QueryRephraser class NoopQueryRephraser(QueryRephraser): diff --git a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/__init__.py b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/__init__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/__init__.py rename to packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/__init__.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/base.py b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/base.py similarity index 85% rename from packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/base.py rename to packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/base.py index 2ddffde5..dec88647 100644 --- a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/base.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/base.py @@ -1,6 +1,6 @@ import abc -from ragbits_document_search.documents.element import Element +from ragbits.document_search.documents.element import Element class Reranker(abc.ABC): diff --git a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/noop.py b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/noop.py similarity index 77% rename from packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/noop.py rename to packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/noop.py index 1e943fcd..5f1ba744 100644 --- a/packages/ragbits-document-search/src/ragbits_document_search/retrieval/rerankers/noop.py +++ b/packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/noop.py @@ -1,7 +1,7 @@ from typing import List -from ragbits_document_search.documents.element import Element -from ragbits_document_search.retrieval.rerankers.base import Reranker +from ragbits.document_search.documents.element import Element +from ragbits.document_search.retrieval.rerankers.base import Reranker class NoopReranker(Reranker): diff --git a/packages/ragbits-document-search/src/ragbits_document_search/vector_store/__init__.py b/packages/ragbits-document-search/src/ragbits/document_search/vector_store/__init__.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/vector_store/__init__.py rename to packages/ragbits-document-search/src/ragbits/document_search/vector_store/__init__.py diff --git a/packages/ragbits-document-search/src/ragbits_document_search/vector_store/base.py b/packages/ragbits-document-search/src/ragbits/document_search/vector_store/base.py similarity index 100% rename from packages/ragbits-document-search/src/ragbits_document_search/vector_store/base.py rename to packages/ragbits-document-search/src/ragbits/document_search/vector_store/base.py 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 similarity index 89% rename from packages/ragbits-document-search/src/ragbits_document_search/vector_store/in_memory.py rename to packages/ragbits-document-search/src/ragbits/document_search/vector_store/in_memory.py index 2882fa1a..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,5 +1,6 @@ import numpy as np -from ragbits_document_search.vector_store.base import VectorDBEntry, VectorStore + +from ragbits.document_search.vector_store.base import VectorDBEntry, VectorStore class InMemoryVectorStore(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/packages/ragbits-document-search/tests/unit/test_document_search.py b/packages/ragbits-document-search/tests/unit/test_document_search.py index 8bd5183e..2e405ef5 100644 --- a/packages/ragbits-document-search/tests/unit/test_document_search.py +++ b/packages/ragbits-document-search/tests/unit/test_document_search.py @@ -1,9 +1,9 @@ from unittest.mock import AsyncMock -from ragbits_document_search import DocumentSearch -from ragbits_document_search.documents.document import DocumentMeta -from ragbits_document_search.documents.element import TextElement -from ragbits_document_search.vector_store.in_memory import InMemoryVectorStore +from ragbits.document_search import DocumentSearch +from ragbits.document_search.documents.document import DocumentMeta +from ragbits.document_search.documents.element import TextElement +from ragbits.document_search.vector_store.in_memory import InMemoryVectorStore async def test_document_search(): diff --git a/packages/ragbits-document-search/tests/unit/test_documents.py b/packages/ragbits-document-search/tests/unit/test_documents.py index c293cb99..5fd490b9 100644 --- a/packages/ragbits-document-search/tests/unit/test_documents.py +++ b/packages/ragbits-document-search/tests/unit/test_documents.py @@ -1,8 +1,8 @@ import tempfile from pathlib import Path -from ragbits_document_search.documents.document import DocumentMeta, DocumentType, TextDocument -from ragbits_document_search.documents.sources import LocalFileSource +from ragbits.document_search.documents.document import DocumentMeta, DocumentType, TextDocument +from ragbits.document_search.documents.sources import LocalFileSource async def test_loading_local_file_source(): diff --git a/packages/ragbits-document-search/tests/unit/test_elements.py b/packages/ragbits-document-search/tests/unit/test_elements.py index 8a04348c..44ddb183 100644 --- a/packages/ragbits-document-search/tests/unit/test_elements.py +++ b/packages/ragbits-document-search/tests/unit/test_elements.py @@ -1,6 +1,6 @@ -from ragbits_document_search.documents.document import DocumentType -from ragbits_document_search.documents.element import Element -from ragbits_document_search.vector_store.base import VectorDBEntry +from ragbits.document_search.documents.document import DocumentType +from ragbits.document_search.documents.element import Element +from ragbits.document_search.vector_store.base import VectorDBEntry def test_resolving_element_type(): diff --git a/packages/ragbits-document-search/tests/unit/test_simple_vector_store.py b/packages/ragbits-document-search/tests/unit/test_simple_vector_store.py index 177eb6fa..bad25403 100644 --- a/packages/ragbits-document-search/tests/unit/test_simple_vector_store.py +++ b/packages/ragbits-document-search/tests/unit/test_simple_vector_store.py @@ -1,9 +1,9 @@ from pathlib import Path -from ragbits_document_search.documents.document import DocumentMeta, DocumentType -from ragbits_document_search.documents.element import TextElement -from ragbits_document_search.documents.sources import LocalFileSource -from ragbits_document_search.vector_store.in_memory import InMemoryVectorStore +from ragbits.document_search.documents.document import DocumentMeta, DocumentType +from ragbits.document_search.documents.element import TextElement +from ragbits.document_search.documents.sources import LocalFileSource +from ragbits.document_search.vector_store.in_memory import InMemoryVectorStore async def test_simple_vector_store(): diff --git a/pyproject.toml b/pyproject.toml index a5cabe1f..8221a0e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ multi_line_output = 3 line_length = 120 include_trailing_comma = true -known_first_party = ['ragbits_common'] +known_first_party = ['ragbits'] known_third_party = [ # Most popular libraries. Extend if necessary. 'IPython', 'PIL', @@ -81,10 +81,15 @@ 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_common.*" +module = "ragbits.*" ignore_missing_imports = false disallow_untyped_defs = true