Fatal error in AI API Explorer module
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3481121. --> Reported by: [mrdalesmith](https://www.drupal.org/user/2612656) Related to !193 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Visiting /admin/config/ai/explorers/vector-db-search causes a fatal error on the site:</p> <pre>The website encountered an unexpected error. Try again later.<br><br>InvalidArgumentException: "0" is an invalid render array key. Value should be an array but got a string. in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).<br>Drupal\Core\Form\FormBuilder-&gt;doBuildForm('ai_api_explorer_vector_db', Array, Object) (Line: 1069)<br>Drupal\Core\Form\FormBuilder-&gt;doBuildForm('ai_api_explorer_vector_db', Array, Object) (Line: 579)<br>Drupal\Core\Form\FormBuilder-&gt;processForm('ai_api_explorer_vector_db', Array, Object) (Line: 326)<br>Drupal\Core\Form\FormBuilder-&gt;buildForm(Object, Object) (Line: 73)<br>Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)<br>call_user_func_array(Array, Array) (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 638)<br>Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 181)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 106)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 36)<br>Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 741)<br>Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)</pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Enable and configure the AI, Open AI AI Provider, AI Assistant API and AI Chatbot modules and visit the path. A fatal error will be generated.</p>
issue