# test_llm.py - Create this as a separate file to test your LLM setup import os from dotenv import load_dotenv print("=== Testing LLM Setup ===") # Load environment variables load_dotenv() print(f"โœ… Environment loaded") print(f"๐Ÿ”‘ GROQ_API_KEY exists: {'GROQ_API_KEY' in os.environ}") if 'GROQ_API_KEY' in os.environ: key = os.environ['GROQ_API_KEY'] print(f"๐Ÿ”‘ API Key starts with: {key[:10]}...") # Test LLM import try: from ourllm import llm print("โœ… Successfully imported LLM") # Test LLM call test_message = "Hello, please respond with 'LLM is working correctly'" print(f"๐Ÿงช Testing with message: {test_message}") response = llm.invoke(test_message) print(f"โœ… LLM Response: {response.content}") except ImportError as e: print(f"โŒ Import error: {e}") except Exception as e: print(f"โŒ LLM call error: {e}") print("=== Test Complete ===")