Interface ActionHandler

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 ActionHandler
Dispatch callback for a programmatically-defined action (TNS-551) — the lambda body of an ActionConfig / RoleBuilder.addAction(...) action, the programmatic counterpart of an @ActionSpec-annotated method body.

Receives the resolved parameter map and returns the action result, which ActionExecutor serializes back to the caller the same way it handles a reflective method return. Mirrors the shape of DynamicToolMethod.Handler but for role-level action dispatch rather than agent-level LLM tool calling.

Since:
0.11.0
Author:
TnsAI Team
See Also:
  • ActionConfig
  • invalid reference
    ActionMetadata#getHandler()
  • Method Summary

    Modifier and Type
    Method
    Description
    Executes the action body.
  • Method Details

    • invoke

      Object invoke(Map<String,Object> params) throws Exception
      Executes the action body.
      Parameters:
      params - the resolved parameter map (LLM/caller arguments)
      Returns:
      the action result
      Throws:
      Exception - any exception thrown by the action body