AS AgentScopeAPI 手册 / API Reference

CallableAgent

public interface CallableAgent
源码Source 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()
default

向智能体发送输入并返回最终回复。

Continue generation based on current state without adding new input.

返回Returns Mono<Msg>
返回Mono。Response message
源码Source io/agentscope/core/agent/CallableAgent.java:43–45

call

default public Mono<Msg> call(JsonNode schema)
default

向智能体发送输入并返回最终回复。

Continue generation with JSON schema based on current state.

参数Parameters
名称Name类型Type说明Description
schemaJsonNode模式定义(类型 `JsonNode`)。JSON schema defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:53–55

call

default public Mono<Msg> call(Class<?> structuredModel)
default

向智能体发送输入并返回最终回复。

Continue generation with structured model based on current state.

参数Parameters
名称Name类型Type说明Description
structuredModelClass<?>结构化模型(类型 `Class`)。Class defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:63–65

call

default public Mono<Msg> call(Msg msg)
default

向智能体发送输入并返回最终回复。

Process a single input message and generate a response.

参数Parameters
名称Name类型Type说明Description
msgMsg消息(类型 `Msg`)。Input message
返回Returns Mono<Msg>
返回Mono。Response message
源码Source io/agentscope/core/agent/CallableAgent.java:73–75

call

default public Mono<Msg> call(Msg msg, Class<?> structuredModel)
default

向智能体发送输入并返回最终回复。

Process a single input message with structured model and generate a response.

参数Parameters
名称Name类型Type说明Description
msgMsg消息(类型 `Msg`)。Input message
structuredModelClass<?>结构化模型(类型 `Class`)。Class defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:84–86

call

default public Mono<Msg> call(Msg msg, JsonNode schema)
default

向智能体发送输入并返回最终回复。

Process a single input message with JSON schema and generate a response.

参数Parameters
名称Name类型Type说明Description
msgMsg消息(类型 `Msg`)。Input message
schemaJsonNode模式定义(类型 `JsonNode`)。JSON schema defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:95–97

call

default public Mono<Msg> call(String text)
default

向智能体发送输入并返回最终回复。

Process a plain text input and generate a response.

参数Parameters
名称Name类型Type说明Description
textString文本(类型 `String`)。Input text (wrapped into a `UserMessage`)
返回Returns Mono<Msg>
返回Mono。Response message
源码Source io/agentscope/core/agent/CallableAgent.java:105–107

call

default public Mono<Msg> call(String text, Class<?> structuredModel)
default

向智能体发送输入并返回最终回复。

Process a plain text input with structured model and generate a response.

参数Parameters
名称Name类型Type说明Description
textString文本(类型 `String`)。Input text (wrapped into a `UserMessage`)
structuredModelClass<?>结构化模型(类型 `Class`)。Class defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:116–118

call

default public Mono<Msg> call(String text, JsonNode schema)
default

向智能体发送输入并返回最终回复。

Process a plain text input with JSON schema and generate a response.

参数Parameters
名称Name类型Type说明Description
textString文本(类型 `String`)。Input text (wrapped into a `UserMessage`)
schemaJsonNode模式定义(类型 `JsonNode`)。JSON schema defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:127–129

call

default public Mono<Msg> call(Msg... msgs)
default

向智能体发送输入并返回最终回复。

Process multiple input messages (varargs) and generate a response.

参数Parameters
名称Name类型Type说明Description
msgs varargsMsg...消息列表(类型 `Msg...`)。Input messages (varargs)
返回Returns Mono<Msg>
返回Mono。Response message
源码Source io/agentscope/core/agent/CallableAgent.java:137–139

call

public Mono<Msg> call(List<Msg> msgs)

向智能体发送输入并返回最终回复。

Process a list of input messages and generate a response.

参数Parameters
名称Name类型Type说明Description
msgsList<Msg>消息列表(类型 `List`)。Input messages
返回Returns Mono<Msg>
返回Mono。Response message
源码Source io/agentscope/core/agent/CallableAgent.java:147

call

public Mono<Msg> call(List<Msg> msgs, Class<?> structuredModel)

向智能体发送输入并返回最终回复。

Process multiple input messages with structured model and generate a response.

参数Parameters
名称Name类型Type说明Description
msgsList<Msg>消息列表(类型 `List`)。Input messages
structuredModelClass<?>结构化模型(类型 `Class`)。Class defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:159

call

public Mono<Msg> call(List<Msg> msgs, JsonNode schema)

向智能体发送输入并返回最终回复。

Process multiple input messages with JSON schema and generate a response.

参数Parameters
名称Name类型Type说明Description
msgsList<Msg>消息列表(类型 `List`)。Input messages
schemaJsonNode模式定义(类型 `JsonNode`)。JSON schema defining the structure
返回Returns Mono<Msg>
返回Mono。Response message with structured data in metadata
源码Source io/agentscope/core/agent/CallableAgent.java:171
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.