mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
chore: format
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user