Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -375,7 +375,8 @@ async def chat_completions(
|
|
| 375 |
detail="Missing or invalid Authorization header"
|
| 376 |
)
|
| 377 |
api_key = authorization[7:] # Remove "Bearer " prefix
|
| 378 |
-
|
|
|
|
| 379 |
request_id = str(uuid.uuid4())
|
| 380 |
proxy_ws = next((ws for ws, src in manager.active_connections.items() if src == 'proxy'), None)
|
| 381 |
if not proxy_ws:
|
|
@@ -393,7 +394,7 @@ async def chat_completions(
|
|
| 393 |
"destination": "proxy",
|
| 394 |
"model": request.model,
|
| 395 |
"temperature": request.temperature,
|
| 396 |
-
"
|
| 397 |
}
|
| 398 |
|
| 399 |
await proxy_ws.send_text(json.dumps(proxy_msg))
|
|
|
|
| 375 |
detail="Missing or invalid Authorization header"
|
| 376 |
)
|
| 377 |
api_key = authorization[7:] # Remove "Bearer " prefix
|
| 378 |
+
print("received key: " + api_key)
|
| 379 |
+
|
| 380 |
request_id = str(uuid.uuid4())
|
| 381 |
proxy_ws = next((ws for ws, src in manager.active_connections.items() if src == 'proxy'), None)
|
| 382 |
if not proxy_ws:
|
|
|
|
| 394 |
"destination": "proxy",
|
| 395 |
"model": request.model,
|
| 396 |
"temperature": request.temperature,
|
| 397 |
+
"incomingKey": api_key # Critical addition
|
| 398 |
}
|
| 399 |
|
| 400 |
await proxy_ws.send_text(json.dumps(proxy_msg))
|