AS AgentScopeAPI 手册 / API Reference

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
runtimeContextRuntimeContext运行时上下文(类型 `RuntimeContext`)。per-call runtime context; never `null` (callers without a real RC must pass `RuntimeContext#empty()`)
返回Returns List<String>
返回列出。non-null, non-empty list of namespace segments
源码Source io/agentscope/harness/agent/filesystem/remote/store/NamespaceFactory.java:46
基于官方固定版本源码静态生成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.