Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Open a notebook to chat with an AI programming assistant
ResourceFunction["AIAssistant"][] opens a notebook that can be used to chat with an intelligent AI programming assistant. | |
ResourceFunction["AIAssistant"][notebook] converts the given NotebookObject into a AIAssistant notebook. |
AssistantIcon | Automatic | the image used to represent the AI assistant |
AssistantTheme | "Generic" | a named AI assistant |
AutoFormat | True | whether to automatically apply formatting to chat responses |
ChatHistoryLength | 15 | specifies the maximum number of previous cells to include in conversion context |
Model | "gpt-3.5-turbo" | the language model used to generate text |
RolePrompt | Automatic | a string that provides instructions to the chat assistant |
Open a notebook with AI assistant integration:
In[1]:= |
Out[1]= |
Chat will usually appear automatically when there's an error:
When there's nothing important to say, chat will be minimized near the cell bracket:
Click the minimized chat icon to show the chat:
Press the "/" key when between cells to insert a chat input cell which can be used for natural language input:
Select some text and and choose "Ask AI Assistant" from the context menu:
A chat query cell is automatically created and evaluated:
Chat query cells can also be created manually by pressing "/" a second time while in a chat input cell.
Convert an existing notebook into a AIAssistant notebook:
In[2]:= |
Out[2]= |
In[3]:= |
Out[3]= |
Chat input cells are meant for conversational inputs:
Chat query cells are suited for search-type queries and responses will often include actual search results:
Type "~" between cells to insert a chat context divider that separates conversations:
Mouse over inline code cells in chat outputs to get a set of buttons for using the code:
Each button has a tooltip describing its function:
The insert and evaluate buttons will create an external language cell for supported languages:
Disable automatic formatting of response text:
In[4]:= |
Out[4]= |
Use a predefined AI persona:
In[5]:= |
Out[5]= |
In[6]:= |
Out[6]= |
Change the icon attached to assistant cells:
In[7]:= |
Out[7]= |
Specify a separate icon for when an answer is in progress:
In[8]:= |
In[9]:= |
Out[9]= |
Set the maximum number of previous cells that will be included as part of the conversation:
In[10]:= |
Out[10]= |
Smaller values will lead to a more forgetful assistant:
Using GPT-4 instead of GPT-3.5:
In[11]:= |
Out[11]= |
GPT-4 tends to be better at creative tasks:
Not too bad:
In[12]:= |
Out[12]= |
Compare to GPT-3.5:
In[13]:= |
Out[13]= |
Not very bird-like:
In[14]:= |
Out[14]= |
GPT-3.5 is also more likely to get "stuck" in certain behavior loops compared to GPT-4:
Change the behavior of the assistant by specifying a new role prompt:
In[15]:= |
Out[15]= |
In[16]:= |
Out[16]= |
Simulate a Wolfram kernel:
In[17]:= |
Out[17]= |
This work is licensed under a Creative Commons Attribution 4.0 International License