import unittest import os from unittest.mock import patch from backend.services.llm_service import llm_service from backend.config.settings import settings from backend.config.database import db_settings class TestLLMService(unittest.TestCase): @patch.dict(os.environ, { 'VECTOR_STORE_PROVIDER': 'chromadb', 'LLM_PROVIDER': 'google' , }) def test_chat_completion(self): """ Test chat completions work, assuming proper config and API keys """ # reinitialize globals instance settings.__init__() db_settings.__init__() llm_service.__init__() response = llm_service.simple_chat_completion("Hello there 👋🏽") print(response) # There should be a better way to test this self.assertTrue(len(response) > 0)