Class ToolExecutionResult
java.lang.Object
dev.langchain4j.service.tool.ToolExecutionResult
Represents the result of a tool execution.
- Since:
- 1.6.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ToolExecutionResult
-
-
Method Details
-
isError
public boolean isError()Indicates whether the tool execution result represents an error. -
result
Returns the tool execution result as object. This object is the actual value returned by the tool.- See Also:
-
resultText
Returns the tool execution result as text. It is aresult()that is serialized into JSON string. The text is calculated lazily on first access and then cached.Thread-safety: In rare concurrent scenarios, the supplier may be invoked multiple times, but only one result will be cached. Suppliers should be idempotent and side-effect free.
Virtual thread friendly: Uses lock-free atomic operations that do not pin carrier threads.
- See Also:
-
equals
-
hashCode
-
toString
-
builder
-