Skip to content

Commit

Permalink
feat: 支持用户输入变量
Browse files Browse the repository at this point in the history
--story=1016155 --user=刘瑞斌 【应用编排】-支持设置用户输入变量 https://www.tapd.cn/57709429/s/1576480
  • Loading branch information
liuruibin committed Sep 10, 2024
1 parent 689e74a commit cd303c7
Show file tree
Hide file tree
Showing 6 changed files with 432 additions and 42 deletions.
14 changes: 10 additions & 4 deletions apps/application/serializers/application_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
Loading

0 comments on commit cd303c7

Please sign in to comment.