AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/agui/processor/AguiRequestProcessor.java:376–437

AguiRequestProcessor的构建器。位于 io.agentscope.core.agui.processor 包。核心成员包括 agentResolver、config、adapterFactory、runtimeContextResolver、build。

Builder for AguiRequestProcessor.

方法摘要Method Summary

方法Method说明Description
public Builder agentResolver(AgentResolver agentResolver)
设置智能体解析器。
Set the agent resolver.
public Builder config(AguiAdapterConfig config)
设置适配器配置。
Set the adapter configuration.
public Builder adapterFactory(AguiAgentAdapterFactory adapterFactory)
设置适配器工厂。
Set the adapter factory.
public Builder runtimeContextResolver(AguiRuntimeContextResolver runtimeContextResolver)
设置运行时上下文解析器。
Set the runtime context resolver invoked for each request to produce a caller-provided `RuntimeContext`.
public AguiRequestProcessor build()
构建处理器。
Build the processor.

方法详情Method Detail

agentResolver

public Builder agentResolver(AgentResolver agentResolver)

设置智能体解析器。

Set the agent resolver.

参数Parameters
名称Name类型Type说明Description
agentResolverAgentResolver智能体解析器。The agent resolver
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/agui/processor/AguiRequestProcessor.java:389–392

config

public Builder config(AguiAdapterConfig config)

设置适配器配置。

Set the adapter configuration.

参数Parameters
名称Name类型Type说明Description
configAguiAdapterConfig适配器配置。The adapter configuration
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/agui/processor/AguiRequestProcessor.java:400–403

adapterFactory

public Builder adapterFactory(AguiAgentAdapterFactory adapterFactory)

设置适配器工厂。

Set the adapter factory.

参数Parameters
名称Name类型Type说明Description
adapterFactoryAguiAgentAdapterFactory适配器工厂(类型 `AguiAgentAdapterFactory`)。The factory used to create per-request adapters
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/agui/processor/AguiRequestProcessor.java:411–414

runtimeContextResolver

public Builder runtimeContextResolver(AguiRuntimeContextResolver runtimeContextResolver)

设置运行时上下文解析器。

Set the runtime context resolver invoked for each request to produce a caller-provided RuntimeContext.

参数Parameters
名称Name类型Type说明Description
runtimeContextResolverAguiRuntimeContextResolver运行时上下文解析器(类型 `AguiRuntimeContextResolver`)。The resolver used for each request
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/agui/processor/AguiRequestProcessor.java:423–426

build

public AguiRequestProcessor build()

构建处理器。

Build the processor.

返回Returns AguiRequestProcessor
内置处理器。The built processor
抛出Throws
  • NullPointerException 当if agentResolver是不设置时抛出 `NullPointerException`。if agentResolver is not set
源码Source io/agentscope/core/agui/processor/AguiRequestProcessor.java:434–436
基于官方固定版本源码静态生成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.