| | |
| | | .model("ep-20250805124033-lhxbf") |
| | | .messages(messages) |
| | | .stream(true) |
| | | .thinking(new ChatCompletionRequest.ChatCompletionRequestThinking("enabled")) |
| | | .temperature(0.7) |
| | | .topP(0.9) |
| | | .maxTokens(2048) |
| | |
| | | return new FebsResponse().success().data("END"); |
| | | } |
| | | |
| | | Object contentObj = choice.getMessage().getContent(); |
| | | String content = contentObj == null ? "" : contentObj.toString(); |
| | | |
| | | ApiMemberTalkStreamVo apiMemberTalkStreamVo = new ApiMemberTalkStreamVo(); |
| | | // 判断是否触发深度思考,触发则打印模型输出的思维链内容 |
| | | ChatMessage message = choice.getMessage(); |
| | | if (message.getReasoningContent()!= null &&!message.getReasoningContent().isEmpty()) { |
| | | apiMemberTalkStreamVo.setReasoningContent(message.getReasoningContent()); |
| | | System.out.print(message.getReasoningContent()); |
| | | } |
| | | |
| | | String content = message.getContent() == null ? "" : message.getContent().toString(); |
| | | apiMemberTalkStreamVo.setContent(content); |
| | | System.out.print(content); |
| | | return new FebsResponse().success().data(apiMemberTalkStreamVo); |
| | | }) |
| | | .onErrorResume(throwable -> { |