Declare supported model and provider capabilities
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3572950. -->
Reported by: [jibla](https://www.drupal.org/user/1013184)
Related to !27
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>New - capabilities not declared to AI module<br>
<strong>Check-in Date: </strong>02/11/2026<br>
<strong>Additional Collaborators: </strong><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>GeminiProvider already supports image vision, system role, JSON output, structured responses, tool calling, and streaming — but none of these capabilities are declared to the AI module. This causes:</p>
<ol>
<li><code>getSupportedCapabilities()</code> returns an empty array, so the AI module doesn't know Gemini supports streaming or Fiber.</li>
<li>The <code>ai.provider_registry.yml</code> entry in the AI module only lists <code>chat</code> and <code>embeddings</code>, so the admin UI doesn't show Gemini as supporting vision, tools, structured output, etc. For comparison, OpenAI declares: <code>chat_with_complex_json</code>, <code>chat_with_image_vision</code>, <code>chat_with_structured_response</code>, <code>chat_with_tools</code>, and more.</li>
<li><code>getSetupData()</code> is missing default models for several capabilities like <code>chat_with_tools</code> and <code>chat_system_role</code>.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p><strong>1. Override <code>getSupportedCapabilities()</code></strong> to return provider-level capabilities:</p>
<ul>
<li><code>AiProviderCapability::StreamChatOutput</code></li>
<li><code>AiProviderCapability::ChatFiberSupport</code></li>
</ul>
<p><strong>2. Create <code>ai_provider_info.yml</code></strong> in the module root to declare model-level capabilities:</p>
<pre>
gemini:
capabilities:
- chat
- embeddings
- chat_with_image_vision
- chat_with_complex_json
- chat_with_structured_response
- chat_with_tools
- chat_system_role
</pre><p><strong>3. Update <code>getSetupData()</code></strong> to include default models for all declared capabilities.</p>
<h3 id="summary-remaining-tasks">Target date or deadline</h3>
<p>Before stable release.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Implement <code>getSupportedCapabilities()</code> override</li>
<li>Create <code>ai_provider_info.yml</code> with full capability list</li>
<li>Update <code>getSetupData()</code> default models</li>
<li>Optionally submit a patch to AI module's <code>ai.provider_registry.yml</code> to update the Gemini entry</li>
<li>phpcs clean</li>
</ul>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[x] AI Assisted Issue<br>
This issue was generated with AI assistance, but was reviewed and refined by the creator.</p>
<p>[ ] AI Assisted Code</p>
<p>[ ] AI Generated Code</p>
<p>[ ] Vibe Coded</p>
> Related issue: [Issue #3572958](https://www.drupal.org/node/3572958)
issue