AS AgentScopeAPI 手册 / API Reference

SaaAgentBuilder

public static class SaaAgentBuilder
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:509–550

Saa 智能体构建器,用于构建并配置目标实例。位于 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
originalAgentBuildercom.alibaba.cloud.ai.graph.agent.Builderoriginal 智能体构建器(类型 `com.alibaba.cloud.ai.graph.agent.Builder`)。The original agent builder.
返回Returns SaaAgentBuilder
返回SaaAgentBuilder。Returns saa agent builder.
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:517–520

flowAgent

public SaaAgentBuilder flowAgent(FlowAgentBuilder flowAgentBuilder)

设置该配置项。

Performs the flow agent operation.

参数Parameters
名称Name类型Type说明Description
flowAgentBuilderFlowAgentBuilderflow 智能体构建器(类型 `FlowAgentBuilder`)。The flow agent builder.
返回Returns SaaAgentBuilder
返回SaaAgentBuilder。Returns saa agent builder.
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:522–525

contextAdapter

public SaaAgentBuilder contextAdapter(Function<Context, Object> contextAdapter)

设置上下文适配器。

Performs the context adapter operation.

参数Parameters
名称Name类型Type说明Description
contextAdapterFunction<Context, Object>上下文适配器(类型 `Function`)。The context adapter.
返回Returns SaaAgentBuilder
返回SaaAgentBuilder。Returns saa agent builder.
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:527–530

responseProcessor

public SaaAgentBuilder responseProcessor(Function<Object, String> responseProcessor)

设置响应处理器。

Performs the response processor operation.

参数Parameters
名称Name类型Type说明Description
responseProcessorFunction<Object, String>响应处理器(类型 `Function`)。The response processor.
返回Returns SaaAgentBuilder
返回SaaAgentBuilder。Returns saa agent builder.
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:532–535

streamResponseProcessor

public SaaAgentBuilder streamResponseProcessor(Function<Object, String> streamResponseProcessor)

设置流响应处理器。

Streams the response processor.

参数Parameters
名称Name类型Type说明Description
streamResponseProcessorFunction<Object, String>流响应处理器(类型 `Function`)。The stream response processor.
返回Returns SaaAgentBuilder
返回SaaAgentBuilder。Returns saa agent builder.
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:537–540

config

public SaaAgentBuilder config(AgentConfig config)

设置配置。

Performs the config operation.

参数Parameters
名称Name类型Type说明Description
configAgentConfig配置对象(类型 `AgentConfig`)。The config.
返回Returns SaaAgentBuilder
返回SaaAgentBuilder。Returns saa agent builder.
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:542–545

build

public SaaAgent build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns SaaAgent
返回SaaAgent。Returns saa agent.
源码Source io/agentscope/runtime/engine/agents/saa/SaaAgent.java:547–549
基于官方固定版本源码静态生成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.