Skip to content

[ChatClient] Allow simple String prompts for convenient onboarding #1286

Closed
@ThomasVitale

Description

@ThomasVitale

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();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions