DeepSeekChatModel не может быть найденJAVA

Программисты JAVA общаются здесь
Anonymous
DeepSeekChatModel не может быть найден

Сообщение Anonymous »

Мы стараемся построить клиентское приложение 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.
We have the DeepSeek configuration in the configuration file shown in the document.
What is missing?
We had a look at the DeepSeekChatModel API documentation and can't see how to create its bean in the app.

Подробнее здесь: https://stackoverflow.com/questions/797 ... t-be-found

Вернуться в «JAVA»