NamespaceFactory
@FunctionalInterface public interface NamespaceFactory
源码Source
io/agentscope/harness/agent/filesystem/remote/store/NamespaceFactory.java:36–47定义命名空间工厂契约的接口。位于 io.agentscope.harness.agent.filesystem.remote.store 包。核心成员包括 getNamespace。
Factory that produces a namespace tuple for BaseStore operations at call time.
Unlike a static namespace, a NamespaceFactory is invoked on every store
operation (read, write, ls, etc.), allowing the namespace to vary based on the per-call RuntimeContext (user id, session id) rather than mutable shared state on the agent instance.
Example:
`NamespaceFactory factory = rc ->
List.of("sessions", rc.getSessionId(), "filesystem");
RemoteFilesystem fs = new RemoteFilesystem(store, factory);
`
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<String> getNamespace(RuntimeContext runtimeContext) | 获取命名空间。 Returns the namespace tuple for the current operation context. |
方法详情Method Detail
getNamespace
public List<String> getNamespace(RuntimeContext runtimeContext)
获取命名空间。
Returns the namespace tuple for the current operation context.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。per-call runtime context; never `null` (callers without a real RC must pass `RuntimeContext#empty()`) |
List<String>返回列出。non-null, non-empty list of namespace segments
源码Source
io/agentscope/harness/agent/filesystem/remote/store/NamespaceFactory.java:46