Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
c7e5ba1e
Commit
c7e5ba1e
authored
Mar 06, 2024
by
takatost
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix audio voice arg
parent
46216565
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
audio_service.py
api/services/audio_service.py
+4
-3
No files found.
api/services/audio_service.py
View file @
c7e5ba1e
...
...
@@ -64,7 +64,8 @@ class AudioService:
return
{
"text"
:
model_instance
.
invoke_speech2text
(
file
=
buffer
,
user
=
end_user
)}
@
classmethod
def
transcript_tts
(
cls
,
app_model
:
App
,
text
:
str
,
streaming
:
bool
,
end_user
:
Optional
[
str
]
=
None
):
def
transcript_tts
(
cls
,
app_model
:
App
,
text
:
str
,
streaming
:
bool
,
voice
:
Optional
[
str
]
=
None
,
end_user
:
Optional
[
str
]
=
None
):
if
app_model
.
mode
in
[
AppMode
.
ADVANCED_CHAT
.
value
,
AppMode
.
WORKFLOW
.
value
]:
workflow
=
app_model
.
workflow
if
workflow
is
None
:
...
...
@@ -74,14 +75,14 @@ class AudioService:
if
'text_to_speech'
not
in
features_dict
or
not
features_dict
[
'text_to_speech'
]
.
get
(
'enabled'
):
raise
ValueError
(
"TTS is not enabled"
)
voice
=
features_dict
[
'text_to_speech'
]
.
get
(
'voice'
)
voice
=
features_dict
[
'text_to_speech'
]
.
get
(
'voice'
)
if
voice
is
None
else
voice
else
:
text_to_speech_dict
=
app_model
.
app_model_config
.
text_to_speech_dict
if
not
text_to_speech_dict
.
get
(
'enabled'
):
raise
ValueError
(
"TTS is not enabled"
)
voice
=
text_to_speech_dict
.
get
(
'voice'
)
,
voice
=
text_to_speech_dict
.
get
(
'voice'
)
if
voice
is
None
else
voice
model_manager
=
ModelManager
()
model_instance
=
model_manager
.
get_default_model_instance
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment