Skip to content

Commit 5299f12

Browse files
authored
feat: AI dialogue roles support obtaining data from other nodes (#1925)
1 parent 5942f84 commit 5299f12

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def execute(self, model_id, system, prompt, dialogue_number, history_chat_record
110110
self.context['history_message'] = history_message
111111
question = self.generate_prompt_question(prompt)
112112
self.context['question'] = question.content
113+
system = self.workflow_manage.generate_prompt(system)
114+
self.context['system'] = question.content
113115
message_list = self.generate_message_list(system, prompt, history_message)
114116
self.context['message_list'] = message_list
115117
if stream:
@@ -156,7 +158,7 @@ def get_details(self, index: int, **kwargs):
156158
'name': self.node.properties.get('stepName'),
157159
"index": index,
158160
'run_time': self.context.get('run_time'),
159-
'system': self.node_params.get('system'),
161+
'system': self.context.get('system'),
160162
'history_message': [{'content': message.content, 'role': message.type} for message in
161163
(self.context.get('history_message') if self.context.get(
162164
'history_message') is not None else [])],

apps/application/flow/step_node/question_node/impl/base_question_node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def execute(self, model_id, system, prompt, dialogue_number, history_chat_record
9292
self.context['history_message'] = history_message
9393
question = self.generate_prompt_question(prompt)
9494
self.context['question'] = question.content
95+
system = self.workflow_manage.generate_prompt(system)
96+
self.context['system'] = question.content
9597
message_list = self.generate_message_list(system, prompt, history_message)
9698
self.context['message_list'] = message_list
9799
if stream:
@@ -138,7 +140,7 @@ def get_details(self, index: int, **kwargs):
138140
'name': self.node.properties.get('stepName'),
139141
"index": index,
140142
'run_time': self.context.get('run_time'),
141-
'system': self.node_params.get('system'),
143+
'system': self.context.get('system'),
142144
'history_message': [{'content': message.content, 'role': message.type} for message in
143145
(self.context.get('history_message') if self.context.get(
144146
'history_message') is not None else [])],

0 commit comments

Comments
 (0)