CalculatorTool

org.llm4s.toolapi.builtin.core.CalculatorTool

Tool for performing mathematical calculations.

Supports:

  • Basic arithmetic: add, subtract, multiply, divide
  • Power and square root
  • Percentage calculations
  • Absolute value, min, max

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 Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete fields

val tool: ToolFunction[Map[String, Any], CalculatorResult]

The calculator tool instance.

The calculator tool instance.

Attributes