Class MathTools

  • All Implemented Interfaces:
    com.embabel.agent.core.ToolGroup , com.embabel.agent.core.ToolPublisher , com.embabel.agent.core.ToolSpec , com.embabel.common.core.types.AssetCoordinates , com.embabel.common.core.types.HasInfoString , com.embabel.common.core.types.Named

    
    public final class MathTools
     implements ToolGroup, AssetCoordinates
                        

    Math-related tools exposed as an UnfoldingTool.

    When used as a tool group, exposes a single "math" UnfoldingTool. When the LLM invokes this tool, it reveals the individual math operations (add, subtract, multiply, divide, mean, min, max, floor, ceiling, round).

    Can be used in two ways:

    • As a tool group - register with the platform for automatic resolution

    • Directly - use unfoldingTool or innerTools with PromptRunner

    Example usage:

    // As a tool group (exposes single UnfoldingTool)
    val toolGroup: ToolGroup = MathTools()
    
    // Direct use of the UnfoldingTool
    ai.withTool(MathTools().unfoldingTool)
    
    // Direct use of inner tools (bypasses UnfoldingTool)
    ai.withTools(MathTools().innerTools)