Array to string conversion warning in AiApiExplorerPluginBase::addProviderCodeExample() when configuration contains arrays
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3582954. -->
Reported by: [revathi.b](https://www.drupal.org/user/3389442)
Related to !1427 !1426
>>>
<p>While using the AI API Explorer module, a PHP warning is triggered when provider configuration values contain arrays.</p>
<p><strong>Error</strong>:<br>
Warning: Array to string conversion in Drupal\ai_api_explorer\AiApiExplorerPluginBase->addProviderCodeExample()</p>
<p><strong>Cause</strong>:<br>
In AiApiExplorerPluginBase::addProviderCodeExample(), the code assumes non-string values can be directly concatenated into a string. However, when $value is an array, PHP throws an "Array to string conversion" warning.</p>
<p><strong>Steps to Reproduce</strong></p>
<ol>
<li>Go to this path /admin/config/ai/explorers/chat_generator</li>
<li>Provide some chat message</li>
<li>Click Ask AI button</li>
</ol>
issue