Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -89,14 +89,13 @@ def chat(prompt: str = Query(...)):
|
|
| 89 |
if not OPENROUTER_API_KEY:
|
| 90 |
return {"error": "OPENROUTER_API_KEY not set in Hugging Face Secrets"}
|
| 91 |
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
|
| 101 |
try:
|
| 102 |
response = requests.post(
|
|
|
|
| 89 |
if not OPENROUTER_API_KEY:
|
| 90 |
return {"error": "OPENROUTER_API_KEY not set in Hugging Face Secrets"}
|
| 91 |
|
| 92 |
+
payload = {
|
| 93 |
+
"model": MODEL,
|
| 94 |
+
"messages": [
|
| 95 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 96 |
+
{"role": "user", "content": prompt}
|
| 97 |
+
]
|
| 98 |
+
}
|
|
|
|
| 99 |
|
| 100 |
try:
|
| 101 |
response = requests.post(
|