Class UnfoldingToolInjectionStrategy

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

    
    public final class UnfoldingToolInjectionStrategy
     implements ToolInjectionStrategy
                        

    Injection strategy that handles UnfoldingTool invocations.

    When an UnfoldingTool is invoked:

    This enables progressive tool disclosure - presenting simplified categories initially, then revealing granular tools when the LLM expresses intent.

    Example flow:

    • LLM sees: "database_operations" tool

    • LLM invokes: database_operations

    • Result: database_operations removed, query_table/insert/update/delete added

    • LLM can now use specific database tools

    This strategy can be combined with other strategies using ChainedToolInjectionStrategy.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      ToolInjectionResult evaluate(ToolInjectionContext context) Called after each tool execution to determine tool changes.
      • Methods inherited from class com.embabel.agent.spi.loop.ToolInjectionStrategy

        evaluateToolResult
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnfoldingToolInjectionStrategy

        UnfoldingToolInjectionStrategy()
    • 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