CalculatorTool
org.llm4s.toolapi.builtin.core.CalculatorTool
object CalculatorTool
Tool for performing mathematical calculations.
Supports:
- Basic arithmetic: add, subtract, multiply, divide
- Power and square root
- Percentage calculations
- Absolute value, min, max
A result that is not a finite number (an overflow such as 10^400, or an undefined power such as (-8)^(1/3)) is reported as an error, as division by zero is. The formatted text always uses . as the decimal separator and ASCII digits, whatever the JVM's default locale is.
Attributes
- Example
-
import org.llm4s.toolapi.builtin.core.CalculatorTool val tools = new ToolRegistry(Seq(CalculatorTool.tool)) agent.run("What is 15% of 250?", tools) - Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CalculatorTool.type
Members list
In this article