CallableAgent
public interface CallableAgent
io/agentscope/core/agent/CallableAgent.java:36–172定义 Callable 智能体契约的接口。位于 io.agentscope.core.agent 包。核心成员包括 call。
Interface for agents that can be called to process messages.
This interface defines the core call capability of agents, including:
-
Basic message processing via
#call(List) -
Structured output generation via
#call(List, Class)and#call(List, JsonNode)
Default implementations are provided for convenience methods that delegate
to the core #call(List) method.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
default public Mono<Msg> call()default | 向智能体发送输入并返回最终回复。 Continue generation based on current state without adding new input. |
default public Mono<Msg> call(JsonNode schema)default | 向智能体发送输入并返回最终回复。 Continue generation with JSON schema based on current state. |
default public Mono<Msg> call(Class<?> structuredModel)default | 向智能体发送输入并返回最终回复。 Continue generation with structured model based on current state. |
default public Mono<Msg> call(Msg msg)default | 向智能体发送输入并返回最终回复。 Process a single input message and generate a response. |
default public Mono<Msg> call(Msg msg, Class<?> structuredModel)default | 向智能体发送输入并返回最终回复。 Process a single input message with structured model and generate a response. |
default public Mono<Msg> call(Msg msg, JsonNode schema)default | 向智能体发送输入并返回最终回复。 Process a single input message with JSON schema and generate a response. |
default public Mono<Msg> call(String text)default | 向智能体发送输入并返回最终回复。 Process a plain text input and generate a response. |
default public Mono<Msg> call(String text, Class<?> structuredModel)default | 向智能体发送输入并返回最终回复。 Process a plain text input with structured model and generate a response. |
default public Mono<Msg> call(String text, JsonNode schema)default | 向智能体发送输入并返回最终回复。 Process a plain text input with JSON schema and generate a response. |
default public Mono<Msg> call(Msg... msgs)default | 向智能体发送输入并返回最终回复。 Process multiple input messages (varargs) and generate a response. |
public Mono<Msg> call(List<Msg> msgs) | 向智能体发送输入并返回最终回复。 Process a list of input messages and generate a response. |
public Mono<Msg> call(List<Msg> msgs, Class<?> structuredModel) | 向智能体发送输入并返回最终回复。 Process multiple input messages with structured model and generate a response. |
public Mono<Msg> call(List<Msg> msgs, JsonNode schema) | 向智能体发送输入并返回最终回复。 Process multiple input messages with JSON schema and generate a response. |
方法详情Method Detail
call
default public Mono<Msg> call()
向智能体发送输入并返回最终回复。
Continue generation based on current state without adding new input.
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:43–45call
default public Mono<Msg> call(JsonNode schema)
向智能体发送输入并返回最终回复。
Continue generation with JSON schema based on current state.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
schema | JsonNode | 模式定义(类型 `JsonNode`)。JSON schema defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:53–55call
default public Mono<Msg> call(Class<?> structuredModel)
向智能体发送输入并返回最终回复。
Continue generation with structured model based on current state.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:63–65call
default public Mono<Msg> call(Msg msg)
向智能体发送输入并返回最终回复。
Process a single input message and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msg | Msg | 消息(类型 `Msg`)。Input message |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:73–75call
default public Mono<Msg> call(Msg msg, Class<?> structuredModel)
向智能体发送输入并返回最终回复。
Process a single input message with structured model and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msg | Msg | 消息(类型 `Msg`)。Input message |
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:84–86call
default public Mono<Msg> call(Msg msg, JsonNode schema)
向智能体发送输入并返回最终回复。
Process a single input message with JSON schema and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msg | Msg | 消息(类型 `Msg`)。Input message |
schema | JsonNode | 模式定义(类型 `JsonNode`)。JSON schema defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:95–97call
default public Mono<Msg> call(String text)
向智能体发送输入并返回最终回复。
Process a plain text input and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
text | String | 文本(类型 `String`)。Input text (wrapped into a `UserMessage`) |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:105–107call
default public Mono<Msg> call(String text, Class<?> structuredModel)
向智能体发送输入并返回最终回复。
Process a plain text input with structured model and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
text | String | 文本(类型 `String`)。Input text (wrapped into a `UserMessage`) |
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:116–118call
default public Mono<Msg> call(String text, JsonNode schema)
向智能体发送输入并返回最终回复。
Process a plain text input with JSON schema and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
text | String | 文本(类型 `String`)。Input text (wrapped into a `UserMessage`) |
schema | JsonNode | 模式定义(类型 `JsonNode`)。JSON schema defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:127–129call
default public Mono<Msg> call(Msg... msgs)
向智能体发送输入并返回最终回复。
Process multiple input messages (varargs) and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs varargs | Msg... | 消息列表(类型 `Msg...`)。Input messages (varargs) |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:137–139call
public Mono<Msg> call(List<Msg> msgs)
向智能体发送输入并返回最终回复。
Process a list of input messages and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:147call
public Mono<Msg> call(List<Msg> msgs, Class<?> structuredModel)
向智能体发送输入并返回最终回复。
Process multiple input messages with structured model and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:159call
public Mono<Msg> call(List<Msg> msgs, JsonNode schema)
向智能体发送输入并返回最终回复。
Process multiple input messages with JSON schema and generate a response.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
schema | JsonNode | 模式定义(类型 `JsonNode`)。JSON schema defining the structure |
Mono<Msg>io/agentscope/core/agent/CallableAgent.java:171