discourse-ai/lib/completions
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
..
dialects FEATURE: flexible image handling within messages (#1214) 2025-03-31 12:39:07 -03:00
endpoints FEATURE: allow specifying tool use none in completion prompt 2025-03-25 08:06:43 +11:00
anthropic_message_processor.rb FEATURE: implement thinking token support (#1155) 2025-03-04 12:22:30 +11:00
json_stream_decoder.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
json_streaming_parser.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
llm.rb FEATURE: Add spending metrics to AI usage (#1268) 2025-04-17 15:09:48 -07:00
nova_message_processor.rb FEATURE: Amazon Nova support via bedrock (#997) 2024-12-06 07:45:58 +11:00
open_ai_message_processor.rb FEATURE: AI Usage page (#964) 2024-11-29 06:26:48 +11:00
prompt.rb FEATURE: flexible image handling within messages (#1214) 2025-03-31 12:39:07 -03:00
prompt_messages_builder.rb FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
report.rb FEATURE: Allow for persona & llm selection in bot conversations page (#1276) 2025-04-24 11:17:24 -05:00
thinking.rb FEATURE: implement thinking token support (#1155) 2025-03-04 12:22:30 +11:00
tool_call.rb FEATURE: AI artifacts (#898) 2024-11-19 09:22:39 +11:00
tool_call_progress_tracker.rb FEATURE: AI artifacts (#898) 2024-11-19 09:22:39 +11:00
upload_encoder.rb FEATURE: Add vision support to AI personas (Claude 3) (#546) 2024-03-27 14:30:11 +11:00
xml_tag_stripper.rb FIX: display search correctly, bug when stripping XML (#668) 2024-06-14 15:28:40 +10:00
xml_tool_processor.rb FEATURE: AI artifacts (#898) 2024-11-19 09:22:39 +11:00