NaturalLanguage
Query
ask a large language model to answer a question in English and math
Calling Sequence
Parameters
Description
Examples
References
Compatibility
Query(s)
Query(s, mo)
s
-
string, question for the large language model.
mo
(optional) option of the form model=m, where m is GPT4o, O1Mini, O3Mini, or default.
The Query command sends a query to a large language model, attempting to instruct the model to use both natural language and MathML. Maple tries to split the answer into MathML and non-MathML, parse the MathML, and then print the results on screen. The command does not return anything.
Maple can interface with OpenAI's GPT-4o, o1-mini, and o3-mini models. You can select these by using the options model=GPT4o; model=O1Mini; and model=O3Mini, respectively. By default, or when explicitly selected with the model=default option, a Maplesoft server chooses an appropriate model. (At the time of release of Maple 2025, this was the o3-mini model.) Note that OpenAI may deprecate and disable models, so the set of models supported may change in the future.
Note: Large language models often generate inaccurate statements. Please keep this in mind: this is not technology for building a bridge with.
withNaturalLanguage:
QueryWhat is Pythagoras' Theorem?
Pythagoras' Theorem states that in a right‐angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.
a2+b2=c2
Querywhat is the volume of a partially filled sphere?
Assume a sphere with radius R. If the sphere is filled to a height h measured from the bottom, the filled part is a spherical cap whose volume is given by
V=πh23R−h3
One way to arrive at this result is to consider horizontal slices (disks) of the cap. For a slice at a distance y from the bottom (with y ranging from 0 to h), the disk’s radius can be expressed as
r=R2−R−y2
The area of this disk is πr² and its volume element is dV = πr² dy. Integrating dV from y = 0 to y = h produces the volume of the cap, which—in after some algebra—reduces to the formula given above. Thus, the volume of the liquid in the partially filled sphere is
The OpenAI website.
The NaturalLanguage:-Query command was introduced in Maple 2024.
For more information on Maple 2024 changes, see Updates in Maple 2024.
The NaturalLanguage:-Query command was updated in Maple 2025.
Download Help Document