import asyncio import os from app.services.llm_service import llm_service from app.services.biographer_service import biographer_service async def test_biographer(): print("\n--- Testing Biographer Agent ---") # 1. Test Gap Detection & Question Generation print("1. Generating Question...") question = biographer_service.generate_question("Krish") print(f" Question: {question}") assert isinstance(question, str) and len(question) > 10 # 2. Test Router Classification (REMINISCE) print("2. Testing REMINISCE Intent...") history = [] text = "Let's remember something" intent = llm_service.classify_intent(text, history) print(f" Input: '{text}' -> Action: {intent.action}") # Note: LLM might classify as CHAT if not tuned, but we hope for REMINISCE # 3. Test Router Classification (SAVE_MEMORY) print("3. Testing SAVE_MEMORY Intent...") text = "My first school was St. Mary's." intent = llm_service.classify_intent(text, history) print(f" Input: '{text}' -> Action: {intent.action}") # 4. Test Process Answer print("4. Processing Answer...") response = biographer_service.process_answer("St. Mary's", "school_name") print(f" Response: {response}") if __name__ == "__main__": asyncio.run(test_biographer())