From f404bc66ef8f86c875e818ef3b1a45c4b1dbb04f Mon Sep 17 00:00:00 2001 From: kdziedzic68 Date: Thu, 28 Nov 2024 14:11:46 +0100 Subject: [PATCH] remove has default llm --- .../src/ragbits/core/llms/factory.py | 11 --------- .../unit/llms/factory/test_has_default_llm.py | 23 ------------------- 2 files changed, 34 deletions(-) delete mode 100644 packages/ragbits-core/tests/unit/llms/factory/test_has_default_llm.py diff --git a/packages/ragbits-core/src/ragbits/core/llms/factory.py b/packages/ragbits-core/src/ragbits/core/llms/factory.py index 8eadd293..ef6bb1ed 100644 --- a/packages/ragbits-core/src/ragbits/core/llms/factory.py +++ b/packages/ragbits-core/src/ragbits/core/llms/factory.py @@ -21,17 +21,6 @@ def get_llm_from_factory(factory_path: str) -> LLM: return function() -def has_default_llm(llm_type: LLMType = LLMType.TEXT) -> bool: - """ - Check if the default LLM factory is set in the configuration. - - Returns: - bool: Whether the default LLM factory is set. - """ - default_factory = core_config.default_llm_factories.get(llm_type, None) - return default_factory is not None - - def get_default_llm(llm_type: LLMType = LLMType.TEXT) -> LLM: """ Get an instance of the default LLM using the factory function diff --git a/packages/ragbits-core/tests/unit/llms/factory/test_has_default_llm.py b/packages/ragbits-core/tests/unit/llms/factory/test_has_default_llm.py deleted file mode 100644 index 152da8ba..00000000 --- a/packages/ragbits-core/tests/unit/llms/factory/test_has_default_llm.py +++ /dev/null @@ -1,23 +0,0 @@ -import pytest - -from ragbits.core.config import core_config -from ragbits.core.llms.base import LLMType -from ragbits.core.llms.factory import has_default_llm - - -def test_has_default_llm(monkeypatch: pytest.MonkeyPatch) -> None: - """ - Test the has_default_llm function when the default LLM factory is not set. - """ - monkeypatch.setattr(core_config, "default_llm_factories", {}) - - assert has_default_llm() is False - - -def test_has_default_llm_false(monkeypatch: pytest.MonkeyPatch) -> None: - """ - Test the has_default_llm function when the default LLM factory is set. - """ - monkeypatch.setattr(core_config, "default_llm_factories", {LLMType.TEXT: "my_project.llms.get_llm"}) - - assert has_default_llm() is True