Add provider_id context to PostStreamingResponseEvent
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3526978. --> Reported by: [svendecabooter](https://www.drupal.org/user/35369) Related to !637 !636 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently, the PostStreamingResponseEvent only contains some basic data regarding output and metadata.<br> It does not store information about which provider ID the post streaming response is coming from, in contrary to <code>\Drupal\ai\Event\PostGenerateResponseEvent</code>, which does provide a <code>getProviderId</code> method.</p> <p>For the AI Usage Limits module, and probably others reacting to this event as well, it would be essential information to know which AI provider has triggered this event exactly. </p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>- Add optional setProviderId() and getProviderId() methods to the event, and make sure implementing logic is able to provide a value for it.</p>
issue