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