llm-app / testload.py
Leo
Checkpoint: working OpenAI streaming assistant in app.py
382aec4
raw
history blame
341 Bytes
from dotenv import load_dotenv
import os
load_dotenv() # Looks for a file named ".env" in the current directory
api_key = os.getenv("OPENAI_API_KEY")
if api_key:
print("βœ… API key loaded successfully.")
print("First 8 characters:", api_key[:8] + "...")
else:
print("❌ API key not found. Check your .env file formatting.")