Interface AguiRuntimeContextResolver

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 AguiRuntimeContextResolver
Resolves a caller-provided RuntimeContext for an AG-UI request.

Applications can expose this as a bean (or pass it programmatically to AguiRequestProcessor) to attach request-scoped values such as tenant information, tracing data, or tool dependencies. The AG-UI runtime metadata is still supplied by the protocol adapter and takes precedence over conflicting values.

The native request type is transport-specific, so the request parameter uses a wildcard (<?>). Implementations that need the native request can obtain it via request.getNativeRequest() (returned as the captured type) and narrow it with instanceof.

  • Method Summary

    Modifier and Type
    Method
    Description
    io.agentscope.core.agent.RuntimeContext
    Resolve the runtime context for the current request.
  • Method Details

    • resolve

      io.agentscope.core.agent.RuntimeContext resolve(AguiRuntimeContextRequest<?> request)
      Resolve the runtime context for the current request.
      Parameters:
      request - The AG-UI request context
      Returns:
      A runtime context to merge into the AG-UI run, or null