discourse-ai/lib/personas/tools
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
..
create_artifact.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
create_image.rb FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
custom.rb FEATURE: allow tools to amend personas (#1250) 2025-04-09 15:48:25 +10:00
dall_e.rb FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
db_schema.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
discourse_meta_search.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
edit_image.rb FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
github_file_content.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
github_pull_request_diff.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
github_search_code.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
github_search_files.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
google.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
image.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
javascript_evaluator.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
list_categories.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
list_tags.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
option.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
random_picker.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
read.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
read_artifact.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
search.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
search_settings.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
setting_context.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
summarize.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
time.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
tool.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
update_artifact.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
web_browser.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00