mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 13:47:15 +08:00
feat: show video in web channel
This commit is contained in:
@@ -126,6 +126,13 @@ class WebChannel(ChatChannel):
|
||||
logger.debug(f"SSE skipped duplicate file for request {request_id}")
|
||||
return
|
||||
|
||||
# Skip http-URL FILE/IMAGE_URL replies produced by chat_channel's media extraction:
|
||||
# the text reply (already sent as "done") contains the URL and the frontend will
|
||||
# render it via renderMarkdown/injectVideoPlayers, so no separate SSE event needed.
|
||||
if reply.type in (ReplyType.FILE, ReplyType.IMAGE_URL) and content.startswith(("http://", "https://")):
|
||||
logger.debug(f"SSE skipped http media reply for request {request_id}")
|
||||
return
|
||||
|
||||
self.sse_queues[request_id].put({
|
||||
"type": "done",
|
||||
"content": content,
|
||||
|
||||
Reference in New Issue
Block a user