eval() used internally.
Quick Start
Config
number
default:"10"
Decimal precision for results (number of significant digits).
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Agentium 4.0.0 · Upgrade from 3.x.
Evaluate math expressions safely — no API key required.
eval() used internally.
import { Agent, openai } from "@agentium/core";
import { CalculatorToolkit } from "@agentium/core/toolkits";
const calc = new CalculatorToolkit();
const agent = new Agent({
name: "math-assistant",
model: openai(process.env.OPENAI_MODEL ?? "gpt-6.1-sol"),
instructions: "Help users with calculations. Always show your work.",
tools: [...calc.getTools()],
});
const result = await agent.run("What is the square root of 144 plus 2^10?");
| Tool | Description |
|---|---|
calculate | Evaluate a math expression. Supports +, -, *, /, ^, %, parentheses, and functions like sqrt, pow, sin, cos, log, abs, ceil, floor, round, min, max. Constants: PI, E. |
| Function | Example |
|---|---|
sqrt(x) | sqrt(144) → 12 |
pow(x, y) | pow(2, 10) → 1024 |
abs(x) | abs(-5) → 5 |
sin(x), cos(x), tan(x) | Trigonometric functions (radians) |
log(x), log2(x), log10(x) | Logarithmic functions |
ceil(x), floor(x), round(x) | Rounding |
min(a, b), max(a, b) | Min/max |
exp(x) | e^x |
cbrt(x) | Cube root |