don't 404 when trying to connect to a non-existent conversation, just create it

This commit is contained in:
Charlotte Som 2025-03-02 07:58:24 +00:00
parent 3a73e21c5b
commit 115c762e57

View file

@ -29,10 +29,12 @@ async def connect_to_conversation(ws: WebSocket):
try:
conversation: llm.AsyncConversation = llm.cli.load_conversation(conversation_id, async_=True)
except:
await ws.send_denial_response(JSONResponse({
"error": "unable to load conversation {}".format(conversation_id)
}, status_code=404))
return
# await ws.send_denial_response(JSONResponse({
# "error": "unable to load conversation {}".format(conversation_id)
# }, status_code=404))
# return
model = llm.get_async_model(ws.query_params.get("model"))
conversation = llm.AsyncConversation(model, id=conversation_id)
await ws.accept()