SaaAgentBuilder
public static class SaaAgentBuilder
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:509–550Saa 智能体构建器,用于构建并配置目标实例。位于 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.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public SaaAgentBuilder agent(com.alibaba.cloud.ai.graph.agent.Builder originalAgentBuilder) | 设置智能体。 Performs the agent operation. |
public SaaAgentBuilder flowAgent(FlowAgentBuilder flowAgentBuilder) | 设置该配置项。 Performs the flow agent operation. |
public SaaAgentBuilder contextAdapter(Function<Context, Object> contextAdapter) | 设置上下文适配器。 Performs the context adapter operation. |
public SaaAgentBuilder responseProcessor(Function<Object, String> responseProcessor) | 设置响应处理器。 Performs the response processor operation. |
public SaaAgentBuilder streamResponseProcessor(Function<Object, String> streamResponseProcessor) | 设置流响应处理器。 Streams the response processor. |
public SaaAgentBuilder config(AgentConfig config) | 设置配置。 Performs the config operation. |
public SaaAgent build() | 构建并返回最终实例。 Creates and returns an instance. |
方法详情Method Detail
agent
public SaaAgentBuilder agent(com.alibaba.cloud.ai.graph.agent.Builder originalAgentBuilder)
设置智能体。
Performs the agent operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
originalAgentBuilder | com.alibaba.cloud.ai.graph.agent.Builder | original 智能体构建器(类型 `com.alibaba.cloud.ai.graph.agent.Builder`)。The original agent builder. |
SaaAgentBuilder返回SaaAgentBuilder。Returns saa agent builder.
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:517–520flowAgent
public SaaAgentBuilder flowAgent(FlowAgentBuilder flowAgentBuilder)
设置该配置项。
Performs the flow agent operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
flowAgentBuilder | FlowAgentBuilder | flow 智能体构建器(类型 `FlowAgentBuilder`)。The flow agent builder. |
SaaAgentBuilder返回SaaAgentBuilder。Returns saa agent builder.
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:522–525contextAdapter
public SaaAgentBuilder contextAdapter(Function<Context, Object> contextAdapter)
设置上下文适配器。
Performs the context adapter operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
contextAdapter | Function<Context, Object> | 上下文适配器(类型 `Function`)。The context adapter. |
SaaAgentBuilder返回SaaAgentBuilder。Returns saa agent builder.
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:527–530responseProcessor
public SaaAgentBuilder responseProcessor(Function<Object, String> responseProcessor)
设置响应处理器。
Performs the response processor operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
responseProcessor | Function<Object, String> | 响应处理器(类型 `Function`)。The response processor. |
SaaAgentBuilder返回SaaAgentBuilder。Returns saa agent builder.
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:532–535streamResponseProcessor
public SaaAgentBuilder streamResponseProcessor(Function<Object, String> streamResponseProcessor)
设置流响应处理器。
Streams the response processor.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
streamResponseProcessor | Function<Object, String> | 流响应处理器(类型 `Function`)。The stream response processor. |
SaaAgentBuilder返回SaaAgentBuilder。Returns saa agent builder.
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:537–540config
public SaaAgentBuilder config(AgentConfig config)
设置配置。
Performs the config operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | AgentConfig | 配置对象(类型 `AgentConfig`)。The config. |
SaaAgentBuilder返回SaaAgentBuilder。Returns saa agent builder.
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:542–545build
public SaaAgent build()
构建并返回最终实例。
Creates and returns an instance.
SaaAgent返回SaaAgent。Returns saa agent.
源码Source
io/agentscope/runtime/engine/agents/saa/SaaAgent.java:547–549