Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -235,7 +235,8 @@ async def chat(request: ChatRequest):
|
|
| 235 |
chat_messages = []
|
| 236 |
if request.history:
|
| 237 |
chat_messages.extend(ast.literal_eval(str(request.history)))
|
| 238 |
-
|
|
|
|
| 239 |
return JSONResponse(content=jsonable_encoder(results))
|
| 240 |
except Exception as e:
|
| 241 |
raise HTTPException(status_code=500, detail=f"Error getting chat results: {e}")
|
|
|
|
| 235 |
chat_messages = []
|
| 236 |
if request.history:
|
| 237 |
chat_messages.extend(ast.literal_eval(str(request.history)))
|
| 238 |
+
chat_messages.append({"role": "user", "content": request.q})
|
| 239 |
+
results = webs.chat(chat_messages = chat_messages, model=request.model)
|
| 240 |
return JSONResponse(content=jsonable_encoder(results))
|
| 241 |
except Exception as e:
|
| 242 |
raise HTTPException(status_code=500, detail=f"Error getting chat results: {e}")
|