mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-28 10:26:32 +02:00
feat: update text_to_image skill
This commit is contained in:
parent
3715a69e3f
commit
df5a50f6e6
1 changed files with 3 additions and 2 deletions
|
|
@ -12,7 +12,8 @@ from metagpt.tools.azure_tts import oas3_azsure_tts
|
|||
from metagpt.utils.common import initialize_environment
|
||||
|
||||
|
||||
def text_to_speech(text, lang="zh-CN", voice="zh-CN-XiaomoNeural", style="affectionate", role="Girl", subscription_key="", region=""):
|
||||
def text_to_speech(text, lang="zh-CN", voice="zh-CN-XiaomoNeural", style="affectionate", role="Girl",
|
||||
subscription_key="", region=""):
|
||||
"""Text to speech
|
||||
For more details, check out:`https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts`
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ def text_to_speech(text, lang="zh-CN", voice="zh-CN-XiaomoNeural", style="affect
|
|||
"""
|
||||
initialize_environment()
|
||||
if (os.environ.get("AZURE_TTS_SUBSCRIPTION_KEY") and os.environ.get("AZURE_TTS_REGION")) or \
|
||||
(subscription_key and region):
|
||||
(subscription_key and region):
|
||||
return oas3_azsure_tts(text, lang, voice, style, role, subscription_key, region)
|
||||
|
||||
raise EnvironmentError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue