Return streamed message and set tokens on normal message on the OpenAiBasedProviderClientBase

Created on 15 August 2025, about 2 months ago

Problem/Motivation

Currently the OpenAiBasedProviderClientBase doesn't actually return the streamed response, making it not work. See,

if ($this->streamed && in_array(AiProviderCapability::StreamChatOutput, $this->getSupportedCapabilities())) {
        $payload['stream_options'] = [
          'include_usage' => TRUE,
        ];
        $response = $this->client->chat()->createStreamed($payload);
        $message = new OpenAiTypeStreamedChatMessageIterator($response);
      }
}
...nothing happens here

Steps to reproduce (required for bugs, but not feature requests)

Try adding a streamed solution.

Proposed resolution

Add a return at the end.

πŸ› Bug report
Status

Active

Version

1.2

Component

AI Core module

Created by

πŸ‡©πŸ‡ͺGermany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024