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->doBuildForm('ai_api_explorer_vector_db', Array, Object) (Line: 1069)<br>Drupal\Core\Form\FormBuilder->doBuildForm('ai_api_explorer_vector_db', Array, Object) (Line: 579)<br>Drupal\Core\Form\FormBuilder->processForm('ai_api_explorer_vector_db', Array, Object) (Line: 326)<br>Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)<br>Drupal\Core\Controller\FormController->getContentResult(Object, Object)<br>call_user_func_array(Array, Array) (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)<br>Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)<br>Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)<br>Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)<br>Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)<br>Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)<br>Drupal\Core\DrupalKernel->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