24 lines
734 B
Python
24 lines
734 B
Python
import pytest
|
|
from naliiabot.bot.factories.llm_factory import LLMFactory
|
|
from naliiabot.bot.exceptions import NotFoundProviderError
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langchain_deepseek import ChatDeepSeek
|
|
|
|
|
|
def test_llm_factory():
|
|
|
|
antrophicModel = LLMFactory("anthropic").get_model()
|
|
assert isinstance(antrophicModel, ChatAnthropic) is True
|
|
|
|
deepseekModel = LLMFactory("deepseek").get_model()
|
|
assert isinstance(deepseekModel, ChatDeepSeek)
|
|
|
|
|
|
def test_get_model_raises_exception_when_provider_not_found():
|
|
factory = LLMFactory(provider="openai")
|
|
|
|
with pytest.raises(NotFoundProviderError) as exc_info:
|
|
factory.get_model()
|
|
|
|
assert str(exc_info.value) == "OPENAI Not Provider Found"
|