diff --git a/apps/application/flow/step_node/start_node/i_start_node.py b/apps/application/flow/step_node/start_node/i_start_node.py index 4c1ecfd2a..bb23ad3f5 100644 --- a/apps/application/flow/step_node/start_node/i_start_node.py +++ b/apps/application/flow/step_node/start_node/i_start_node.py @@ -16,9 +16,6 @@ from application.flow.i_step_node import INode, NodeResult class IStarNode(INode): type = 'start-node' - def get_node_params_serializer_class(self) -> Type[serializers.Serializer] | None: - return None - def _run(self): return self.execute(**self.flow_params_serializer.data) diff --git a/apps/application/flow/step_node/start_node/impl/base_start_node.py b/apps/application/flow/step_node/start_node/impl/base_start_node.py index dc4fb541c..f6528660d 100644 --- a/apps/application/flow/step_node/start_node/impl/base_start_node.py +++ b/apps/application/flow/step_node/start_node/impl/base_start_node.py @@ -15,11 +15,16 @@ from application.flow.step_node.start_node.i_start_node import IStarNode class BaseStartStepNode(IStarNode): def execute(self, question, **kwargs) -> NodeResult: + history_chat_record = self.flow_params_serializer.data.get('history_chat_record', []) + history_context = [{'question': chat_record.problem_text, 'answer': chat_record.answer_text} for chat_record in + history_chat_record] + chat_id = self.flow_params_serializer.data.get('chat_id') """ 开始节点 初始化全局变量 """ return NodeResult({'question': question}, - {'time': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'start_time': time.time()}) + {'time': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'start_time': time.time(), + 'history_context': history_context, 'chat_id': str(chat_id)}) def get_details(self, index: int, **kwargs): global_fields = [] diff --git a/ui/src/workflow/nodes/start-node/index.vue b/ui/src/workflow/nodes/start-node/index.vue index a91e98cbb..e50a109a4 100644 --- a/ui/src/workflow/nodes/start-node/index.vue +++ b/ui/src/workflow/nodes/start-node/index.vue @@ -2,25 +2,18 @@
全局变量
- 当前时间 {time} + {{ item.label }} {{ '{' + item.value + '}' }} - - - - -
-
- {{ item.name }} {{ '{' + item.variable + '}' }} - - + @@ -28,42 +21,36 @@