feat: webchat stream is ok

This commit is contained in:
Dong_master
2025-08-01 11:33:16 +08:00
parent d9a2bb9a06
commit 0ce81a2df2
4 changed files with 14 additions and 13 deletions

View File

@@ -14,8 +14,8 @@ class WebChatDebugRouterGroup(group.RouterGroup):
async def stream_generator(generator):
async for message in generator:
yield rf"data:{json.dumps({'message': message})}\n\n"
yield "data:{type: end}\n\n''"
yield f"data: {json.dumps({'message': message})}\n\n"
yield "data: {\"type\": \"end\"}\n\n"
try:
data = await quart.request.get_json()
session_type = data.get('session_type', 'person')