AS AgentScopeAPI 手册 / API Reference

DefaultAgentResolver

public class DefaultAgentResolver implements AgentResolver
源码Source io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:34–155

默认智能体解析器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.spring.boot.agui.common 包,实现 AgentResolver。核心成员包括 resolveAgent、hasMemory、builder、DefaultAgentResolver。

Default implementation of AgentResolver for Spring Boot integration.

This resolver supports two modes:

  • Simple mode: Directly looks up agents from the registry

  • AgentStateStore mode: Uses ThreadSessionManager for server-side memory

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
DefaultAgentResolver的构建器。
Builder for DefaultAgentResolver.

构造器摘要Constructor Summary

构造器Constructor说明Description
public DefaultAgentResolver(AguiAgentRegistry registry)
初始化 `DefaultAgentResolver` 实例。
Creates a simple resolver without session support.
public DefaultAgentResolver(AguiAgentRegistry registry, ThreadSessionManager sessionManager, boolean serverSideMemory)
初始化 `DefaultAgentResolver` 实例。
Creates a resolver with optional session support.

方法摘要Method Summary

方法Method说明Description
public Agent resolveAgent(String agentId, String threadId)
解析智能体。
Performs the resolve agent operation.
public Agent resolveAgent(String agentId, String threadId, String userId)
解析智能体。
Performs the resolve agent operation.
public boolean hasMemory(RuntimeContext runtimeContext)
判断是否具有记忆。
Returns whether this has the memory.
public static Builder builder()
static
创建新的构建器用于 DefaultAgentResolver。
Creates a new builder for DefaultAgentResolver.

构造器详情Constructor Detail

DefaultAgentResolver

public DefaultAgentResolver(AguiAgentRegistry registry)

初始化 DefaultAgentResolver 实例。

Creates a simple resolver without session support.

参数Parameters
名称Name类型Type说明Description
registryAguiAgentRegistry智能体注册表。The agent registry
源码Source io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:45–47

DefaultAgentResolver

public DefaultAgentResolver(AguiAgentRegistry registry, ThreadSessionManager sessionManager, boolean serverSideMemory)

初始化 DefaultAgentResolver 实例。

Creates a resolver with optional session support.

参数Parameters
名称Name类型Type说明Description
registryAguiAgentRegistry智能体注册表。The agent registry
sessionManagerThreadSessionManager会话管理器(类型 `ThreadSessionManager`)。The session manager (may be null)
serverSideMemoryboolean服务端 Side 记忆(类型 `boolean`)。Whether to enable server-side memory
源码Source io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:56–63

方法详情Method Detail

resolveAgent

public Agent resolveAgent(String agentId, String threadId)

解析智能体。

Performs the resolve agent operation.

参数Parameters
名称Name类型Type说明Description
agentIdString智能体标识(类型 `String`)。The agent id.
threadIdString会话线程标识(类型 `String`)。The thread id.
返回Returns Agent
返回智能体。Returns agent.
源码Source io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:65–68

resolveAgent

public Agent resolveAgent(String agentId, String threadId, String userId)

解析智能体。

Performs the resolve agent operation.

参数Parameters
名称Name类型Type说明Description
agentIdString智能体标识(类型 `String`)。The agent id.
threadIdString会话线程标识(类型 `String`)。The thread id.
userIdString用户标识(类型 `String`)。The user id.
返回Returns Agent
返回智能体。Returns agent.
源码Source io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:70–86

hasMemory

public boolean hasMemory(RuntimeContext runtimeContext)

判断是否具有记忆。

Returns whether this has the memory.

参数Parameters
名称Name类型Type说明Description
runtimeContextRuntimeContext运行时上下文(类型 `RuntimeContext`)。The runtime context.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:88–94

builder

public static Builder builder()
static

创建新的构建器用于 DefaultAgentResolver。

Creates a new builder for DefaultAgentResolver.

返回Returns Builder
一种新的构建器实例。A new builder instance
源码Source io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:101–103

嵌套类详情Nested Class Detail

Builder

public static class Builder

DefaultAgentResolver的构建器。位于 io.agentscope.spring.boot.agui.common 包。核心成员包括 registry、sessionManager、serverSideMemory、build。

Builder for DefaultAgentResolver.

基于官方固定版本源码静态生成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.