presenton/servers/fastapi/utils
Christopher Quenneville f2703ec003 feat: add Open WebUI as image generation provider
Add native support for Open WebUI's image generation API as a new
image provider option. Open WebUI exposes an OpenAI-like
/v1/images/generations endpoint but with key differences that
require special handling:

- Response is a bare JSON array instead of {"data": [...]}
- Image URLs are relative paths (e.g. /api/v1/files/.../content)
- File downloads require the same Bearer auth token

The implementation uses raw HTTP calls via aiohttp rather than the
OpenAI SDK to handle these differences. No model parameter is sent
since Open WebUI manages the image model in its own admin settings.

Backend changes:
- New OPEN_WEBUI enum value in ImageProvider
- generate_image_open_webui() method in ImageGenerationService
- Environment getters/setters for OPEN_WEBUI_IMAGE_URL and
  OPEN_WEBUI_IMAGE_API_KEY
- UserConfig model and config loading/saving pipeline updated

Frontend changes:
- New "Open WebUI" option in image provider dropdown
- Settings UI with URL and optional API key fields
- Validation, field mappings, and config persistence

Docker:
- OPEN_WEBUI_IMAGE_URL and OPEN_WEBUI_IMAGE_API_KEY added to all
  docker-compose service definitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 12:27:45 -05:00
..
llm_calls feat: enhance LLMClient with Codex integration and error handling 2026-02-25 17:56:39 +05:45
oauth feat: implement Codex OAuth flow and integrate into application 2026-02-24 18:51:35 +05:45
__init__.py feat(fastapi): adds get presentation from id endpoint 2025-07-17 00:27:49 +05:45
asset_directory_utils.py refactor: streamline image path resolution in FastAPI endpoints and PPTX presentation creator using new utility function 2026-03-08 21:08:27 +05:45
async_iterator.py fix(fastapi): uses google genai client for gemini calls 2025-07-16 20:43:20 +05:45
available_models.py feat(fastapi): adds strict support for every schemas, proper models check, refactor 2025-08-01 00:15:03 +05:45
datetime_utils.py feat: adds tone, verbosity and refactors tables 2025-08-29 10:52:34 +05:45
db_utils.py fix: adds support for sslmode and other params in database url 2025-08-16 20:48:42 +05:45
dict_utils.py feat(fastapi): adds strict support for every schemas, proper models check, refactor 2025-08-01 00:15:03 +05:45
download_helpers.py feat: adds tone, verbosity and refactors tables 2025-08-29 10:52:34 +05:45
dummy_functions.py feat(fastapi): generate and stream implementation for openai with agentic behavior 2025-08-08 02:49:51 +05:45
error_handling.py fix(fastapi+nextjs): provides default height and width if not available, provides presentation json in sse complete response in outlines 2025-07-26 02:13:54 +05:45
export_utils.py fix(fastapi): /edit, /derive and /export endpoints 2025-09-12 02:27:59 +05:45
file_utils.py feat: adds table of contents, title slide, web search options in both UI and API Endpoints 2025-09-07 22:06:22 +05:45
get_dynamic_models.py feat: update Codex model versions and enhance content length limits 2026-03-27 18:30:03 +05:45
get_env.py feat: add Open WebUI as image generation provider 2026-04-05 12:27:45 -05:00
get_layout_by_name.py fix(fastapi): /edit, /derive and /export endpoints 2025-09-12 02:27:59 +05:45
image_provider.py feat: add Open WebUI as image generation provider 2026-04-05 12:27:45 -05:00
image_utils.py fix(nextjs+fastapi): adds invert in pptx picture box model, which when set inverts the image during export 2025-07-26 20:25:29 +05:45
llm_client_error_handler.py feat(fastapi): uses better json loader that parses dirty json 2025-09-12 01:28:59 +05:45
llm_provider.py feat: implement Codex OAuth flow and integrate into application 2026-02-24 18:51:35 +05:45
model_availability.py feat: adds gpt image 1.5 2025-12-21 01:14:31 +05:45
ollama.py fix: default ollama url 2025-11-28 02:56:33 +05:45
parsers.py feat: adds options to select between tool calls/json schema and enable disable thinking for custom models 2025-08-04 14:50:55 +05:45
ppt_utils.py feat: adds table of contents, title slide, web search options in both UI and API Endpoints 2025-09-07 22:06:22 +05:45
process_slides.py fix: add fallback to placeholder icon when no icon is found in slide processing 2026-01-04 17:49:22 +05:45
schema_utils.py feat: update version to 0.6.1-beta and ensure array schemas have items in JSON responses 2026-03-02 17:11:25 +05:45
set_env.py feat: add Open WebUI as image generation provider 2026-04-05 12:27:45 -05:00
theme_utils.py feat: add theme management endpoints, integrate color palette generation and UI implementation 2026-03-02 23:15:15 +05:45
user_config.py feat: add Open WebUI as image generation provider 2026-04-05 12:27:45 -05:00
validators.py fix(fastapi): fix /generate enpoint to take form data, reduced database calls and makes assets fetch more efficient 2025-07-29 09:30:58 +05:45