Skip to content

Commit 9867a58

Browse files
fix
1 parent 97db41a commit 9867a58

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

apps/application/flow/common.py

Lines changed: 6 additions & 4 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:
@@ -226,7 +228,7 @@ def is_valid_node(self, node: Node):
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 len(edge_list) == 0 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)