GetCommand - Maple Help

NaturalLanguage

 GetCommand
 ask a large language model to find a Maple command

 Calling Sequence GetCommand($s$) GetCommand($s$, $\mathrm{mo}$)

Parameters

 $s$ - string, query to send to a large language model. $\mathrm{mo}$ - (optional) option of the form $\mathrm{model}=m$, where $m$ is $\mathrm{ChatGPT}$ or $\mathrm{GPT4}$.

Description

 • The GetCommand command sends the string query to a large language model and asks it to return a Maple command as MathML. This is then interpreted by Maple's MathML:-Import command. The result is returned as a mathematical expression.
 • Maple can interface with OpenAI's GPT-4 and ChatGPT models. The default model is GPT-4; you can select ChatGPT by using the $\mathrm{model}=\mathrm{ChatGPT}$ option, or force use of the GPT-4 model by using the $\mathrm{model}=\mathrm{GPT4}$ option. 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.

Examples

 > $\mathrm{with}\left(\mathrm{NaturalLanguage}\right):$
 > $\mathrm{GetCommand}\left("What\text{'}s the command for numerical equation solving?"\right)$
 ${\mathrm{fsolve}}{}\left({\mathrm{equation}}{,}{\mathrm{variable}}\right)$ (1)
 > $\mathrm{GetCommand}\left("How do I generate uniform random numbers?"\right)$
 ${\mathrm{RandomTools}}{:-}{\mathrm{Generate}}{}\left({\mathrm{list}}{}\left({\mathrm{realrange}}{}\left({0}{,}{1}\right)\right)\right)$ (2)
 > $\mathrm{GetCommand}\left("Tell me how to find the maximum of a function",\mathrm{model}=\mathrm{ChatGPT}\right)$
 ${\mathrm{solve}}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({x}\right){=}{0}{,}{x}\right)$ (3)
 > $\mathrm{GetCommand}\left("How do I solve a differential equation numerically?",\mathrm{model}=\mathrm{ChatGPT}\right)$
 ${\mathrm{dsolve}}{}\left({\mathrm{eq}}{,}{\mathrm{numeric}}\right)$ (4)

References

 The OpenAI website.

Compatibility

 • The NaturalLanguage:-GetCommand command was introduced in Maple 2024.