Package com.bytedesk.ai.tools
Class MathTools
java.lang.Object
com.bytedesk.ai.tools.MathTools
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleadd(double a, double b) doubleaverage(double[] numbers) doubledivide(double a, double b) doublemultiply(double a, double b) doublepercentage(double base, double percent) doublepow(double base, double exponent) doublesqrt(double value) doublesubtract(double a, double b)
-
Constructor Details
-
MathTools
public MathTools()
-
-
Method Details
-
add
@Tool(description="Add two numbers") public double add(@ToolParam(description="First addend") double a, @ToolParam(description="Second addend") double b) -
subtract
@Tool(description="Subtract the second number from the first") public double subtract(@ToolParam(description="Minuend") double a, @ToolParam(description="Subtrahend") double b) -
multiply
@Tool(description="Multiply two numbers") public double multiply(@ToolParam(description="First factor") double a, @ToolParam(description="Second factor") double b) -
divide
@Tool(description="Divide the first number by the second") public double divide(@ToolParam(description="Dividend") double a, @ToolParam(description="Divisor") double b) -
pow
@Tool(description="Raise the first number to the power of the second") public double pow(@ToolParam(description="Base value") double base, @ToolParam(description="Exponent") double exponent) -
sqrt
@Tool(description="Calculate the square root of a number") public double sqrt(@ToolParam(description="Value to square root") double value) -
average
@Tool(description="Compute the average of the provided numbers") public double average(@ToolParam(description="Numbers to average") double[] numbers) -
percentage
@Tool(description="Calculate the percentage value") public double percentage(@ToolParam(description="Base value") double base, @ToolParam(description="Percentage to apply (e.g. 15 for 15%)") double percent)
-