Spaces:
Sleeping
Sleeping
Update app.py
Browse filesadd your new secret key to "Variables and secrets" under settings with "OPENROUTER_API_KEY" as the name and the key as the value
app.py
CHANGED
@@ -3,10 +3,11 @@ import openai
|
|
3 |
import json
|
4 |
import random
|
5 |
from datetime import datetime
|
|
|
6 |
|
7 |
# Configure OpenRouter API
|
8 |
openai.api_base = "https://openrouter.ai/api/v1"
|
9 |
-
openai.api_key = "
|
10 |
|
11 |
class ScienceTalkGame:
|
12 |
def __init__(self):
|
|
|
3 |
import json
|
4 |
import random
|
5 |
from datetime import datetime
|
6 |
+
import os
|
7 |
|
8 |
# Configure OpenRouter API
|
9 |
openai.api_base = "https://openrouter.ai/api/v1"
|
10 |
+
openai.api_key = os.environ.get("OPENROUTER_API_KEY")
|
11 |
|
12 |
class ScienceTalkGame:
|
13 |
def __init__(self):
|