mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 00:39:04 +08:00
Fix tts api err (#2809)
Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM> Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
parent
510f8ede10
commit
fd7aade26b
@ -44,7 +44,7 @@ class AudioApi(Resource):
|
|||||||
response = AudioService.transcript_asr(
|
response = AudioService.transcript_asr(
|
||||||
tenant_id=app_model.tenant_id,
|
tenant_id=app_model.tenant_id,
|
||||||
file=file,
|
file=file,
|
||||||
end_user=end_user
|
end_user=end_user.get_id()
|
||||||
)
|
)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
@ -75,7 +75,7 @@ class AudioApi(Resource):
|
|||||||
|
|
||||||
|
|
||||||
class TextApi(Resource):
|
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):
|
def post(self, app_model: App, end_user: EndUser):
|
||||||
parser = reqparse.RequestParser()
|
parser = reqparse.RequestParser()
|
||||||
parser.add_argument('text', type=str, required=True, nullable=False, location='json')
|
parser.add_argument('text', type=str, required=True, nullable=False, location='json')
|
||||||
@ -86,8 +86,8 @@ class TextApi(Resource):
|
|||||||
response = AudioService.transcript_tts(
|
response = AudioService.transcript_tts(
|
||||||
tenant_id=app_model.tenant_id,
|
tenant_id=app_model.tenant_id,
|
||||||
text=args['text'],
|
text=args['text'],
|
||||||
end_user=end_user,
|
end_user=end_user.get_id(),
|
||||||
voice=args['voice'] if args['voice'] else app_model.app_model_config.text_to_speech_dict.get('voice'),
|
voice=app_model.app_model_config.text_to_speech_dict.get('voice'),
|
||||||
streaming=args['streaming']
|
streaming=args['streaming']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -726,6 +726,7 @@ class MessageFile(db.Model):
|
|||||||
created_by = db.Column(UUID, nullable=False)
|
created_by = db.Column(UUID, nullable=False)
|
||||||
created_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)'))
|
created_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)'))
|
||||||
|
|
||||||
|
|
||||||
class MessageAnnotation(db.Model):
|
class MessageAnnotation(db.Model):
|
||||||
__tablename__ = 'message_annotations'
|
__tablename__ = 'message_annotations'
|
||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user