import sys import os import asyncio # Add current directory to path sys.path.append(os.getcwd()) from app.core.config import settings from app.services.enrichment import AIEnrichmentService from app.services.generation import GenerationService async def verify_models(): print("--- Verifying Local Models ---") print(f"USE_LOCAL_MODELS: {settings.USE_LOCAL_MODELS}") print(f"Effective LLM: {settings.get_effective_llm()}") print(f"Effective Embedding: {settings.get_effective_embedding()}") enricher = AIEnrichmentService() generator = GenerationService() # 1. Test Embedding print("\n1. Testing Local Embedding...") text = "Hello world" embedding = await enricher.generate_embedding(text) print(f"Embedding generated! Length: {len(embedding)}") assert len(embedding) == 384, f"Expected 384, got {len(embedding)}" # 2. Test Generation print("\n2. Testing Local Generation (Lightweight)...") query = "Who are you?" context = [{"payload": {"text": "I am a local AI assistant."}}] response = await generator.generate_answer(query, context) print(f"Answer: {response['answer']}") print(f"Citations: {response['citations']}") if __name__ == "__main__": asyncio.run(verify_models())