enh: save status from the backend

This commit is contained in:
Timothy Jaeryang Baek
2024-12-24 18:03:14 -07:00
parent 95da0734b6
commit 55da6224b8
2 changed files with 27 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ import time
from open_webui.models.users import Users
from open_webui.models.channels import Channels
from open_webui.models.chats import Chats
from open_webui.env import (
ENABLE_WEBSOCKET_SUPPORT,
WEBSOCKET_MANAGER,
@@ -259,6 +261,13 @@ def get_event_emitter(request_info):
to=session_id,
)
if "type" in event_data and event_data["type"] == "status":
Chats.add_message_status_to_chat_by_id_and_message_id(
request_info["chat_id"],
request_info["message_id"],
event_data.get("data", {}),
)
return __event_emitter__