Class ToolExecutionResultMessage.Builder
java.lang.Object
dev.langchain4j.data.message.ToolExecutionResultMessage.Builder
- Enclosing class:
ToolExecutionResultMessage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattributes(Map<String, Object> attributes) build()Builds theToolExecutionResultMessage.Sets the contents of the tool execution result.Sets the contents of the tool execution result.Sets the id of the tool.Sets whether the tool execution resulted in an error.Sets the result text of the tool execution.Sets the name of the tool.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
id
Sets the id of the tool.- Parameters:
id- the id of the tool.- Returns:
- the builder.
-
toolName
Sets the name of the tool.- Parameters:
toolName- the name of the tool.- Returns:
- the builder.
-
text
Sets the result text of the tool execution. The text will be wrapped into a singleTextContent. Mutually exclusive withcontents(List).- Parameters:
text- the result of the tool execution.- Returns:
- the builder.
-
contents
Sets the contents of the tool execution result. Mutually exclusive withtext(String).- Parameters:
contents- the contents.- Returns:
- the builder.
- Since:
- 1.13.0
-
contents
Sets the contents of the tool execution result. Mutually exclusive withtext(String).- Parameters:
contents- the contents.- Returns:
- the builder.
- Since:
- 1.13.0
-
isError
Sets whether the tool execution resulted in an error.- Parameters:
isError- whether the tool execution resulted in an error.- Returns:
- the builder.
-
attributes
-
build
Builds theToolExecutionResultMessage.- Returns:
- the
ToolExecutionResultMessage.
-