Upload connection.py with huggingface_hub
Browse files- connection.py +2 -1
connection.py
CHANGED
|
@@ -8,7 +8,8 @@ load_dotenv()
|
|
| 8 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
| 9 |
|
| 10 |
if not openai_api_key:
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
# Create OpenAI client (NO base_url needed)
|
| 14 |
openai_client = AsyncOpenAI(
|
|
|
|
| 8 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
| 9 |
|
| 10 |
if not openai_api_key:
|
| 11 |
+
print("WARNING: OPENAI_API_KEY is not set. The chatbot will fail when processing requests.")
|
| 12 |
+
openai_api_key = "missing-key" # Prevent AsyncOpenAI from crashing immediately on init
|
| 13 |
|
| 14 |
# Create OpenAI client (NO base_url needed)
|
| 15 |
openai_client = AsyncOpenAI(
|