mirror of
https://github.com/zhayujie/bot-on-anything.git
synced 2026-01-19 09:41:07 +08:00
修复流式对话生成图片会在回复一次的bug
This commit is contained in:
@@ -41,7 +41,6 @@ async def return_stream(data):
|
||||
|
||||
@socketio.on('message', namespace='/chat')
|
||||
def stream(data):
|
||||
log.info('message:', data)
|
||||
if (auth.identify(request) == False):
|
||||
client_sid = request.sid
|
||||
socketio.server.disconnect(client_sid)
|
||||
@@ -52,7 +51,8 @@ def stream(data):
|
||||
data["msg"], channel_conf_val(const.HTTP, 'image_create_prefix'))
|
||||
if img_match_prefix:
|
||||
reply_text = HttpChannel().handle(data=data)
|
||||
socketio.emit('message', {'result': reply_text}, namespace='/chat')
|
||||
socketio.emit('disconnect', {'result': reply_text}, namespace='/chat')
|
||||
return
|
||||
asyncio.run(return_stream(data))
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ ConvState.prototype.updateAnswer = function (question, uuid) {
|
||||
var messageObj = $(this.wrapper).find(`#${uuid}`);
|
||||
this.scrollDown();
|
||||
socket.on('message', msg => {
|
||||
console.log("message:", msg)
|
||||
if (msg.result)
|
||||
messageObj.html(msg.result + `<div class="typing_loader"></div></div>`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user