Expected Behavior
The ChatClient
provides a convenient and fluent API. For onboarding/getting-started/education scenarios, it would be nice to make it even more streamlined and allow simple prompts as String
without the need to know about the concepts of message roles and user messages yet.
Something like this:
var response = chatClient.prompt("What did Gandalf say to the Balrog?")
.call()
.content();
That would be in line with the experience of using the Prompt
class directly, since it provides a constructor that accepts a String
:
var prompt = new Prompt("What did Gandalf say to the Balrog?");
Current Behavior
var response = chatClient.prompt()
.user("What did Gandalf say to the Balrog?")
.call()
.content();
Comment From: markpollack
I like this.
Comment From: ThomasVitale
Nice, thanks for the feedback! I have submitted a PR with the implementation for the suggested improvement> https://github.com/spring-projects/spring-ai/pull/1287