mirror of
https://github.com/open-webui/open-webui
synced 2025-04-27 01:32:43 +00:00
fix: chat completion non-existent model issue
This commit is contained in:
parent
8e8bc3125e
commit
aefb3117db
@ -1108,13 +1108,15 @@ async def chat_completion(
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug(f"Error processing chat payload: {e}")
|
log.debug(f"Error processing chat payload: {e}")
|
||||||
Chats.upsert_message_to_chat_by_id_and_message_id(
|
if metadata.get("chat_id") and metadata.get("message_id"):
|
||||||
metadata["chat_id"],
|
# Update the chat message with the error
|
||||||
metadata["message_id"],
|
Chats.upsert_message_to_chat_by_id_and_message_id(
|
||||||
{
|
metadata["chat_id"],
|
||||||
"error": {"content": str(e)},
|
metadata["message_id"],
|
||||||
},
|
{
|
||||||
)
|
"error": {"content": str(e)},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_400_BAD_REQUEST,
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
|
Loading…
Reference in New Issue
Block a user