类 ToolExecutionResultMessage
java.lang.Object
dev.langchain4j.data.message.ToolExecutionResultMessage
- 所有已实现的接口:
ChatMessage
Represents the result of a tool execution in response to a
ToolExecutionRequest.
ToolExecutionRequests come from a previous AiMessage.toolExecutionRequests().-
构造器概要
构造器构造器说明ToolExecutionResultMessage(String id, String toolName, String text) Creates aToolExecutionResultMessage. -
方法概要
修饰符和类型方法说明booleanstatic ToolExecutionResultMessagefrom(ToolExecutionRequest request, String toolExecutionResult) Creates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.static ToolExecutionResultMessageCreates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.inthashCode()id()Returns the id of the tool.text()Returns the result of the tool execution.static ToolExecutionResultMessagetoolExecutionResultMessage(ToolExecutionRequest request, String toolExecutionResult) Creates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.static ToolExecutionResultMessagetoolExecutionResultMessage(String id, String toolName, String toolExecutionResult) Creates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.toolName()Returns the name of the tool.toString()type()The type of the message.
-
构造器详细资料
-
ToolExecutionResultMessage
Creates aToolExecutionResultMessage.- 参数:
id- the id of the tool.toolName- the name of the tool.text- the result of the tool execution.
-
-
方法详细资料
-
id
Returns the id of the tool.- 返回:
- the id of the tool.
-
toolName
Returns the name of the tool.- 返回:
- the name of the tool.
-
text
Returns the result of the tool execution.- 指定者:
text在接口中ChatMessage- 返回:
- the result of the tool execution.
-
type
从接口复制的说明:ChatMessageThe type of the message.- 指定者:
type在接口中ChatMessage- 返回:
- the type of the message
-
equals
-
hashCode
public int hashCode() -
toString
-
from
public static ToolExecutionResultMessage from(ToolExecutionRequest request, String toolExecutionResult) Creates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.- 参数:
request- the request.toolExecutionResult- the result of the tool execution.- 返回:
- the
ToolExecutionResultMessage.
-
from
public static ToolExecutionResultMessage from(String id, String toolName, String toolExecutionResult) Creates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.- 参数:
id- the id of the tool.toolName- the name of the tool.toolExecutionResult- the result of the tool execution.- 返回:
- the
ToolExecutionResultMessage.
-
toolExecutionResultMessage
public static ToolExecutionResultMessage toolExecutionResultMessage(ToolExecutionRequest request, String toolExecutionResult) Creates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.- 参数:
request- the request.toolExecutionResult- the result of the tool execution.- 返回:
- the
ToolExecutionResultMessage.
-
toolExecutionResultMessage
public static ToolExecutionResultMessage toolExecutionResultMessage(String id, String toolName, String toolExecutionResult) Creates aToolExecutionResultMessagefrom aToolExecutionRequestand the result of the tool execution.- 参数:
id- the id of the tool.toolName- the name of the tool.toolExecutionResult- the result of the tool execution.- 返回:
- the
ToolExecutionResultMessage.
-