Add Field Widget Actions (FWA) support for llm_media_audio_generation on the media_library_widget
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3566582. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !1100 >>> <p>[Tracker]<br> <strong>Update Summary: </strong>[One-line status update for stakeholders]<br> <strong>Short Description: </strong>Add Field Widget Actions (FWA) support for llm_media_audio_generation on the media_library_widget.<br> <strong>Check-in Date: </strong>MM/DD/YYYY<br> [/Tracker]</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Editors often need to create audio assets directly while editing content, and AI Automators can streamline this by generating audio-based Media entities from model output. Currently, the <code>media_library_widget</code> does not provide an in-widget way to trigger AI Automators that create Audio Media entities.<br> This issue proposes adding Field Widget Actions (FWA) support for the <code>llm_media_audio_generation</code> automator on the <code>media_library_widget</code>, using <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code> as reference implementation. The implementation requires the core Media Library module, as it provides the widget and Media Library integration points.<br> A straightforward way to test this is to configure an AI Automator that produces (or derives) the content needed to create an Audio Media entity, then use the FWA on the Media Library widget to generate the entity and attach it to the field in the same edit form.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>Add a new FWA plugin for the <code>media_library_widget</code> that can trigger the <code>llm_media_audio_generation</code> automator, modeled after <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code>.</li> <li>Ensure the FWA creates a core Audio Media entity and returns it to the widget selection so it is attached to the field correctly.</li> </ul> <p>- <strong>This issue was created with the help of AI</strong></p>
issue