Skip to content

Commit 97db41a

Browse files
Revert "fix: Fix intent-node execution details not displaying user input"
This reverts commit 506b8f2.
1 parent 506b8f2 commit 97db41a

7 files changed

Lines changed: 24 additions & 27 deletions

File tree

apps/application/flow/common.py

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

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-
])
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']
2725

2826

2927
class Answer:
@@ -228,7 +226,7 @@ def is_valid_node(self, node: Node):
228226

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

apps/application/flow/compare/__init__.py

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

33-
from common.utils.logger import maxkb_logger
34-
3533
_compare_handler_dict = {
3634
'is_null': IsNullCompare(),
3735
'is_not_null': IsNotNullCompare(),
@@ -67,13 +65,13 @@ def _compare(source_value, compare, target_value):
6765
def _assertion(workflow_manage, field_list: List[str], compare: str, value):
6866
try:
6967
value = workflow_manage.generate_prompt(value)
70-
except Exception as e:
71-
maxkb_logger.debug(f"Failed to generate field value for comparison: {e}")
68+
except Exception:
69+
pass
7270
field_value = None
7371
try:
7472
field_value = workflow_manage.get_reference_field(field_list[0], field_list[1:])
75-
except Exception as e:
76-
maxkb_logger.debug(f"Failed to get reference field for comparison: {e}")
73+
except Exception:
74+
pass
7775
return _compare(field_value, compare, value)
7876

7977

apps/chat/serializers/chat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ def get_chat_record(chat_info, chat_record_id):
385385
chat_record = QuerySet(ChatRecord).filter(id=chat_record_id, chat_id=chat_info.chat_id).first()
386386
if chat_record is None:
387387
raise ChatException(500, _("Conversation record does not exist"))
388+
388389
return chat_record
389390
chat_record = QuerySet(ChatRecord).filter(id=chat_record_id).first()
390391
return chat_record

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 || data.user_input || '-' }}
315+
{{ data.question || '-' }}
316316
</div>
317317
</div>
318318
<div class="card-never border-r-6 mt-8">

ui/src/locales/lang/en-US/workflow.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ export default {
215215
systemDefault: `#Role
216216
You are a master of problem optimization, adept at accurately inferring user intentions based on context and optimizing the questions raised by users.
217217
218-
## Skills
219-
### Skill 1: Optimizing Problems
220-
1. Receive user input questions.
221-
2. Carefully analyze the meaning of the problem based on the context.
222-
3. Output optimized problems.
218+
##Skills
219+
###Skill 1: Optimizing Problems
220+
2. Receive user input questions.
221+
3. Carefully analyze the meaning of the problem based on the context.
222+
4. Output optimized problems.
223223
224-
## Limitations:
225-
- Only return the optimized problem without any additional explanation or clarification.
226-
- Ensure that the optimized problem accurately reflects the original problem intent and does not alter the original intention.`,
224+
##Limitations:
225+
-Only return the optimized problem without any additional explanation or clarification.
226+
-Ensure that the optimized problem accurately reflects the original problem intent and does not alter the original intention.`,
227227
},
228228
conditionNode: {
229229
label: 'Conditional Branch',

ui/src/locales/lang/zh-CN/workflow.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ export default {
217217
218218
## 技能
219219
### 技能 1: 优化问题
220-
1. 接收用户输入的问题。
221-
2. 依据上下文仔细分析问题含义。
222-
3. 输出优化后的问题。
220+
2. 接收用户输入的问题。
221+
3. 依据上下文仔细分析问题含义。
222+
4. 输出优化后的问题。
223223
224224
## 限制:
225225
- 仅返回优化后的问题,不进行额外解释或说明。

ui/src/locales/lang/zh-Hant/workflow.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ export default {
217217
218218
## 技能
219219
### 技能 1: 優化問題
220-
1. 接收用戶輸入的問題。
221-
2. 依據上下文仔細分析問題含義。
222-
3. 輸出優化後的問題。
220+
2. 接收用戶輸入的問題。
221+
3. 依據上下文仔細分析問題含義。
222+
4. 輸出優化後的問題。
223223
224224
## 限制:
225225
- 僅返回優化後的問題,不進行額外解釋或說明。

0 commit comments

Comments
 (0)