mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: The tool in the application export loop body has not been exported (#4177)
This commit is contained in:
parent
e4ac7783e3
commit
301785bfda
|
|
@ -683,7 +683,10 @@ class ApplicationOperateSerializer(serializers.Serializer):
|
|||
application = QuerySet(Application).filter(id=application_id).first()
|
||||
tool_id_list = [node.get('properties', {}).get('node_data', {}).get('tool_lib_id') for node
|
||||
in
|
||||
application.work_flow.get('nodes', []) if
|
||||
application.work_flow.get('nodes', []) + reduce(lambda x, y: [*x, *y], [
|
||||
n.get('properties', {}).get('node_data', {}).get('loop_body', {}).get('nodes', []) for n
|
||||
in
|
||||
application.work_flow.get('nodes', []) if n.get('type') == 'loop-node'], []) if
|
||||
node.get('type') == 'tool-lib-node']
|
||||
tool_list = []
|
||||
if len(tool_id_list) > 0:
|
||||
|
|
@ -760,7 +763,7 @@ class ApplicationOperateSerializer(serializers.Serializer):
|
|||
work_flow_version.save()
|
||||
access_token = hashlib.md5(
|
||||
str(uuid.uuid7()).encode()).hexdigest()[
|
||||
8:24]
|
||||
8:24]
|
||||
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
||||
application_id=application.id).first()
|
||||
if application_access_token is None:
|
||||
|
|
@ -965,7 +968,8 @@ class ApplicationOperateSerializer(serializers.Serializer):
|
|||
application = QuerySet(ApplicationVersion).filter(application_id=application_id).order_by(
|
||||
'-create_time').first()
|
||||
if application.stt_model_enable:
|
||||
model = get_model_instance_by_model_workspace_id(application.stt_model_id, application.workspace_id, **application.stt_model_params_setting)
|
||||
model = get_model_instance_by_model_workspace_id(application.stt_model_id, application.workspace_id,
|
||||
**application.stt_model_params_setting)
|
||||
text = model.speech_to_text(instance.get('file'))
|
||||
return text
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue