类 AiMessage
java.lang.Object
com.ajaxjs.mcp.message.AiMessage
- 所有已实现的接口:
ChatMessage
Represents a response message from an AI (language model).
The message can contain either a textual response or a request to execute one/multiple tool(s).
In the case of tool execution, the response to this message should be one/multiple
ToolExecutionResultMessage.-
嵌套类概要
嵌套类 -
构造器概要
构造器构造器说明Create a newAiMessagewith the given text.AiMessage(String text, List<ToolExecutionRequest> toolExecutionRequests) Create a newAiMessagewith the given text and tool execution requests.AiMessage(List<ToolExecutionRequest> toolExecutionRequests) Create a newAiMessagewith the given tool execution requests. -
方法概要
修饰符和类型方法说明static AiMessageaiMessage(ToolExecutionRequest... toolExecutionRequests) Create a newAiMessagewith the given tool execution requests.static AiMessageCreate a newAiMessagewith the given text.static AiMessageaiMessage(List<ToolExecutionRequest> toolExecutionRequests) Create a newAiMessagewith the given tool execution requests.static AiMessage.Builderbuilder()static AiMessagefrom(ToolExecutionRequest... toolExecutionRequests) Create a newAiMessagewith the given tool execution requests.static AiMessageCreate a newAiMessagewith the given text.static AiMessagefrom(String text, List<ToolExecutionRequest> toolExecutionRequests) Create a newAiMessagewith the given text and tool execution requests.static AiMessagefrom(List<ToolExecutionRequest> toolExecutionRequests) Create a newAiMessagewith the given tool execution requests.booleanCheck if the message has ToolExecutionRequests.text()Get the text of the message.Get the tool execution requests of the message.type()The type of the message.
-
构造器详细资料
-
AiMessage
Create a newAiMessagewith the given text.- 参数:
text- the text of the message.
-
AiMessage
Create a newAiMessagewith the given tool execution requests.- 参数:
toolExecutionRequests- the tool execution requests of the message.
-
AiMessage
Create a newAiMessagewith the given text and tool execution requests.- 参数:
text- the text of the message.toolExecutionRequests- the tool execution requests of the message.
-
-
方法详细资料
-
text
Get the text of the message.- 返回:
- the text of the message.
-
toolExecutionRequests
Get the tool execution requests of the message.- 返回:
- the tool execution requests of the message.
-
hasToolExecutionRequests
public boolean hasToolExecutionRequests()Check if the message has ToolExecutionRequests.- 返回:
- true if the message has ToolExecutionRequests, false otherwise.
-
type
从接口复制的说明:ChatMessageThe type of the message.- 指定者:
type在接口中ChatMessage- 返回:
- the type of the message
-
builder
-
from
Create a newAiMessagewith the given text.- 参数:
text- the text of the message.- 返回:
- the new
AiMessage.
-
from
Create a newAiMessagewith the given tool execution requests.- 参数:
toolExecutionRequests- the tool execution requests of the message.- 返回:
- the new
AiMessage.
-
from
Create a newAiMessagewith the given tool execution requests.- 参数:
toolExecutionRequests- the tool execution requests of the message.- 返回:
- the new
AiMessage.
-
from
Create a newAiMessagewith the given text and tool execution requests.- 参数:
text- the text of the message.toolExecutionRequests- the tool execution requests of the message.- 返回:
- the new
AiMessage.
-
aiMessage
Create a newAiMessagewith the given text.- 参数:
text- the text of the message.- 返回:
- the new
AiMessage.
-
aiMessage
Create a newAiMessagewith the given tool execution requests.- 参数:
toolExecutionRequests- the tool execution requests of the message.- 返回:
- the new
AiMessage.
-
aiMessage
Create a newAiMessagewith the given tool execution requests.- 参数:
toolExecutionRequests- the tool execution requests of the message.- 返回:
- the new
AiMessage.
-