beginnerChatOptions, Response Types & Streaming

What does the `temperature` parameter actually control, and why would you set it to 0 for some use cases?

Temperature controls how much randomness is injected when the model picks its next token — near 0 makes it almost always pick the highest-probability token (deterministic, consistent output), while higher values increase variety and creativity at the cost of predictability. Structured extraction or classification tasks want temperature near 0 for consistent, repeatable results; creative writing wants it higher.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Why use streaming (`Flux<String>`) instead of a single blocking call for a chat response?← Back to all Spring AI questions