mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 06:19:03 +08:00
fix(workflow): missing content in the answer node stream output during iterations (#8292)
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
0f14873255
commit
56c90e212a
@ -7,8 +7,8 @@ import os
|
|||||||
import re
|
import re
|
||||||
import tempfile
|
import tempfile
|
||||||
import uuid
|
import uuid
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
from xml.etree import ElementTree
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from docx import Document as DocxDocument
|
from docx import Document as DocxDocument
|
||||||
@ -218,7 +218,7 @@ class WordExtractor(BaseExtractor):
|
|||||||
hyperlinks_url = None
|
hyperlinks_url = None
|
||||||
if "HYPERLINK" in run.element.xml:
|
if "HYPERLINK" in run.element.xml:
|
||||||
try:
|
try:
|
||||||
xml = ET.XML(run.element.xml)
|
xml = ElementTree.XML(run.element.xml)
|
||||||
x_child = [c for c in xml.iter() if c is not None]
|
x_child = [c for c in xml.iter() if c is not None]
|
||||||
for x in x_child:
|
for x in x_child:
|
||||||
if x_child is None:
|
if x_child is None:
|
||||||
|
@ -16,6 +16,7 @@ from core.workflow.graph_engine.entities.event import (
|
|||||||
IterationRunNextEvent,
|
IterationRunNextEvent,
|
||||||
IterationRunStartedEvent,
|
IterationRunStartedEvent,
|
||||||
IterationRunSucceededEvent,
|
IterationRunSucceededEvent,
|
||||||
|
NodeRunStreamChunkEvent,
|
||||||
NodeRunSucceededEvent,
|
NodeRunSucceededEvent,
|
||||||
)
|
)
|
||||||
from core.workflow.graph_engine.entities.graph import Graph
|
from core.workflow.graph_engine.entities.graph import Graph
|
||||||
@ -154,7 +155,11 @@ class IterationNode(BaseNode):
|
|||||||
if isinstance(event, (BaseNodeEvent | BaseParallelBranchEvent)) and not event.in_iteration_id:
|
if isinstance(event, (BaseNodeEvent | BaseParallelBranchEvent)) and not event.in_iteration_id:
|
||||||
event.in_iteration_id = self.node_id
|
event.in_iteration_id = self.node_id
|
||||||
|
|
||||||
if isinstance(event, BaseNodeEvent) and event.node_type == NodeType.ITERATION_START:
|
if (
|
||||||
|
isinstance(event, BaseNodeEvent)
|
||||||
|
and event.node_type == NodeType.ITERATION_START
|
||||||
|
and not isinstance(event, NodeRunStreamChunkEvent)
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if isinstance(event, NodeRunSucceededEvent):
|
if isinstance(event, NodeRunSucceededEvent):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user