"""Quick test for Groq Cloud API connectivity.""" import os from dotenv import load_dotenv load_dotenv() GROQ_API_KEY = os.getenv("GROQ_API_KEY") if not GROQ_API_KEY or GROQ_API_KEY == "your_groq_api_key_here": print("ERROR: GROQ_API_KEY is not set in environment.") print("Get a free key at https://console.groq.com/keys") else: try: import groq_service print("Testing Groq Parsing...") result = groq_service.parse_query_with_llm("analyze silver price in Hindi: चांदी की कीमत क्या है?") print("Groq Parse Result:", result) print("\nTesting Groq Insight...") insight = groq_service.generate_insight({"trend": "Bullish", "risk": "Low"}, "analysis") print("Groq Insight:", insight) print("\n✅ Groq API working!") except Exception as e: print(f"Groq API Error: {e}")