{"record":{"id":"6fb840caaf0f94e2","repo":"spring-projects/spring-ai","slug":"thinking-mode-does-not-support-the-parameter-s","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"models/spring-ai-deepseek/src/main/java/org/springframework/ai/deepseek/DeepSeekChatModel.java","lineNumber":476,"sourceCode":"\tprivate void validateThinkingParameters(DeepSeekChatOptions options) {\n\t\tif (logger.isWarnEnabled()) {\n\t\t\tChatCompletionRequest.Thinking thinking = options.getThinking();\n\t\t\tif (thinking == null || ChatCompletionRequest.Thinking.Type.ENABLED == thinking.type()) {\n\t\t\t\tList<String> ignoredParameters = new ArrayList<>();\n\t\t\t\tif (options.getTemperature() != null) {\n\t\t\t\t\tignoredParameters.add(\"temperature\");\n\t\t\t\t}\n\t\t\t\tif (options.getTopP() != null) {\n\t\t\t\t\tignoredParameters.add(\"top_p\");\n\t\t\t\t}\n\t\t\t\tif (options.getPresencePenalty() != null) {\n\t\t\t\t\tignoredParameters.add(\"presence_penalty\");\n\t\t\t\t}\n\t\t\t\tif (options.getFrequencyPenalty() != null) {\n\t\t\t\t\tignoredParameters.add(\"frequency_penalty\");\n\t\t\t\t}\n\t\t\t\tif (!ignoredParameters.isEmpty()) {\n\t\t\t\t\tlogger.warn(\"Thinking mode does not support the \" + String.join(\", \", ignoredParameters)\n\t\t\t\t\t\t\t+ \" parameter(s). Please note that, for compatibility with existing software, setting these parameters will not trigger an error but will also have no effect.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate List<DeepSeekApi.FunctionTool> getFunctionTools(List<ToolDefinition> toolDefinitions) {\n\t\treturn toolDefinitions.stream().map(toolDefinition -> {\n\t\t\tvar function = new DeepSeekApi.FunctionTool.Function(toolDefinition.description(), toolDefinition.name(),\n\t\t\t\t\ttoolDefinition.inputSchema());\n\t\t\treturn new DeepSeekApi.FunctionTool(function);\n\t\t}).toList();\n\t}\n\n\t/**\n\t * @since 2.0.0\n\t */\n\t@Override","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/models/spring-ai-deepseek/src/main/java/org/springframework/ai/deepseek/DeepSeekChatModel.java#L458-L494","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nDeepSeekChatOptions options = DeepSeekChatOptions.builder()\n    .temperature(0.7)\n    .presencePenalty(0.5)\n    .build();\n// after\nDeepSeekChatOptions options = DeepSeekChatOptions.builder()\n    .build(); // sampling/penalty params unsupported in thinking mode","handlingStrategy":"validation","validationCode":"if (options.getThinking() != null) {\n    assert options.getTemperature() == null && options.getTopP() == null\n        && options.getPresencePenalty() == null && options.getFrequencyPenalty() == null\n        : \"thinking mode ignores temperature/topP/penalties\";\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["deepseek","thinking-mode","unsupported-parameters","chat-options"],"backgroundTag":"conflicting-config-options","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}