Add Image into ChatMessage object (refactor or no breaking change)

Created on 24 June 2024, 6 months ago
Updated 12 July 2024, 5 months ago

Problem/Motivation

OpenAI and Anthropic + some open models like FireLLava takes images as input as well. This should be possible via the ChatMessage object.

This would require us to add a setImage and getImage, where we could also added helper function like setImageFromImageEntity, setImageFromUri and setImageFromUrl.

However as @mindaugasd mentioned in another ticket, the name of the main text part should probably be getText and setText, rather the getMessage and setMessage since that is the whole big thing. See: https://www.drupal.org/project/ai/issues/3456553#comment-15652456 🌱 Should we do a function ai(), like t() ? Active

This would however be a breaking change for anyone already starting using the AI layer. I would say as long as we are in Alpha, this is still ok, even if its annoying?

If we don't want breaking changes, I will just add the image methods and nothing else, since this is just added methods.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🌱 Plan
Status

Fixed

Version

1.0

Component

AI Core module

Created by

🇩🇪Germany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024