fix: openai audio revert
This commit is contained in:
@@ -337,10 +337,7 @@ async def speech(request: Request, user=Depends(get_verified_user)):
|
|||||||
timeout=timeout, trust_env=True
|
timeout=timeout, trust_env=True
|
||||||
) as session:
|
) as session:
|
||||||
r = await session.post(
|
r = await session.post(
|
||||||
url=urljoin(
|
url=f"{request.app.state.config.TTS_OPENAI_API_BASE_URL}/audio/speech",
|
||||||
request.app.state.config.TTS_OPENAI_API_BASE_URL,
|
|
||||||
"/audio/speech",
|
|
||||||
),
|
|
||||||
json=payload,
|
json=payload,
|
||||||
headers={
|
headers={
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@@ -468,10 +465,8 @@ async def speech(request: Request, user=Depends(get_verified_user)):
|
|||||||
timeout=timeout, trust_env=True
|
timeout=timeout, trust_env=True
|
||||||
) as session:
|
) as session:
|
||||||
async with session.post(
|
async with session.post(
|
||||||
urljoin(
|
(base_url or f"https://{region}.tts.speech.microsoft.com")
|
||||||
base_url or f"https://{region}.tts.speech.microsoft.com",
|
+ "/cognitiveservices/v1",
|
||||||
"/cognitiveservices/v1",
|
|
||||||
),
|
|
||||||
headers={
|
headers={
|
||||||
"Ocp-Apim-Subscription-Key": request.app.state.config.TTS_API_KEY,
|
"Ocp-Apim-Subscription-Key": request.app.state.config.TTS_API_KEY,
|
||||||
"Content-Type": "application/ssml+xml",
|
"Content-Type": "application/ssml+xml",
|
||||||
|
|||||||
Reference in New Issue
Block a user