Class TypeRequestingTool

  • All Implemented Interfaces:
    com.embabel.agent.api.tool.DelegatingTool , com.embabel.agent.api.tool.Tool , com.embabel.agent.api.tool.ToolInfo

    
    public final class TypeRequestingTool<T extends Object>
     implements DelegatingTool
                        

    Tool decorator that requires a value of type T from the user before execution.

    When called, this tool throws AwaitableResponseException with a TypeRequest. The UX presents a form for the type, and when the user provides the value, it's added to the blackboard and the tool is re-invoked.

    • Constructor Detail

      • TypeRequestingTool

        TypeRequestingTool(Tool delegate, Class<T> type, Function1<String, String> messageProvider)
        Parameters:
        delegate - The tool to wrap
        type - The class of the requested type
        messageProvider - Function to generate the request message from input