Spaces:
Runtime error
Runtime error
Ruzgar ????? commited on
Update main.py
Browse files
main.py
CHANGED
|
@@ -51,6 +51,11 @@ async def chat(message: Message, authorization: str = Header(None)):
|
|
| 51 |
if response.status_code == 200:
|
| 52 |
data = response.json()
|
| 53 |
bot_response = data['choices'][0]['message']['content']
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
else:
|
| 56 |
raise HTTPException(status_code=response.status_code, detail="API request failed")
|
|
|
|
| 51 |
if response.status_code == 200:
|
| 52 |
data = response.json()
|
| 53 |
bot_response = data['choices'][0]['message']['content']
|
| 54 |
+
|
| 55 |
+
# Model adı ile yanıt döndürme
|
| 56 |
+
return {
|
| 57 |
+
"model": selected_model,
|
| 58 |
+
"response": bot_response
|
| 59 |
+
}
|
| 60 |
else:
|
| 61 |
raise HTTPException(status_code=response.status_code, detail="API request failed")
|