Add custom validation for empty fields in all the AI API Explorers before getting response
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3522829. --> Reported by: [ishani patel](https://www.drupal.org/user/3720333) Related to !585 !596 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently, AI API Explorers like the Embeddings Generator, Moderation, Speech-To-Text, and others allow submitting the form even when the prompt and other image and message fields are left empty. This results in unnecessary backend requests and potentially confusing errors or behavior for users.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Go to AI Explorers one by one<br> 2. Leave the 'Prompt' or other image and message fields empty<br> 3. Click the 'Generate' button &ndash; the form is submitted without input.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Form should not be submitted if the input fields are empty, and a validation message should be shown.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p> - Implement the code<br> - Add validation to each Explorer plugin.</p> <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