beginnerChatOptions, Response Types & Streaming

Why use streaming (`Flux<String>`) instead of a single blocking call for a chat response?

A full LLM response can take several seconds to generate; streaming sends tokens to the client as they're produced, so the UI can render them progressively (like ChatGPT's typing effect) instead of showing a blank screen until the entire response is ready — this dramatically improves perceived latency even though total generation time is unchanged.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

Why use streaming (`Flux<String>`) instead of a single blocking call for a chat response?

Next Step

Continue to How does Spring AI's structured output converter get an LLM (which only produces text) to return valid JSON matching a Java class?← Back to all Spring AI questions