Skip to content

Commit

Permalink
fix: issue Multiple Paths Between IF/ELSE Branches Invalidate Conditi…
Browse files Browse the repository at this point in the history
…ons and Execute All Paths close langgenius#11542

Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 committed Dec 13, 2024
1 parent ee34206 commit d17a868
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions api/core/app/apps/advanced_chat/generate_task_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ def _process_stream_response(
# Record files if it's an answer node or end node
if event.node_type in [NodeType.ANSWER, NodeType.END]:
self._recorded_files.extend(self._fetch_files_from_node_outputs(event.outputs or {}))
# tricy way to solve #11542 and others for now FIXME when have a better solution
if event.node_type == NodeType.ANSWER:
yield self._message_to_stream_response(answer=event.node_data.answer, message_id=self._message.id)

response = self._workflow_node_finish_to_stream_response(
event=event,
Expand Down Expand Up @@ -497,9 +500,10 @@ def _process_stream_response(
tts_publisher.publish(message=queue_message)

self._task_state.answer += delta_text
yield self._message_to_stream_response(
answer=delta_text, message_id=self._message.id, from_variable_selector=event.from_variable_selector
)
# tricy way to solve #11542 and others for now FIXME when have a better solution
# yield self._message_to_stream_response(
# answer=delta_text, message_id=self._message.id, from_variable_selector=event.from_variable_selector
# )
elif isinstance(event, QueueMessageReplaceEvent):
# published by moderation
yield self._message_replace_to_stream_response(answer=event.text)
Expand Down

0 comments on commit d17a868

Please sign in to comment.