Open
Conversation
* partition code into vendor-agnostic and spring-ai areas * align artifacts with non-streaming base packages * refactor prompt messages builders
Contributor
Author
|
Code duplication reported on Deprecated class, which will be eventually removed anyway. |
Contributor
Author
|
@jorander - for your awarness as you work on streaming testability. thank you |
Contributor
|
@igordayen |
jorander
reviewed
Apr 14, 2026
|
jorander
approved these changes
Apr 14, 2026
Contributor
There was a problem hiding this comment.
Looks great!
@igordayen When this PR is merged I will update #1598 to take advantage of the changes done here.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


OVERVIEW
Continuation of PR #1581 that sets foundation for vendor-agnostic streaming.
This PR focuses on deep refactoring of the streaming framework by partitioning it into Spring AI-dependent artifacts and vendor-agnostic ones.
The vendor-agnostic part relies on
LlmMessageStreamerabstraction introduced in first PR, while the Spring AI part employsSpringAiLlmMessageStreamer.Key Changes
LlmServiceenhanced with streaming capability detection (supportsStreaming(),createMessageStreamer())StreamingLlmOperationsmoved tocore.internal.streamingpackage alongsideLlmOperationsStreamingCapabilityDetectormoved fromapitospi(not exposed for user consumption). Split into vendor-agnostic caching layer and Spring AI-specificStreamingCapabilityVerifierStreamingChatClientOperationsdeprecated (fallback for legacy streaming config), functionality split into vendor-agnosticStreamingLlmOperationsImpland Spring AI-dependentSpringAiLlmMessageStreamermessagePromptBuilders.ktper first PR review (@jasperblues comments)Execution Flow
AbstractLlmOperationsimplementsStreamingLlmOperationsFactoryinterface (createStreamingOperations()API), materialized inOperationContextDelegate. Most code is vendor-agnostic;Spring AI streaming invoked via
SpringAiLlmService.About Tools Invocation
Next, thirsd, PR will address gap in current streaming - Inspector-style callbacks similar to non-streaming.
Streaming is inherently event-driven.
Current approach opts for vendor-managed tool invocation: tools are embedded inside chunks, results included in conversation history, and stream continues transparently. This differs from
ToolLoopwhere tool results yield another LLM invocation within the loop.Plugging others than Spring AI Message Streamer - sample