Add input, tags, provider id and model id to the stream

Created on 1 September 2025, 3 days ago

Problem/Motivation

We currently have an issue that we do not have a factory method on the streaming iterators. Since they are called directly in the provider, this means that we lose the possibility to later add on data to the object. This will be fixed in 2.0.0 since its a BC.

What this has lead to is that we have some general data like input, provider id, configuration, model id missing when you try to stream.

We are currently building a base class for the events and because there is a disparity between the streaming input and the rest, it can't be used. See Simplify AI Event classes by using base classes Active .

We however can also fix this in 1.2.x using the ProviderProxy that wraps the providers input and output. We should be able to extract the streaming object and add data to it.

Proposed resolution

On the base class StreamedChatMessageIterator add getters and setter for:
* input
* provider id
* model id
* provider configuration
* tags

Create a protected method for streamed chat responses that takes the response object, input, provider id, model, event_id provider configuration, tags and attaches this to the streaming object.

Call this method instead of the current method we have for just adding requestThreadId on line 294.

Change the check, to check for a StreamedChatMessageIteratorInterface, and not a IteratorAggregate.

📌 Task
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