Class LLMRoleExecutor

java.lang.Object
com.tnsai.actions.executors.LLMRoleExecutor
All Implemented Interfaces:
TypedActionExecutor

public class LLMRoleExecutor extends Object implements TypedActionExecutor
Executor for LLM-typed actions.

Builds a chat request from the action's description + invocation parameters, applies any per-action llmSystemPrompt and llmTemperature overrides declared on @ActionSpec, and delegates to the agent's LLMClient. A missing client throws ActionExecutionException so @Fallback and liability recording can see the failure — it does not return null. The framework's ToolMethodDispatcher resolves any @Tool method calls the model emits — tool exposure is configured at the agent level via AgentBuilder.builtInTools(...) / .toolPojos(...).

  • Constructor Details

    • LLMRoleExecutor

      public LLMRoleExecutor()
  • Method Details

    • execute

      public Object execute(ActionMetadata action, Role role, Map<String,Object> parameters, Map<String,Object> context)
      Description copied from interface: TypedActionExecutor
      Executes an action with the given parameters and context.
      Specified by:
      execute in interface TypedActionExecutor
      Parameters:
      action - The action metadata containing annotation details
      role - The role instance that contains the method
      parameters - The parameters for the action (from message or executeAction call)
      context - Additional context (e.g., LLM client reference, agent reference)
      Returns:
      The execution result