Chapter 3: The model call

@Service
public class Assistant {

    private final ChatClient chat;

    public Assistant(ChatClient.Builder builder) {
        this.chat = builder.build();
    }

    public String ask(String question) {
        return chat.prompt()
                .system("You are a careful assistant. Answer in two sentences or fewer.")
                .user(question)
                .call()
                .content();
    }
}

The ChatClient.Builder is created by Spring Boot when a model starter is on the classpath. The model replies in text. The client hides the request format.

Figure 3.1. One model call. Your code never builds the HTTP request; the client does. No tools are attached yet, so the model can only answer from its own text.
docs