DefaultAgentResolver
public class DefaultAgentResolver implements AgentResolver
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
ThreadSessionManagerfor 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.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
registry | AguiAgentRegistry | 智能体注册表。The agent registry |
io/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:45–47DefaultAgentResolver
public DefaultAgentResolver(AguiAgentRegistry registry, ThreadSessionManager sessionManager, boolean serverSideMemory)
初始化 DefaultAgentResolver 实例。
Creates a resolver with optional session support.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
registry | AguiAgentRegistry | 智能体注册表。The agent registry |
sessionManager | ThreadSessionManager | 会话管理器(类型 `ThreadSessionManager`)。The session manager (may be null) |
serverSideMemory | boolean | 服务端 Side 记忆(类型 `boolean`)。Whether to enable server-side memory |
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.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentId | String | 智能体标识(类型 `String`)。The agent id. |
threadId | String | 会话线程标识(类型 `String`)。The thread id. |
Agentio/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:65–68resolveAgent
public Agent resolveAgent(String agentId, String threadId, String userId)
解析智能体。
Performs the resolve agent operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentId | String | 智能体标识(类型 `String`)。The agent id. |
threadId | String | 会话线程标识(类型 `String`)。The thread id. |
userId | String | 用户标识(类型 `String`)。The user id. |
Agentio/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:70–86hasMemory
public boolean hasMemory(RuntimeContext runtimeContext)
判断是否具有记忆。
Returns whether this has the memory.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
booleanio/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:88–94builder
public static Builder builder()
创建新的构建器用于 DefaultAgentResolver。
Creates a new builder for DefaultAgentResolver.
Builderio/agentscope/spring/boot/agui/common/DefaultAgentResolver.java:101–103嵌套类详情Nested Class Detail
Builder
public static class BuilderDefaultAgentResolver的构建器。位于 io.agentscope.spring.boot.agui.common 包。核心成员包括 registry、sessionManager、serverSideMemory、build。
Builder for DefaultAgentResolver.