fix: 修复节点直接回答,不同节点响应用回车隔开 (#935)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

(cherry picked from commit 8453ea2b4b)
This commit is contained in:
shaohuzhang1 2024-08-06 16:56:05 +08:00 committed by shaohuzhang1
parent 1721344cc6
commit 77814972a4
3 changed files with 7 additions and 2 deletions

View File

@ -28,8 +28,9 @@ def write_context(step_variable: Dict, global_variable: Dict, node, workflow):
for key in step_variable:
node.context[key] = step_variable[key]
if workflow.is_result() and 'answer' in step_variable:
yield step_variable['answer']
workflow.answer += step_variable['answer']
answer = step_variable['answer'] + '\n'
yield answer
workflow.answer += answer
if global_variable is not None:
for key in global_variable:
workflow.context[key] = global_variable[key]

View File

@ -45,6 +45,8 @@ def write_context_stream(node_variable: Dict, workflow_variable: Dict, node: INo
for chunk in response:
answer += chunk.content
yield chunk.content
answer += '\n'
yield '\n'
_write_context(node_variable, workflow_variable, node, workflow, answer)

View File

@ -45,6 +45,8 @@ def write_context_stream(node_variable: Dict, workflow_variable: Dict, node: INo
for chunk in response:
answer += chunk.content
yield chunk.content
answer += '\n'
yield '\n'
_write_context(node_variable, workflow_variable, node, workflow, answer)