feat(llms): option to set a default LLM factory #177
GitHub Actions / JUnit Test Report
failed
Oct 14, 2024 in 0s
102 tests run, 96 passed, 4 skipped, 2 failed.
Annotations
Check failure on line 14 in packages/ragbits-core/tests/unit/llms/factory/test_get_default_llm.py
github-actions / JUnit Test Report
test_get_default_llm
ModuleNotFoundError: No module named 'tests.unit.llms'
Raw output
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f28662192d0>
def test_get_default_llm(monkeypatch):
"""
Test the get_llm_from_factory function.
"""
monkeypatch.setattr(
core_config, "default_llm_factory", "tests.unit.llms.factory.test_get_llm_from_factory.mock_llm_factory"
)
> llm = get_default_llm()
packages/ragbits-core/tests/unit/llms/factory/test_get_default_llm.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
packages/ragbits-core/src/ragbits/core/llms/factory.py:49: in get_default_llm
return get_llm_from_factory(factory)
packages/ragbits-core/src/ragbits/core/llms/factory.py:19: in get_llm_from_factory
module = importlib.import_module(module_name)
/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'tests.unit.llms', import_ = <function _gcd_import at 0x7f2925d63400>
> ???
E ModuleNotFoundError: No module named 'tests.unit.llms'
<frozen importlib._bootstrap>:1004: ModuleNotFoundError
github-actions / JUnit Test Report
test_get_llm_from_factory
ModuleNotFoundError: No module named 'tests.unit.llms'
Raw output
def test_get_llm_from_factory():
"""
Test the get_llm_from_factory function.
"""
> llm = get_llm_from_factory("tests.unit.llms.factory.test_get_llm_from_factory.mock_llm_factory")
packages/ragbits-core/tests/unit/llms/factory/test_get_llm_from_factory.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
packages/ragbits-core/src/ragbits/core/llms/factory.py:19: in get_llm_from_factory
module = importlib.import_module(module_name)
/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'tests.unit.llms', import_ = <function _gcd_import at 0x7f2925d63400>
> ???
E ModuleNotFoundError: No module named 'tests.unit.llms'
<frozen importlib._bootstrap>:1004: ModuleNotFoundError
Loading