discourse-ai/lib
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_bot FEATURE: Add vision support to AI personas (Claude 3) (#546) 2024-03-27 14:30:11 +11:00
ai_helper FIX: Prevent AI chat thread titles from being created before replies are posted (#517) 2024-03-07 16:14:17 -03:00
automation FIX: unify automation model translation (#540) 2024-03-21 11:32:35 +11:00
completions FEATURE: Add vision support to AI personas (Claude 3) (#546) 2024-03-27 14:30:11 +11:00
configuration UX: Re-introduce embedding settings validations (#457) 2024-02-01 16:54:09 -03:00
database DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
embeddings DEV: Fix module namespace breaking reloads (#530) 2024-03-14 15:19:28 -03:00
inference FEATURE: AI Quick Semantic Search (#501) 2024-03-08 13:02:50 -03:00
nsfw DEV: Fix various typos (#434) 2024-01-19 12:51:26 +01:00
sentiment FIX: Truncate content for sentiment/toxicity classification (#431) 2024-01-17 15:17:58 -03:00
summarization FIX: prompt engineering for summary prompt (#539) 2024-03-20 16:33:05 +11:00
tasks/modules FIX: Filter soft-deleted topics when backfilling sentiment (#527) 2024-03-12 21:01:24 -03:00
tokenizer FIX: Handle unicode on tokenizer (#515) 2024-03-14 17:33:30 -03:00
toxicity FIX: Truncate content for sentiment/toxicity classification (#431) 2024-01-17 15:17:58 -03:00
utils FEATURE: DNS SRV support for TEI (#363) 2023-12-18 13:21:21 -03:00
automation.rb FIX: unify automation model translation (#540) 2024-03-21 11:32:35 +11:00
chat_message_classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
engine.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
guardian_extensions.rb FIX: don't show share conversation incorrectly (#526) 2024-03-13 11:24:22 +11:00
post_classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00