Skip to content

Commit c5dad0d

Browse files
fix: Fix intent-node execution details not displaying user input
1 parent 36502be commit c5dad0d

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

apps/application/flow/common.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
from models_provider.tools import get_model_credential
2020
from tools.models.tool import Tool
2121

22-
end_nodes = ['ai-chat-node', 'reply-node', 'function-node', 'function-lib-node', 'application-node',
23-
'image-understand-node', 'speech-to-text-node', 'text-to-speech-node', 'image-generate-node',
24-
'variable-assign-node']
22+
END_NODES = frozenset([
23+
'ai-chat-node', 'reply-node', 'function-node', 'function-lib-node', 'application-node',
24+
'image-understand-node', 'speech-to-text-node', 'text-to-speech-node', 'image-generate-node',
25+
'variable-assign-node'
26+
])
2527

2628

2729
class Answer:
@@ -219,14 +221,14 @@ def is_valid_node(self, node: Node):
219221
for branch in branch_list:
220222
source_anchor_id = f"{node.id}_{branch.get('id')}_right"
221223
edge_list = [edge for edge in self.edges if edge.sourceAnchorId == source_anchor_id]
222-
if len(edge_list) == 0:
224+
if not edge_list:
223225
raise AppApiException(500,
224226
_('The branch {branch} of the {node} node needs to be connected').format(
225227
node=node.properties.get("stepName"), branch=branch.get("type")))
226228

227229
else:
228230
edge_list = [edge for edge in self.edges if edge.sourceNodeId == node.id]
229-
if len(edge_list) == 0 and not end_nodes.__contains__(node.type):
231+
if not edge_list and node.type not in END_NODES:
230232
raise AppApiException(500, _("{node} Nodes cannot be considered as end nodes").format(
231233
node=node.properties.get("stepName")))
232234

apps/application/flow/compare/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from .start_with import StartWithCompare
3131
from .wildcard_compare import WildcardCompare
3232

33+
from common.utils.logger import maxkb_logger
34+
3335
_compare_handler_dict = {
3436
'is_null': IsNullCompare(),
3537
'is_not_null': IsNotNullCompare(),
@@ -65,13 +67,13 @@ def _compare(source_value, compare, target_value):
6567
def _assertion(workflow_manage, field_list: List[str], compare: str, value):
6668
try:
6769
value = workflow_manage.generate_prompt(value)
68-
except Exception:
69-
pass
70+
except Exception as e:
71+
maxkb_logger.debug(f"Failed to generate field value for comparison: {e}")
7072
field_value = None
7173
try:
7274
field_value = workflow_manage.get_reference_field(field_list[0], field_list[1:])
73-
except Exception:
74-
pass
75+
except Exception as e:
76+
maxkb_logger.debug(f"Failed to get reference field for comparison: {e}")
7577
return _compare(field_value, compare, value)
7678

7779

ui/src/components/execution-detail-card/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
{{ $t('aiChat.executionDetails.currentChat') }}
313313
</h5>
314314
<div class="p-8-12 border-t-dashed lighter pre-wrap">
315-
{{ data.question || '-' }}
315+
{{ data.question || data.user_input || '-' }}
316316
</div>
317317
</div>
318318
<div class="card-never border-r-6 mt-8">

0 commit comments

Comments
 (0)