Return streamed message on the OpenAiBasedProviderClientBase
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3541472. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !830
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Currently the OpenAiBasedProviderClientBase doesn't actually return the streamed response, making it not work. See,</p>
<pre>if ($this->streamed && in_array(AiProviderCapability::StreamChatOutput, $this->getSupportedCapabilities())) {<br> $payload['stream_options'] = [<br> 'include_usage' => TRUE,<br> ];<br> $response = $this->client->chat()->createStreamed($payload);<br> $message = new OpenAiTypeStreamedChatMessageIterator($response);<br> }<br>}<br>...nothing happens here</pre><h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>Try adding a streamed solution.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add a return at the end.</p>
issue