Class LLMToolResponseBuilder
java.lang.Object
org.mule.weave.extension.api.llm.tools.LLMToolResponseBuilder
Builder for
LLMToolResponse.
This class provides a fluent API to construct LLMToolResponse instances.
It allows for incrementally adding messages and setting the success status.
By default, a new builder instance will have a success status of true
and an empty list of messages.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns theLLMToolResponseinstance with the accumulated messages and the set success status.withMessage(String message) Adds a single message to the list of messages for theLLMToolResponse.withMessages(List<String> messages) Adds a list of messages to the existing messages for theLLMToolResponse.withSuccess(boolean success) Sets the success status for theLLMToolResponse.
-
Constructor Details
-
LLMToolResponseBuilder
public LLMToolResponseBuilder()
-
-
Method Details
-
withMessage
Adds a single message to the list of messages for theLLMToolResponse.- Parameters:
message- The message string to add.- Returns:
- This
LLMToolResponseBuilderinstance for fluent chaining.
-
withSuccess
Sets the success status for theLLMToolResponse.- Parameters:
success-trueif the operation was successful,falseotherwise.- Returns:
- This
LLMToolResponseBuilderinstance for fluent chaining.
-
withMessages
Adds a list of messages to the existing messages for theLLMToolResponse.- Parameters:
messages- A list of message strings to add.- Returns:
- This
LLMToolResponseBuilderinstance for fluent chaining.
-
build
Builds and returns theLLMToolResponseinstance with the accumulated messages and the set success status.- Returns:
- A new
LLMToolResponseinstance.
-