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:
Its selected inner tools are added to the available tools
If com.embabel.agent.api.annotation.UnfoldingTools.removeOnInvoke is true, the facade is removed
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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static UnfoldingToolInjectionStrategyINSTANCE
-
Constructor Summary
Constructors Constructor Description UnfoldingToolInjectionStrategy()
-
Method Summary
Modifier and Type Method Description ToolInjectionResultevaluate(ToolInjectionContext context)Called after each tool execution to determine tool changes. -
-
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
-
-
-
-