Interface ToolInjectionStrategy
-
- All Implemented Interfaces:
public interface ToolInjectionStrategyStrategy for dynamically injecting tools during a conversation.
Implementations examine tool call results and conversation state to determine if tools should be added or removed.
This interface is designed for extensibility. Strategies include:
Conditional unlocks based on agent performance
Phase-based tools (planning vs execution)
Skill acquisition patterns
MatryoshkaTool progressive disclosure
New implementations should override evaluate instead of evaluateToolResult. The evaluate method supports both adding and removing tools.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classToolInjectionStrategy.Companion
-
Method Summary
Modifier and Type Method Description ToolInjectionResultevaluate(ToolInjectionContext context)Called after each tool execution to determine tool changes. List<Tool>evaluateToolResult(ToolInjectionContext context)Legacy method for backward compatibility. -
-
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
-
evaluateToolResult
@Deprecated(message = "Use evaluate() which supports both adding and removing tools", replaceWith = @ReplaceWith(imports = {}, expression = "evaluate(context)")) List<Tool> evaluateToolResult(ToolInjectionContext context)
Legacy method for backward compatibility. Override evaluate instead for new implementations.
- Parameters:
context- The current state of the tool loop- Returns:
Tools to add, or empty list if none
-
-
-
-