From cd303c7051cbabc85109db19e26fd5857e4d2fdd Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 9 Sep 2024 19:10:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1016155 --user=刘瑞斌 【应用编排】-支持设置用户输入变量 https://www.tapd.cn/57709429/s/1576480 --- .../serializers/application_serializers.py | 14 +- ui/src/components/ai-chat/index.vue | 175 ++++++++++++++---- .../dynamics-form/items/DatePicker.vue | 5 + .../base-node/component/FieldFormDialog.vue | 159 ++++++++++++++++ ui/src/workflow/nodes/base-node/index.vue | 88 +++++++++ ui/src/workflow/nodes/start-node/index.vue | 33 +++- 6 files changed, 432 insertions(+), 42 deletions(-) create mode 100644 ui/src/components/dynamics-form/items/DatePicker.vue create mode 100644 ui/src/workflow/nodes/base-node/component/FieldFormDialog.vue diff --git a/apps/application/serializers/application_serializers.py b/apps/application/serializers/application_serializers.py index 4dd65d1226..7eab38f90c 100644 --- a/apps/application/serializers/application_serializers.py +++ b/apps/application/serializers/application_serializers.py @@ -694,6 +694,7 @@ def profile(self, with_valid=True): 'tts_model_id': application.tts_model_id, 'stt_model_enable': application.stt_model_enable, 'tts_model_enable': application.tts_model_enable, + 'work_flow': application.work_flow, 'show_source': application_access_token.show_source}) @transaction.atomic @@ -855,10 +856,15 @@ def get_work_flow_model(instance): nodes = instance.get('work_flow')['nodes'] for node in nodes: if node['id'] == 'base-node': - instance['stt_model_id'] = node['properties']['node_data']['stt_model_id'] - instance['tts_model_id'] = node['properties']['node_data']['tts_model_id'] - instance['stt_model_enable'] = node['properties']['node_data']['stt_model_enable'] - instance['tts_model_enable'] = node['properties']['node_data']['tts_model_enable'] + node_data = node['properties']['node_data'] + if 'stt_model_id' in node_data: + instance['stt_model_id'] = node_data['stt_model_id'] + if 'tts_model_id' in node_data: + instance['tts_model_id'] = node_data['tts_model_id'] + if 'stt_model_enable' in node_data: + instance['stt_model_enable'] = node_data['stt_model_enable'] + if 'tts_model_enable' in node_data: + instance['tts_model_enable'] = node_data['tts_model_enable'] break def speech_to_text(self, file, with_valid=True): diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 1d5a942692..7a75f994f3 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -17,7 +17,9 @@ class="problem-button ellipsis-2 mb-8" :class="log ? 'disabled' : 'cursor'" > - + + + {{ item.str }} +
+
+ + +
+
+ + + +
+
+