discourse-ai/lib/inference
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
..
cloudflare_workers_ai.rb FEATURE: configurable embeddings (#1049) 2025-01-21 12:23:19 -03:00
discourse_reranker.rb SECURITY: Place a SSRF protection when calling services from the plugin. (#485) 2024-02-21 17:14:50 -03:00
gemini_embeddings.rb FEATURE: configurable embeddings (#1049) 2025-01-21 12:23:19 -03:00
hugging_face_text_embeddings.rb DEV: Build sentiment clients outside of promises (#1117) 2025-02-06 13:11:10 -03:00
open_ai_embeddings.rb FEATURE: configurable embeddings (#1049) 2025-01-21 12:23:19 -03:00
open_ai_image_generator.rb FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
stability_generator.rb FEATURE: Stable diffusion 3 support (#582) 2024-04-19 18:08:16 +10:00