When I use AzureOpenAI or OpenAI, how do I get the thinking content using a thinking model?
There is no relevant description in the springAI documentation。but when i use deepseek,i can get it:
List<Message> messages = new ArrayList<>();
messages.add(new UserMessage("9.11 and 9.8, which is greater?"));
DeepSeekChatOptions promptOptions = DeepSeekChatOptions.builder()
.model(DeepSeekApi.ChatModel.DEEPSEEK_REASONER.getValue())
.build();
Prompt prompt = new Prompt(messages, promptOptions);
ChatResponse response = chatModel.call(prompt);
DeepSeekAssistantMessage deepSeekAssistantMessage = (DeepSeekAssistantMessage) response.getResult().getOutput();
String reasoningContent = deepSeekAssistantMessage.getReasoningContent();
String text = deepSeekAssistantMessage.getText();
Comment From: cKnight107
At present, there seems to be no way but to add fields to receive responses.
Comment From: sunyuhan1998
As far as I know, support for "thinking" is already in progress, and consideration is being given to how to support "thinking" in the model as a whole.