|
@@ -337,7 +337,10 @@ 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=urljoin(
|
|
|
+ request.app.state.config.TTS_OPENAI_API_BASE_URL,
|
|
|
+ "/audio/speech",
|
|
|
+ ),
|
|
|
json=payload,
|
|
|
headers={
|
|
|
"Content-Type": "application/json",
|
|
@@ -465,7 +468,10 @@ 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"),
|
|
|
+ urljoin(
|
|
|
+ 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",
|