""" Unit tests for llm chat client functionality """ import pytest from reviewllama.llm import chat_with_client, create_chat_client from reviewllama.utilities import is_ollama_available @pytest.fixture def chat_client(ollama_config): return create_chat_client(ollama_config) def test_chat_client(ollama_config, chat_client): if not is_ollama_available(ollama_config): pytest.skip("Local Ollama server is not available") response = chat_with_client( chat_client, "Tell me your name and introduce yourself briefly" ) response_from_history = chat_client.get_last_response_or_none().content assert response is not None assert response == response_from_history assert len(response) > 0 assert "gemma" in response.lower()