Class ChainedToolInjectionStrategy

  • All Implemented Interfaces:
    com.embabel.agent.spi.loop.ToolInjectionStrategy

    
    public final class ChainedToolInjectionStrategy
     implements ToolInjectionStrategy
                        

    Chains multiple injection strategies into a pipeline.

    Evaluates strategies in order and combines their results. Tool additions are accumulated, tool removals are accumulated.

    • Constructor Detail

      • ChainedToolInjectionStrategy

        ChainedToolInjectionStrategy(List<ToolInjectionStrategy> strategies)
        Parameters:
        strategies - The strategies to evaluate in order
    • Method Detail

      • evaluate

         ToolInjectionResult evaluate(ToolInjectionContext context)

        Called after each tool execution to determine tool changes.

        Default implementation bridges to legacy evaluateToolResult for backward compatibility. Override this method for new implementations that need to add/remove tools.

        Parameters:
        context - The current state of the tool loop
        Returns:

        Result containing tools to add and/or remove