"""Tests for app.llm module.""" from __future__ import annotations import pytest from app.config import Settings from app.llm import create_llm @pytest.mark.unit class TestCreateLlm: def test_anthropic_provider(self) -> None: settings = Settings( database_url="postgresql://x:x@localhost/db", llm_provider="anthropic", llm_model="claude-sonnet-4-6", anthropic_api_key="test-key", ) llm = create_llm(settings) assert type(llm).__name__ == "ChatAnthropic" def test_openai_provider(self) -> None: settings = Settings( database_url="postgresql://x:x@localhost/db", llm_provider="openai", llm_model="gpt-4o", openai_api_key="sk-test", ) llm = create_llm(settings) assert type(llm).__name__ == "ChatOpenAI" def test_google_provider(self) -> None: settings = Settings( database_url="postgresql://x:x@localhost/db", llm_provider="google", llm_model="gemini-pro", google_api_key="test-key", ) llm = create_llm(settings) assert type(llm).__name__ == "ChatGoogleGenerativeAI"