Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM> Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>tags/0.6.15
| @@ -78,10 +78,12 @@ class ChatTextApi(InstalledAppResource): | |||
| parser = reqparse.RequestParser() | |||
| parser.add_argument('message_id', type=str, required=False, location='json') | |||
| parser.add_argument('voice', type=str, location='json') | |||
| parser.add_argument('text', type=str, location='json') | |||
| parser.add_argument('streaming', type=bool, location='json') | |||
| args = parser.parse_args() | |||
| message_id = args.get('message_id') | |||
| message_id = args.get('message_id', None) | |||
| text = args.get('text', None) | |||
| if (app_model.mode in [AppMode.ADVANCED_CHAT.value, AppMode.WORKFLOW.value] | |||
| and app_model.workflow | |||
| and app_model.workflow.features_dict): | |||
| @@ -95,7 +97,8 @@ class ChatTextApi(InstalledAppResource): | |||
| response = AudioService.transcript_tts( | |||
| app_model=app_model, | |||
| message_id=message_id, | |||
| voice=voice | |||
| voice=voice, | |||
| text=text | |||
| ) | |||
| return response | |||
| except services.errors.app_model_config.AppModelConfigBrokenError: | |||
| @@ -76,10 +76,12 @@ class TextApi(Resource): | |||
| parser = reqparse.RequestParser() | |||
| parser.add_argument('message_id', type=str, required=False, location='json') | |||
| parser.add_argument('voice', type=str, location='json') | |||
| parser.add_argument('text', type=str, location='json') | |||
| parser.add_argument('streaming', type=bool, location='json') | |||
| args = parser.parse_args() | |||
| message_id = args.get('message_id') | |||
| message_id = args.get('message_id', None) | |||
| text = args.get('text', None) | |||
| if (app_model.mode in [AppMode.ADVANCED_CHAT.value, AppMode.WORKFLOW.value] | |||
| and app_model.workflow | |||
| and app_model.workflow.features_dict): | |||
| @@ -87,15 +89,15 @@ class TextApi(Resource): | |||
| voice = args.get('voice') if args.get('voice') else text_to_speech.get('voice') | |||
| else: | |||
| try: | |||
| voice = args.get('voice') if args.get('voice') else app_model.app_model_config.text_to_speech_dict.get( | |||
| 'voice') | |||
| voice = args.get('voice') if args.get('voice') else app_model.app_model_config.text_to_speech_dict.get('voice') | |||
| except Exception: | |||
| voice = None | |||
| response = AudioService.transcript_tts( | |||
| app_model=app_model, | |||
| message_id=message_id, | |||
| end_user=end_user.external_user_id, | |||
| voice=voice | |||
| voice=voice, | |||
| text=text | |||
| ) | |||
| return response | |||
| @@ -74,10 +74,12 @@ class TextApi(WebApiResource): | |||
| parser = reqparse.RequestParser() | |||
| parser.add_argument('message_id', type=str, required=False, location='json') | |||
| parser.add_argument('voice', type=str, location='json') | |||
| parser.add_argument('text', type=str, location='json') | |||
| parser.add_argument('streaming', type=bool, location='json') | |||
| args = parser.parse_args() | |||
| message_id = args.get('message_id') | |||
| message_id = args.get('message_id', None) | |||
| text = args.get('text', None) | |||
| if (app_model.mode in [AppMode.ADVANCED_CHAT.value, AppMode.WORKFLOW.value] | |||
| and app_model.workflow | |||
| and app_model.workflow.features_dict): | |||
| @@ -94,7 +96,8 @@ class TextApi(WebApiResource): | |||
| app_model=app_model, | |||
| message_id=message_id, | |||
| end_user=end_user.external_user_id, | |||
| voice=voice | |||
| voice=voice, | |||
| text=text | |||
| ) | |||
| return response | |||