From 574916e7120e13becab6c694e8c6ae7edd80d256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Thu, 4 Jun 2026 11:05:29 +0800 Subject: [PATCH] perf: In the execution details of `Image Understanding`, correctly display the system prompt after variable replacement --- .../impl/base_image_understand_node.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py b/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py index ef7ff1534bd..fd264555d7b 100644 --- a/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py +++ b/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py @@ -164,6 +164,9 @@ def execute(self, model_id, system, prompt, dialogue_number, dialogue_type, hist self.context['history_message'] = history_message question = self.generate_prompt_question(prompt) self.context['question'] = question.content + # 生成系统提示(变量替换) + system = self.workflow_manage.generate_prompt(system) if system else '' + self.context['system'] = system # 生成消息列表, 真实的history_message message_list = self.generate_message_list(image_model, system, prompt, self.get_history_message(history_chat_record, dialogue_number), image) @@ -296,7 +299,7 @@ def generate_message_list(self, image_model, system: str, prompt: str, history_m if system is not None and len(system) > 0: return [ - SystemMessage(self.workflow_manage.generate_prompt(system)), + SystemMessage(system), *history_message, *messages ] @@ -320,7 +323,7 @@ def get_details(self, index: int, **kwargs): 'name': self.node.properties.get('stepName'), "index": index, 'run_time': self.context.get('run_time'), - 'system': self.node_params.get('system'), + 'system': self.context.get('system'), 'history_message': [{'content': message.content, 'role': message.type} for message in (self.context.get('history_message') if self.context.get( 'history_message') is not None else [])],