chore: format

This commit is contained in:
Timothy Jaeryang Baek
2025-06-28 15:21:20 +04:00
parent e06cdea0b5
commit 1b064a6c85
58 changed files with 289 additions and 61 deletions

View File

@@ -36,7 +36,9 @@ def search_brave(
return [
SearchResult(
link=result["url"], title=result.get("title"), snippet=result.get("description")
link=result["url"],
title=result.get("title"),
snippet=result.get("description"),
)
for result in results[:count]
]

View File

@@ -303,10 +303,12 @@ async def update_image_config(
):
set_image_model(request, form_data.MODEL)
if (form_data.IMAGE_SIZE == "auto" and form_data.MODEL != 'gpt-image-1'):
if form_data.IMAGE_SIZE == "auto" and form_data.MODEL != "gpt-image-1":
raise HTTPException(
status_code=400,
detail=ERROR_MESSAGES.INCORRECT_FORMAT(" (auto is only allowed with gpt-image-1).")
detail=ERROR_MESSAGES.INCORRECT_FORMAT(
" (auto is only allowed with gpt-image-1)."
),
)
pattern = r"^\d+x\d+$"
@@ -483,7 +485,7 @@ async def image_generations(
# image model other than gpt-image-1, which is warned about on settings save
width, height = (
tuple(map(int, request.app.state.config.IMAGE_SIZE.split("x")))
if 'x' in request.app.state.config.IMAGE_SIZE
if "x" in request.app.state.config.IMAGE_SIZE
else (512, 512)
)