Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

ChatGPTPromptExplorer

Guides

  • ChatGPTPromptExplorer

Tech Notes

  • ChatGPTPromptExplorer Workflows
  • ChatGPTPromptExplorer
  • Designing an LLMFunction
  • Experimenting with Prompts
  • Working with Chatbooks
  • Working with https://chat.openai.com/
  • Working with the Prompt Repository

Symbols

  • ChatGPTPromptExplorerGeneralPalette
  • ChatGPTPromptExplorerUIElement
  • ChatGPTQAPI
  • createPromptNotebook
  • getAllOpenAIModels
  • getPromptsFromPromptNotebook
  • promptEngineeringCell
  • $openAIAPIKey
Working with Chatbooks
Creating a Chatbook
Adding a custom prompt to a Chatbook: Using the Chatbook Button
Adding a custom prompt to a Chatbook: Programmatic Workflow
​
ChatGPTPromptExplorerGeneralPalette
opens the navigation palette for ChatGPTPromptExplorer
Opening the ChatGPTPromptExplorerGeneralPalette.
First load the package:
Needs["DavidReiss`ChatGPTPromptExplorer`ChatGPTPromptExplorer`"];
Creating a Chatbook
There are several ways to open a new Chatbook. The first, and simplest way is to use the "File>New>Chat-Enabled Notebook" or "File>New>Chat-Driven Notebook" menu command from the File menu.
An alternative is to create one programmatically . Here is an example:
This creates a chat enabled notebook with a ChatInput cell ready to be used, This uses the default "persona" for Chatbooks.
CreateDocument[​​{​​TextCell["","ChatInput"]​​},​​StyleDefinitions"Chatbook.nb"​​]
This creates a chat enabled notebook with a ChatInput cell ready to be used where a Section-like "ChatBlockDivider" Cell defines the persona to use used within the scope of that "ChatBlockDivider" cell group. In this example we choose the "PlainChat" persona.
In[21]:=
CreateDocument[​​{​​TextCell["...fill me in...","ChatBlockDivider",TaggingRules​​"ChatNotebookSettings"​​"LLMEvaluator""PlainChat","Model"$openAIModel],​​TextCell["","ChatInput"]​​},​​StyleDefinitions"Chatbook.nb"​​]
Out[21]=
NotebookObject
Untitled-3

Adding a custom prompt to a Chatbook: Programmatic Workflow
Here is an example of some text that you might use to create a custom ChatGPTPromptExplorer prompt notebook:
You are a helpful assistant that knows about the Wolfram Alpha AP and you also know about the Wolfram LanguageI. When possible, for each input, you will create one relevant question that could be asked of the Wolfram Alpha API. You will display that question. You will also display the URL that could be used directly in Wolfram Alpha to execute an API call. Always return that URL as a String inside a call to the Wolfram Language SystemOpen function so that the user can execute the result in the Wolfram Language.
By selecting that cell and using the "Create Prompt Notebook" button from the Prompt Explorer Palette you will get a Prompt Notebook that looks like this:
(Note that we could have changed the selection in the "role" menus for all of the Prompt Cells to "System" which might be more helpful—and you could experiment with the behavioral differences of the LLM. subject to these different settings.)
Using the "Show Prompts: JSON String" button from the Prompt Explorer palette one gets this expression.
"[\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"You are a helpful assistant that knows about the Wolfram Alpha AP and you also know about the Wolfram LanguageI.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"When possible, for each input, you will create one relevant question that could be asked of the Wolfram Alpha API.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"You will display that question.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"You will also display the URL that could be used directly in Wolfram Alpha to execute an API call.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"Always return that URL as a String inside a call to the Wolfram Language SystemOpen function so that the user can execute the result in the Wolfram Language.\"\n\t}\n]"
Then you can use this as the content of the first "ChatInput" Cell as follows
In[64]:=
CreateDocument[​​{​​TextCell["...fill me in...","ChatBlockDivider",TaggingRules"ChatNotebookSettings""LLMEvaluator""PlainChat"],​​TextCell[​​"[\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"You are a helpful assistant that knows about the Wolfram Alpha AP and you also know about the Wolfram LanguageI.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"When possible, for each input, you will create one relevant question that could be asked of the Wolfram Alpha API.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"You will display that question.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"You will also display the URL that could be used directly in Wolfram Alpha to execute an API call.\"\n\t},\n\t{\n\t\t\"role\":\"user\",\n\t\t\"content\":\"Always return that URL as a String inside a call to the Wolfram Language SystemOpen function so that the user can execute the result in the Wolfram Language.\"\n\t}\n]",​​"ChatInput"]​​},​​StyleDefinitions"Chatbook.nb"​​]
Out[64]=
NotebookObject
Untitled-35

If you then execute the first ChatInput Cell the Chatbook will know to follow these instructions.
Here is an example:
Here is an alterative approach where the first ChatInput cell is automatically evaluated.
Of course, this is just a starting point to a pragmatic way to "prime" a Chatbook with a prompt that you are experimenting with with the ChatGPTPromptExplorer.
Adding a custom prompt to a Chatbook: Using the "Chatbook" Button
The approach described above is what is used in the "Chatbook" button that you can access either from the Prompt Explorer Palette or from the same button at the top of the Prompt notebook.

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com