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.

@FunctionalInterface public interface NamespaceFactory
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 Type
    Method
    Description
    getNamespace(io.agentscope.core.agent.RuntimeContext runtimeContext)
    Returns the namespace tuple for the current operation context.
  • Method Details

    • getNamespace

      List<String> getNamespace(io.agentscope.core.agent.RuntimeContext runtimeContext)
      Returns the namespace tuple for the current operation context.
      Parameters:
      runtimeContext - per-call runtime context; never null (callers without a real RC must pass RuntimeContext.empty())
      Returns:
      non-null, non-empty list of namespace segments