PromptBuilder
A builder class for creating prompts using a DSL approach.
PromptBuilder allows constructing prompts by adding different types of messages (system, user, assistant, tool) in a structured way.
Example usage:
val prompt = prompt("example-prompt") {
system("You are a helpful assistant.")
user("What is the capital of France?")
}Types
Builder class for adding tool-related messages to the prompt.
A builder class for constructing tool result messages and appending them to a PromptBuilder.
Functions
Adds an assistant message to the prompt using a TextContentBuilder.
Adds an assistant message to the prompt.
Adds a generic message to the prompt.
Adds multiple messages to the prompt.
Adds a system message to the prompt using a TextContentBuilder.
Adds a system message to the prompt.
Adds tool-related messages to the prompt using a ToolMessageBuilder.
Creates a ToolResultMessageBuilder initialized with the provided tool call.
Adds a tool call message and initializes a ToolResultMessageBuilder.
Adds a user message to the prompt with attachments.
Adds a user message to the prompt.
Adds a user message to the prompt with optional attachments.