Wolfram Language Paclet Repository
Community-contributed installable additions to the Wolfram Language
Notebook style with cells for execution of OpenAI commands
Contributed by: Anton Antonov
Notebook style with cells for execution of OpenAI commands based on the paclet OpenAILink.
To install this paclet in your Wolfram Language environment,
evaluate this code:
PacletInstall["AntonAntonov/OpenAIMode"]
To load the code after installation, evaluate this code:
Needs["AntonAntonov`OpenAIMode`"]
Enable the current notebook to have OpenAI interaction cells:
In[1]:= |
Another OpenAIMode[] invocation converts the notebook into the default notebook style. More explicitly the styling can be specified with OpenAIMode[True] or OpenAIMode[False].
OpenAIMode can also take notebook objects as arguments.
The text completion cell uses the evaluation function OpenAIInputExecuteToText. which takes all options of ChristopherWolfram`OpenAILink`OpenAITextComplete. Desired option values can be set using SetOptions:
The text completion cell uses the evaluation function OpenAIInputExecuteToImage. which takes all options of ChristopherWolfram`OpenAILink`OpenAICreateImage. Desired option values can be set using SetOptions:
The function OpenAIMode takes the options "TokenLimit" and ImageSize the values of which are used to do default options settings for OpenAIInputExecuteToText and OpenAIInputExecuteToImage respectively. For example, the command:
is equivalent to the sequence of commands:
The functions OpenAIInputExecuteToText and OpenAIInputExecuteToImage are just simple wrappers of the function OpenAIInputExecute.
The paclet provides the functions CellPrintWL and CellPrintAndRunWL that allow generated code to be printed and executed. Again, SetOptions used to change the epilog of the function OpenAIInputExecute:
Here is a screenshot of a notebook with the notebook style OpenAIMode applied:
Wolfram Language Version 13.2