MathTools
Overview
MathTools
provides a straightforward method for enabling the AI to evaluate mathematical expressions without the need to compile or execute C# code on the server. It leverages Wisej.NET's JavaScript evaluation capabilities by sending an expression to the browser and utilizing JavaScript's eval()
method to perform the execution.
Here is what the prompt looks like:
Once the MathTool is made available, the AI can utilize it whenever a complex expression needs to be calculated. For instance, if the AI encounters a scenario where it needs to add totals and compute a percentage while performing its task, it will execute the following command: MathTools.evaluate_expression("(19883 + 277783 + 6653) * 0.2")
Remember that while LLMs may seem capable of performing complex calculations, they are not calculators. They remain language-based systems. Asking an LLM to compute a complex expression would be akin to requesting a person to solve it mentally without relying on a calculator or pencil.
Using MathTools
To enable the use of MathTools, simply add it to a SmartHub, SmartAdapter, or SmartPrompt.
Last updated