SaaAgent
public class SaaAgent extends BaseAgent
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:58–576Saa 智能体,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.engine.agents.saa 包,继承自 BaseAgent。核心成员包括 getName、getDescription、execute、runWithContext、copy、builder。
AgentScope Agent implementation that proxies Spring AI Alibaba Agent
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
SaaContextAdapter | 类class | Saa 上下文适配器,承载智能体的部署、调度与服务化运行。 A class in io.agentscope.runtime.engine.agents.saa that deploys, schedules and serves agents. |
SaaAgentBuilder | 类class | Saa 智能体构建器,用于构建并配置目标实例。 A class in io.agentscope.runtime.engine.agents.saa that deploys, schedules and serves agents. |
构造器摘要Constructor Summary
方法摘要Method Summary
构造器详情Constructor Detail
SaaAgent
public SaaAgent()
初始化 SaaAgent 实例。
Creates a new instance.
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:242–247SaaAgent
public SaaAgent(com.alibaba.cloud.ai.graph.agent.Builder originalAgentBuilder)
初始化 SaaAgent 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
originalAgentBuilder | com.alibaba.cloud.ai.graph.agent.Builder | original 智能体构建器(类型 `com.alibaba.cloud.ai.graph.agent.Builder`)。The original agent builder. |
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:249–251SaaAgent
public SaaAgent(com.alibaba.cloud.ai.graph.agent.Builder originalAgentBuilder, Function<Context, Object> contextAdapter, Function<Object, String> responseProcessor, Function<Object, String> streamResponseProcessor)
初始化 SaaAgent 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
originalAgentBuilder | com.alibaba.cloud.ai.graph.agent.Builder | original 智能体构建器(类型 `com.alibaba.cloud.ai.graph.agent.Builder`)。The original agent builder. |
contextAdapter | Function<Context, Object> | 上下文适配器(类型 `Function`)。The context adapter. |
responseProcessor | Function<Object, String> | 响应处理器(类型 `Function`)。The response processor. |
streamResponseProcessor | Function<Object, String> | 流响应处理器(类型 `Function`)。The stream response processor. |
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:253–262SaaAgent
public SaaAgent(List<AgentCallback> beforeCallbacks, List<AgentCallback> afterCallbacks, io.agentscope.runtime.engine.agents.AgentConfig config, com.alibaba.cloud.ai.graph.agent.Builder originalAgentBuilder, Function<Context, Object> contextAdapter, Function<Object, String> responseProcessor, Function<Object, String> streamResponseProcessor)
初始化 SaaAgent 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
beforeCallbacks | List<AgentCallback> | 之前回调(类型 `List`)。The before callbacks. |
afterCallbacks | List<AgentCallback> | 之后回调(类型 `List`)。The after callbacks. |
config | io.agentscope.runtime.engine.agents.AgentConfig | 配置对象(类型 `io.agentscope.runtime.engine.agents.AgentConfig`)。The config. |
originalAgentBuilder | com.alibaba.cloud.ai.graph.agent.Builder | original 智能体构建器(类型 `com.alibaba.cloud.ai.graph.agent.Builder`)。The original agent builder. |
contextAdapter | Function<Context, Object> | 上下文适配器(类型 `Function`)。The context adapter. |
responseProcessor | Function<Object, String> | 响应处理器(类型 `Function`)。The response processor. |
streamResponseProcessor | Function<Object, String> | 流响应处理器(类型 `Function`)。The stream response processor. |
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:264–276方法详情Method Detail
getName
public String getName()
获取名称。
Returns the name.
Stringio/agentscope/runtime/engine/agents/saa/SaaAgent.java:278–281getDescription
public String getDescription()
获取 getDescription。
Returns the description.
Stringio/agentscope/runtime/engine/agents/saa/SaaAgent.java:283–286execute
protected Flux<Event> execute(Context context)
设置执行。
Performs the execute operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
context | Context | 上下文(类型 `Context`)。The context. |
Flux<Event>io/agentscope/runtime/engine/agents/saa/SaaAgent.java:288–374runWithContext
public Flux<Event> runWithContext(Context context)
运行使用上下文。
Convenience method for direct invocation with Context
| 名称Name | 类型Type | 说明Description |
|---|---|---|
context | Context | 上下文(类型 `Context`)。The context. |
Flux<Event>io/agentscope/runtime/engine/agents/saa/SaaAgent.java:485–487copy
public Agent copy()
返回 copy 结果。
Returns the copy.
Agentio/agentscope/runtime/engine/agents/saa/SaaAgent.java:489–502builder
public static SaaAgentBuilder builder()
返回构建器实例。
Returns the builder.
SaaAgentBuilderio/agentscope/runtime/engine/agents/saa/SaaAgent.java:505–507getAgentBuilder
public com.alibaba.cloud.ai.graph.agent.Builder getAgentBuilder()
获取智能体构建器。
Returns the agent builder.
com.alibaba.cloud.ai.graph.agent.Builderio/agentscope/runtime/engine/agents/saa/SaaAgent.java:553–555setAgentBuilder
public void setAgentBuilder(com.alibaba.cloud.ai.graph.agent.Builder originalAgentBuilder)
设置智能体构建器。
Sets the agent builder.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
originalAgentBuilder | com.alibaba.cloud.ai.graph.agent.Builder | original 智能体构建器(类型 `com.alibaba.cloud.ai.graph.agent.Builder`)。The original agent builder. |
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:557–559getContextAdapter
public Function<Context, Object> getContextAdapter()
获取上下文适配器。
Returns the context adapter.
Function<Context, Object>io/agentscope/runtime/engine/agents/saa/SaaAgent.java:561–563setContextAdapter
public void setContextAdapter(Function<Context, Object> contextAdapter)
设置上下文适配器。
Sets the context adapter.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
contextAdapter | Function<Context, Object> | 上下文适配器(类型 `Function`)。The context adapter. |
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:565–567getResponseProcessor
public Function<Object, String> getResponseProcessor()
获取响应处理器。
Returns the response processor.
Function<Object, String>io/agentscope/runtime/engine/agents/saa/SaaAgent.java:569–571setResponseProcessor
public void setResponseProcessor(Function<Object, String> responseProcessor)
设置响应处理器。
Sets the response processor.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
responseProcessor | Function<Object, String> | 响应处理器(类型 `Function`)。The response processor. |
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:573–575嵌套类详情Nested Class Detail
SaaContextAdapter
public static class SaaContextAdapterSaa 上下文适配器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.engine.agents.saa 包。核心成员包括 initialize、getMemory、getNewMessage、getContext、getAgent、SaaContextAdapter。
A class in io.agentscope.runtime.engine.agents.saa that deploys, schedules and serves agents. Declared in io.agentscope.runtime.engine.agents.saa.
SaaAgentBuilder
public static class SaaAgentBuilderSaa 智能体构建器,用于构建并配置目标实例。位于 io.agentscope.runtime.engine.agents.saa 包。核心成员包括 agent、flowAgent、contextAdapter、responseProcessor、streamResponseProcessor、config。
A class in io.agentscope.runtime.engine.agents.saa that deploys, schedules and serves agents. Declared in io.agentscope.runtime.engine.agents.saa.