spring-projects/spring-ai · warning
Thinking mode does not support the parameter(s). Please…
Error message
Thinking mode does not support the parameter(s). Please note that, for compatibility with existing software, setting these parameters will not trigger an error but will also have no effect.
What it means
DeepSeek's thinking (reasoning) mode only supports a subset of chat completion parameters. When validateThinkingParameters (invoked from createRequest) detects that the request options set parameters unsupported in thinking mode (e.g. temperature, top_p, presence_penalty, frequency_penalty), it logs this warning. For backward compatibility the call still proceeds, but the offending parameters are silently ignored by the API.
Solutions
- Remove or null out temperature, top_p, presence_penalty, and frequency_penalty from the options used for thinking-mode requests.
- Build a separate DeepSeekChatOptions instance dedicated to thinking mode with only supported fields set.
- Ignore the warning if you intentionally share options, accepting that the parameters have no effect.
Example fix
// before
DeepSeekChatOptions options = DeepSeekChatOptions.builder()
.temperature(0.7)
.presencePenalty(0.5)
.build();
// after
DeepSeekChatOptions options = DeepSeekChatOptions.builder()
.build(); // sampling/penalty params unsupported in thinking mode Defensive patterns
Strategy: validation
Validate before calling
if (options.getThinking() != null) {
assert options.getTemperature() == null && options.getTopP() == null
&& options.getPresencePenalty() == null && options.getFrequencyPenalty() == null
: "thinking mode ignores temperature/topP/penalties";
} Prevention
- Maintain a dedicated DeepSeekChatOptions bean for thinking-mode requests.
- Null out sampling/penalty fields before calls with thinking enabled.
- Review model provider docs on parameter support per mode.
When it happens
Trigger: Calling DeepSeekChatModel.call/stream (via createRequest) with DeepSeekChatOptions where thinking is enabled AND any of temperature, top_p, presence_penalty, or frequency_penalty is non-null.
Common situations: Reusing a shared ChatOptions bean with penalty/temperature settings across both normal and thinking-mode requests; migrating an existing app to DeepSeek reasoner without stripping sampling options; copying options from another model that requires temperature tuning.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Currently only one tool call is supported per message!
- No chat completion returned for prompt: + prompt
- No choices returned for prompt: + prompt
- Unsupported message type:
AI-assisted analysis of spring-projects/spring-ai@98a7beda4f (2026-09-11).
Data as JSON: /api/errors/6fb840caaf0f94e2.
Report an issue: GitHub.
Appendix: source
Thrown at models/spring-ai-deepseek/src/main/java/org/springframework/ai/deepseek/DeepSeekChatModel.java:476
private void validateThinkingParameters(DeepSeekChatOptions options) {
if (logger.isWarnEnabled()) {
ChatCompletionRequest.Thinking thinking = options.getThinking();
if (thinking == null || ChatCompletionRequest.Thinking.Type.ENABLED == thinking.type()) {
List<String> ignoredParameters = new ArrayList<>();
if (options.getTemperature() != null) {
ignoredParameters.add("temperature");
}
if (options.getTopP() != null) {
ignoredParameters.add("top_p");
}
if (options.getPresencePenalty() != null) {
ignoredParameters.add("presence_penalty");
}
if (options.getFrequencyPenalty() != null) {
ignoredParameters.add("frequency_penalty");
}
if (!ignoredParameters.isEmpty()) {
logger.warn("Thinking mode does not support the " + String.join(", ", ignoredParameters)
+ " parameter(s). Please note that, for compatibility with existing software, setting these parameters will not trigger an error but will also have no effect.");
}
}
}
}
private List<DeepSeekApi.FunctionTool> getFunctionTools(List<ToolDefinition> toolDefinitions) {
return toolDefinitions.stream().map(toolDefinition -> {
var function = new DeepSeekApi.FunctionTool.Function(toolDefinition.description(), toolDefinition.name(),
toolDefinition.inputSchema());
return new DeepSeekApi.FunctionTool(function);
}).toList();
}
/**
* @since 2.0.0
*/
@OverrideView on GitHub (pinned to 98a7beda4f)