fix: tts voice base url

This commit is contained in:
zhayujie
2023-12-06 00:31:31 +08:00
parent 88fb3dbf60
commit e5ba26febe
2 changed files with 5 additions and 2 deletions

View File

@@ -33,7 +33,8 @@ class OpenaiVoice(Voice):
def textToVoice(self, text):
try:
url = 'https://api.openai.com/v1/audio/speech'
api_base = conf().get("open_ai_api_base") or "https://api.openai.com/v1"
url = f'{api_base}/audio/speech'
headers = {
'Authorization': 'Bearer ' + conf().get("open_ai_api_key"),
'Content-Type': 'application/json'