chore: format

This commit is contained in:
Timothy Jaeryang Baek
2024-11-26 01:05:50 -08:00
parent 3b9e21ecf9
commit a37cad2ecf
49 changed files with 281 additions and 9 deletions

View File

@@ -299,12 +299,12 @@ async def speech(request: Request, user=Depends(get_verified_user)):
async with session.post(
url=f"{app.state.config.TTS_OPENAI_API_BASE_URL}/audio/speech",
data=body,
headers=headers
headers=headers,
) as r:
r.raise_for_status()
async with aiofiles.open(file_path, "wb") as f:
await f.write(await r.read())
async with aiofiles.open(file_body_path, "w") as f:
await f.write(json.dumps(json.loads(body.decode("utf-8"))))
@@ -322,7 +322,7 @@ async def speech(request: Request, user=Depends(get_verified_user)):
error_detail = f"External: {e}"
raise HTTPException(
status_code=getattr(r, 'status', 500),
status_code=getattr(r, "status", 500),
detail=error_detail,
)
@@ -358,7 +358,7 @@ async def speech(request: Request, user=Depends(get_verified_user)):
r.raise_for_status()
async with aiofiles.open(file_path, "wb") as f:
await f.write(await r.read())
async with aiofiles.open(file_body_path, "w") as f:
await f.write(json.dumps(json.loads(body.decode("utf-8"))))
@@ -376,7 +376,7 @@ async def speech(request: Request, user=Depends(get_verified_user)):
error_detail = f"External: {e}"
raise HTTPException(
status_code=getattr(r, 'status', 500),
status_code=getattr(r, "status", 500),
detail=error_detail,
)