Field Widget Action for llm_number Automator on number widget (integer, float fields)
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3534653. --> Reported by: [anjaliprasannan](https://www.drupal.org/user/3637917) Related to !722 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The Field Widget Action module is merged into 1.2.x, however we need to start adding Automators plugins to it. The parent issue #3534445: Parent Issue: Create Field Widget Actions plugins for Automators. is a parent issue for all the implementations of the Automators plugins. Read more in the parent issue.</p> <p>This issue implements the Field Widget Action plugin for the **Integer** and **Float** field types using the **Default number widget** (`number`) and the `llm_number` AI Automator. This will allow automatic suggestion of numerical values (e.g., quantities, ratings, scores) based on the surrounding context using a language model.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>In the <code>AI Automators</code> module, create a new Field Widget Action plugin under <code>src/Plugin/FieldWidgetAction</code>.</li> <li>Name the plugin file <code>LlmNumberNumberDefault.php</code>.</li> <li>Use the <code>FieldWidgetAction</code> attribute and connect it to: <ul> <li><code>field_types</code>: <code>integer</code>, <code>float</code></li> <li><code>widget_types</code>: <code>number</code></li> </ul> </li> <li>Set the <code>formElementProperty</code> to <code>value</code> and configure the <code>aiAutomatorsAjax</code> to use <code>populateAutomatorValues()</code>.</li> <li>No special <code>clearEntity</code> handling is required for this field type.</li> <li>Manually test that the Automator correctly fills the numeric field with a suggested value, and attach a video of this working to the issue (or request a reviewer to do so).</li> <li>(optional) Add a kernel test to validate the AJAX response.</li> <li>(optional) Add a functional JavaScript test to verify the field interaction and Automator output.</li> </ul> > Related issue: [Issue #3534445](https://www.drupal.org/node/3534445)
issue