Spaces:
Build error
Build error
Leo
commited on
Commit
·
382aec4
1
Parent(s):
4930060
Checkpoint: working OpenAI streaming assistant in app.py
Browse files- .DS_Store +0 -0
- testload.py +12 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
testload.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from dotenv import load_dotenv
|
2 |
+
import os
|
3 |
+
|
4 |
+
load_dotenv() # Looks for a file named ".env" in the current directory
|
5 |
+
|
6 |
+
api_key = os.getenv("OPENAI_API_KEY")
|
7 |
+
|
8 |
+
if api_key:
|
9 |
+
print("✅ API key loaded successfully.")
|
10 |
+
print("First 8 characters:", api_key[:8] + "...")
|
11 |
+
else:
|
12 |
+
print("❌ API key not found. Check your .env file formatting.")
|