Support uploaded images for Chat models implementation - Problems generating alt text from
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3493942. --> Reported by: [richarddavies](https://www.drupal.org/user/638840) Related to !7 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>I'm trying to use this with the AI Image Alt Text module to generate alt text when uploading media images but I can't seem to get it to work correctly. Sometimes when I click the button to generate alt text I get "Error: The file is not an image." and other times I get a snippet of text that doesn't correspond at all with the image (e.g. the image is of trees in a forest and the text says "A brown tabby cat sleeps curled up on a colorful, crocheted blanket.")</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Clean install of Drupal 10.3.10<br> 2. Install and enable the following modules: AI, AI Image Alt Text, Gemini Provider, Media, Media Library<br> 3. Configure an API key in the Gemini Authentication Provider settings<br> 4. In the AI Image Alt Text settings, use the default prompt and image style. Select "Gemini - Gemini 1.5 Pro" for the AI provider model.<br> 5. Go to /media/add/image, upload an image, and click the "Generate with AI" button under the Alternative text field.<br> 6. Note error message or incorrect alt text populated in the alt text field.</p> <p>By comparison, I've used the Google AI Studio to enter the same prompt with the same image with the Gemini 1.5 Pro model and it gave me very accurate alt text description of the image.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue