NaturalLanguage
RawQuery
send a query directly to a large language model
Calling Sequence
Parameters
Description
Examples
References
Compatibility
RawQuery()
RawQuery(, )
-
string, query to send to a large language model.
(optional) option of the form , where is or .
The RawQuery command sends the string query to one of two models from OpenAI: ChatGPT or GPT-4, through a Maplesoft server; and returns the response as a string. All other commands in the NaturalLanguage package are routed through RawQuery, with some pre- and/or post-processing.
Maple can interface with OpenAI's GPT-4 and ChatGPT models. The default model is GPT-4; you can select ChatGPT by using the option, or force use of the GPT-4 model by using the 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.
Note that in this example, ChatGPT is not willing to suggest using an actual equation in Maple - it uses an assignment only.
The OpenAI website.
The NaturalLanguage:-RawQuery command was introduced in Maple 2024.
For more information on Maple 2024 changes, see Updates in Maple 2024.
Download Help Document