Math.js tool for ModelFusion
npm install @modelfusion/mathjs-toolMath.js is a JavaScript library for evaluating mathematical expressions.
- ModelFusion v0.106.0 or higher
``ts
import { MathJsTool } from "@modelfusion/mathjs-tool";
const mathTool = new MathJsTool({
name: "math",
});
`
You can then use the tool with useTool or executeTool:
`ts``
const result = await executeTool(mathTool, {
expression: "2 + 2",
});