diff --git a/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py b/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py index af68c3131ae..ead083364e8 100644 --- a/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py +++ b/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py @@ -110,6 +110,8 @@ def execute(self, model_id, system, prompt, dialogue_number, history_chat_record self.context['history_message'] = history_message question = self.generate_prompt_question(prompt) self.context['question'] = question.content + system = self.workflow_manage.generate_prompt(system) + self.context['system'] = question.content message_list = self.generate_message_list(system, prompt, history_message) self.context['message_list'] = message_list if stream: @@ -156,7 +158,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 [])], diff --git a/apps/application/flow/step_node/question_node/impl/base_question_node.py b/apps/application/flow/step_node/question_node/impl/base_question_node.py index f69cb912cb7..f67206bdaf6 100644 --- a/apps/application/flow/step_node/question_node/impl/base_question_node.py +++ b/apps/application/flow/step_node/question_node/impl/base_question_node.py @@ -92,6 +92,8 @@ def execute(self, model_id, system, prompt, dialogue_number, history_chat_record self.context['history_message'] = history_message question = self.generate_prompt_question(prompt) self.context['question'] = question.content + system = self.workflow_manage.generate_prompt(system) + self.context['system'] = question.content message_list = self.generate_message_list(system, prompt, history_message) self.context['message_list'] = message_list if stream: @@ -138,7 +140,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 [])],