Мы стараемся построить клиентское приложение DeepSeek с Spring AI. Мы следуем The Spring AI, который начинает настраивать зависимости. И после чата Spring AI Deepseek у нас был контроллер, как описано в руководстве как: < /p>
@RestController
@RequestMapping("/api/deepseek")
public class DeepSeekController {
private final DeepSeekChatModel chatModel;
public DeepSeekController(DeepSeekChatModel chatModel) {
this.chatModel = chatModel;
}
@GetMapping("/ai/generate")
public Map generate(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {
return Map.of("generation", chatModel.call(message));
}
}
< /code>
Но мы получаем ошибку компиляции: < /p>
Parameter 0 of constructor in com.example.deepseekapi.DeepSeekController required a bean of type 'org.springframework.ai.deepseek.DeepSeekChatModel' that could not be found.
< /code>
, пока в документе говорится: < /p>
This will create a DeepSeekChatModel implementation that you can inject into your class. Here is an example of a simple @Controller class that uses the chat model for text generation.
< /code>
У нас есть конфигурация DeepSeek в файле конфигурации, показанная в документе. Он запрашивает хотя бы следующие параметры: < /p>
DeepSeekApi deepSeekApi,
DeepSeekChatOptions defaultOptions,
ToolCallingManager toolCallingManager, org.springframework.retry.support.RetryTemplate retryTemplate,
io.micrometer.observation.ObservationRegistry observationRegistry
Подробнее здесь: https://stackoverflow.com/questions/797 ... t-be-found