discourse-ai/lib
Sam 17f04c76d8
FEATURE: add OpenAI image generation and editing capabilities (#1293)
This commit enhances the AI image generation functionality by adding support for:

1. OpenAI's GPT-based image generation model (gpt-image-1)
2. Image editing capabilities through the OpenAI API
3. A new "Designer" persona specialized in image generation and editing
4. Two new AI tools: CreateImage and EditImage

Technical changes include:
- Renaming `ai_openai_dall_e_3_url` to `ai_openai_image_generation_url` with a migration
- Adding `ai_openai_image_edit_url` setting for the image edit API endpoint
- Refactoring image generation code to handle both DALL-E and the newer GPT models
- Supporting multipart/form-data for image editing requests

* wild guess but maybe quantization is breaking the test sometimes

this increases distance

* Update lib/personas/designer.rb

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>

* simplify and de-flake code

* fix, in chat we need enough context so we know exactly what uploads a user uploaded.

* Update lib/personas/tools/edit_image.rb

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>

* cleanup downloaded files right away

* fix implementation

---------

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-04-29 17:38:54 +10:00
..
ai_bot FEATURE: Allow for persona & llm selection in bot conversations page (#1276) 2025-04-24 11:17:24 -05:00
ai_helper FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
ai_moderation FEATURE: flexible image handling within messages (#1214) 2025-03-31 12:39:07 -03:00
automation FEATURE: allow to send LLM reports to groups (#1246) 2025-04-07 15:31:30 +10:00
completions FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
configuration FEATURE: display more places where AI is used / Chat streamer (#1278) 2025-04-24 16:22:19 +10:00
database DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
discord/bot FEATURE: Personas powered summaries. (#1232) 2025-04-02 12:54:47 -03:00
embeddings FIX: Ensure that we shutdown thread pool (#1207) 2025-03-21 11:08:36 +08:00
inference FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
personas FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
sentiment FIX: Ensure category badging present in sentiment reports (#1222) 2025-03-26 12:37:41 -07:00
summarization FEATURE: Personas powered summaries. (#1232) 2025-04-02 12:54:47 -03:00
tasks DEV: rake task to populate sentiment in dev env (#1176) 2025-03-10 14:21:00 -03:00
tokenizer FEATURE: Gemini Tokenizer (#1088) 2025-01-23 18:20:35 -03:00
utils FIX: various issues with llm and triage management (#1186) 2025-03-12 18:32:02 +11:00
automation.rb FEATURE: Add persona-based replies and whisper support to LLM triage (#1170) 2025-03-06 17:18:15 +11:00
embeddings.rb DEV: Robust check for embeddings enabled (#1116) 2025-02-06 12:18:55 -03:00
engine.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
features.rb FEATURE: Configure persona backed features in admin panel (#1245) 2025-04-10 08:16:31 -07:00
guardian_extensions.rb FIX: Restore gists previous group access behavior. (#1247) 2025-04-07 12:04:30 -03:00
multisite_hash.rb FIX: properly cache user locale (#593) 2024-04-26 09:28:35 -03:00
post_extensions.rb FEATURE: Backfill posts sentiment. (#982) 2024-12-03 10:27:03 -03:00
summarization.rb FEATURE: Personas powered summaries. (#1232) 2025-04-02 12:54:47 -03:00
topic_extensions.rb PERF: Preload only gists when including summaries in topic list (#948) 2024-11-25 12:24:02 -03:00