import os from langchain_groq import ChatGroq def test_api(): try: llm = ChatGroq(groq_api_key=os.getenv("GROQ_API_KEY")) res = llm.invoke("Hello, are you active?") print("✅ API Connection: Success") return True except Exception as e: print(f"❌ API Connection: Failed - {e}") return False if __name__ == "__main__": test_api()