Interface NamespaceFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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
Modifier and TypeMethodDescriptiongetNamespace(io.agentscope.core.agent.RuntimeContext runtimeContext) Returns the namespace tuple for the current operation context.
-
Method Details
-
getNamespace
Returns the namespace tuple for the current operation context.- Parameters:
runtimeContext- per-call runtime context; nevernull(callers without a real RC must passRuntimeContext.empty())- Returns:
- non-null, non-empty list of namespace segments
-