FAQ Field FWA should fetch multiple
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3576537. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !1268 >>> <p><em></em>[Tracker]<br> <strong>Update Summary: </strong>[One-line status update for stakeholders]<br> <strong>Short Description: </strong>[One-line issue summary for stakeholders]<br> <strong>Check-in Date: </strong>MM/DD/YYYY<br> <em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br> [/Tracker]</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>We can assume that you want to create the FAQ fields for a specific content, not each FAQ one by one. So the FWA should wrap the whole field, instead of each item.</p> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <p>1. Make sure that AI Automators and Field Widget Action modules are enabled.<br> 2. Also install <a href="https://www.drupal.org/project/faqfield">https://www.drupal.org/project/faqfield</a><br> 3. Create a content type under <a href="https://drupal11-test.ddev.site/admin/structure/types/add">https://drupal11-test.ddev.site/admin/structure/types/add</a><br> 4. In label set "FAQ Creation"<br> 5. Click "Save and manage fields"<br> 6. Click "Re-use an existing field"<br> 7. Pick "Body" and click "Re-use"<br> 8. Click "Save Settings"<br> 9. Click "Create a new field"<br> 10. Pick "FAQ Field" as the field type<br> 11. Set the label to "Created FAQ"<br> 12. Click "Continue"<br> 13. Scroll down and check "Enable AI Automator"<br> 14. In the "Choose AI Automator Type" pick "LLM: FAQ From Text"<br> 15. In "Automator Base Field" pick "Body"<br> 16. In Automator Prompt write "Based on the context text return 5 FAQs with questions and answers. Context: {{ context }}"<br> 17. Open "Advanced Settings"<br> 18. Pick "Field Widget" under "Automator Worker"<br> 19. Click Save.<br> 20. Goto form display for the content type: <a href="https://drupal11-test.ddev.site/admin/structure/types/manage/faq_creation/form-display">https://drupal11-test.ddev.site/admin/structure/types/manage/faq_creation/form-display</a><br> 21. On Created FAQ, click the cogwheel to edit the field settings.<br> 22. Open "Field Widget Actions"<br> 23. Under "Add new action" choose Automator FAQ Field and click "Add action"<br> 24. Check "Enable Automators"<br> 25. Open "Enable an Automator and click "FAQ Default"<br> 26. Click "Update"<br> 27. Click "Save"<br> 28. Go to Create FAQ Creation under <a href="https://drupal11-test.ddev.site/node/add">https://drupal11-test.ddev.site/node/add</a><br> 29. In the title write something whatever.<br> 30. In the body write "Drupal is a great CMS that has been around for over 20 years. It is used by millions of websites around the world and has a large and active community. Drupal is known for its flexibility and scalability, making it a popular choice for websites of all sizes and industries."<br> 31. Click "Automator FAQ Field" button - this might take a while<br> 32. <strong>Expected</strong>: One button that fetches all 5 FAQs and populates them.<br> 33. <strong>Got</strong>: One button per each item, that means you have to click 10 times and do 5 inference jobs, even if each of them has each answer.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Fix the button as a wrapper around the field, not each item.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3> <h3 id="summary-ai-usage">AI usage (if applicable)</h3> <p>[ ] AI Assisted Issue<br> This issue was generated with AI assistance, but was reviewed and refined by the creator.</p> <p>[ ] AI Assisted Code<br> This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p> <p>[ ] AI Generated Code<br> This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p> <p>[ ] Vibe Coded<br> This code was generated by an AI and has only been functionally tested.</p>
issue