Goal: With Spring AI and OpenAI, build a simple chatbot api and explore other Spring AI provided supports.
After cloning the project, make sure you have
- JDK 24
- Maven latest version
- VScode or IntelliJ installed
- OpenAPI api-key that has token enabled [paid version]
run this command: mvn spring-boot:run
runn CTRL+C
@GetMapping("/chat")
public String chat(){
return chatClient.prompt()
.user("Tell me an interesting fact about java")
.call()
.content();
}