Created media fields use autocomplete form widget instead of media library

Created on 11 January 2025, about 1 month ago

Problem/Motivation

Using Drupal CMS latest dev with AI recipe
Using OpenAI provider and this prompt in Drupal Agent Chatbot:

could you make sure that only high resolution images can be uploaded to the basic page content?

Response:

To ensure that only high-resolution images can be uploaded to the basic page content type, I can set up a Media field that allows images and enforce limitations based on size.

Would you like me to proceed with creating this configuration for you?

I added: yes

Response:

I have successfully created a Media field for uploading high-resolution images to the basic page content type. Here’s a summary of what was done:

Field Creation: A Media field has been added, allowing image uploads specifically for high-resolution images.
Field Configuration: The field was set to target the Media entity with the image bundle.
However, please note that there are limitations: while the field can be set up for images, enforcing size limitations for high-resolution uploads isn't configurable through the existing settings.

You can manage this field and check its configuration in the following locations:

For field management: /admin/structure/types/manage/page/fields
For specific field settings: /admin/structure/types/manage/page/fields/node.page.field_high_resolution_image
If you have any further adjustments or need additional help, just let me know!

There are three issues:

1. the chatbot created a new media field, instead of detecting an existing one
2. the chatbot did not set the restrictions to image resolution
3. the chatbot created a media field with a form widget of type autocomplete, instead of media library (which is used in Drupal CMS on media fields)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

AI Assistants API

Created by

πŸ‡ΈπŸ‡°Slovakia poker10

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

Comments & Activities

Production build 0.71.5 2024