瀏覽代碼

unify moderation and annotation's response behavior in message log of chatflow app with other types of app (#14800)

tags/1.0.1
Qun 8 月之前
父節點
當前提交
f0fb38fed4
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 9 行新增0 行删除
  1. 9
    0
      api/core/app/apps/advanced_chat/generate_task_pipeline.py

+ 9
- 0
api/core/app/apps/advanced_chat/generate_task_pipeline.py 查看文件

@@ -582,6 +582,15 @@ class AdvancedChatAppGenerateTaskPipeline:
session.commit()

yield workflow_finish_resp
elif event.stopped_by in (
QueueStopEvent.StopBy.INPUT_MODERATION,
QueueStopEvent.StopBy.ANNOTATION_REPLY,
):
# When hitting input-moderation or annotation-reply, the workflow will not start
with Session(db.engine, expire_on_commit=False) as session:
# Save message
self._save_message(session=session)
session.commit()

yield self._message_end_to_stream_response()
break

Loading…
取消
儲存