discourse-ai/app/models
Sam 61e4c56e1a
FEATURE: Add vision support to AI personas (Claude 3) (#546)
This commit adds the ability to enable vision for AI personas, allowing them to understand images that are posted in the conversation.

For personas with vision enabled, any images the user has posted will be resized to be within the configured max_pixels limit, base64 encoded and included in the prompt sent to the AI provider.

The persona editor allows enabling/disabling vision and has a dropdown to select the max supported image size (low, medium, high). Vision is disabled by default.

This initial vision support has been tested and implemented with Anthropic's claude-3 models which accept images in a special format as part of the prompt.

Other integrations will need to be updated to support images.

Several specs were added to test the new functionality at the persona, prompt building and API layers.

 - Gemini is omitted, pending API support for Gemini 1.5. Current Gemini bot is not performing well, adding images is unlikely to make it perform any better.

 - Open AI is omitted, vision support on GPT-4 it limited in that the API has no tool support when images are enabled so we would need to full back to a different prompting technique, something that would add lots of complexity


---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2024-03-27 14:30:11 +11:00
..
ai_api_audit_log.rb Mixtral (#376) 2023-12-26 14:49:55 -03:00
ai_persona.rb FEATURE: Add vision support to AI personas (Claude 3) (#546) 2024-03-27 14:30:11 +11:00
classification_result.rb DEV: Dedicated table for saving classification results (#1) 2023-02-27 16:21:40 -03:00
completion_prompt.rb DEV: correct flaky spec (#475) 2024-02-19 15:21:55 +11:00
model_accuracy.rb REFACTOR: Store prompts in a dedicated table. (#14) 2023-03-17 15:14:19 -03:00
post_custom_prompt.rb FEATURE: add support for GPT <-> Forum integration 2023-05-20 17:45:54 +10:00
reviewable_ai_chat_message.rb FIX: 500 error when reviewable has a missing message (#397) 2024-01-03 11:49:47 -03:00
reviewable_ai_post.rb REFACTOR: Store prompts in a dedicated table. (#14) 2023-03-17 15:14:19 -03:00
shared_ai_conversation.rb FEATURE: Share conversations with AI via a URL (#521) 2024-03-12 16:51:41 +11:00