Skip to content

Commit df785d9

Browse files
perf: In the execution details of Image Understanding, correctly display the system prompt after variable replacement
1 parent 38b1437 commit df785d9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ def execute(self, model_id, system, prompt, dialogue_number, dialogue_type, hist
164164
self.context['history_message'] = history_message
165165
question = self.generate_prompt_question(prompt)
166166
self.context['question'] = question.content
167+
# 生成系统提示(变量替换)
168+
system = self.workflow_manage.generate_prompt(system)
169+
self.context['system'] = system
167170
# 生成消息列表, 真实的history_message
168171
message_list = self.generate_message_list(image_model, system, prompt,
169172
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
296299

297300
if system is not None and len(system) > 0:
298301
return [
299-
SystemMessage(self.workflow_manage.generate_prompt(system)),
302+
SystemMessage(system),
300303
*history_message,
301304
*messages
302305
]
@@ -320,7 +323,7 @@ def get_details(self, index: int, **kwargs):
320323
'name': self.node.properties.get('stepName'),
321324
"index": index,
322325
'run_time': self.context.get('run_time'),
323-
'system': self.node_params.get('system'),
326+
'system': self.context.get('system'),
324327
'history_message': [{'content': message.content, 'role': message.type} for message in
325328
(self.context.get('history_message') if self.context.get(
326329
'history_message') is not None else [])],

0 commit comments

Comments
 (0)