| import os | |
| from dotenv import load_dotenv | |
| from langchain_google_genai import ChatGoogleGenerativeAI | |
| load_dotenv(override=True) | |
| api_key = os.getenv("GOOGLE_API_KEY") | |
| print(f"Testing LangChain with Key: {api_key}") | |
| try: | |
| llm = ChatGoogleGenerativeAI(model="gemini-flash-latest", google_api_key=api_key) | |
| res = llm.invoke("Hello") | |
| print("LangChain Success:", res.content) | |
| except Exception as e: | |
| print("LangChain ERROR:", e) | |