diff --git a/api/controllers/service_api/app/audio.py b/api/controllers/service_api/app/audio.py index 60ca2171d52dd9..f6cad501f09264 100644 --- a/api/controllers/service_api/app/audio.py +++ b/api/controllers/service_api/app/audio.py @@ -44,7 +44,7 @@ def post(self, app_model: App, end_user: EndUser): response = AudioService.transcript_asr( tenant_id=app_model.tenant_id, file=file, - end_user=end_user + end_user=end_user.get_id() ) return response @@ -75,7 +75,7 @@ def post(self, app_model: App, end_user: EndUser): class TextApi(Resource): - @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) + @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON)) def post(self, app_model: App, end_user: EndUser): parser = reqparse.RequestParser() parser.add_argument('text', type=str, required=True, nullable=False, location='json') @@ -86,8 +86,8 @@ def post(self, app_model: App, end_user: EndUser): response = AudioService.transcript_tts( tenant_id=app_model.tenant_id, text=args['text'], - end_user=end_user, - voice=args['voice'] if args['voice'] else app_model.app_model_config.text_to_speech_dict.get('voice'), + end_user=end_user.get_id(), + voice=app_model.app_model_config.text_to_speech_dict.get('voice'), streaming=args['streaming'] ) diff --git a/api/models/model.py b/api/models/model.py index d642d9a3978655..8776f896730a07 100644 --- a/api/models/model.py +++ b/api/models/model.py @@ -726,6 +726,7 @@ class MessageFile(db.Model): created_by = db.Column(UUID, nullable=False) created_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)')) + class MessageAnnotation(db.Model): __tablename__ = 'message_annotations' __table_args__ = (