humanbrowser / test_env.py
SAFE44's picture
Create test_env.py
c1cba9f verified
Raw History Blame Contribute Delete
392 Bytes
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()