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
ChatGPTPromptExplorer
Prompt cells
Showing and copying prompts
Notebooks with prompt cells
Exploring prompts with the ChatGPT API
The ChatGPTPromptExplorer is a set of user interface tools to experiment with and create prompt sets.
ChatGPTPromptExplorerGeneralPalette
[]
opens the navigation palette for ChatGPTPromptExplorer
ChatGPTPromptExplorerUIElement
[tag]
opens a user inerface pane for the supplied tag.
ChatGPTQAPI
[input,model]
function to call the ChatGPT API.
Key functions for ChatGPTPromptExplorer..
First load the package:
Needs["DavidReiss`ChatGPTPromptExplorer`ChatGPTPromptExplorer`"];
This creates the ChatGPTPromptExplorer palette. The palette automatically opens when the package has loaded. If you have accidentally closed the palette you can reopen it with this command. Alternatively (discussed below) you can open it from the "Palette" button at the top of any prompt notebook that you have previously created.
In[22]:=
ChatGPTPromptExplorerGeneralPalette
[]
Out[22]=
NotebookObject
Prompt Explorer Palette

We will discuss each of the above buttons (and the additional functionality under the "Documents" and "UI Tools" openers) in the sections below.
◼
  • This package changes where all error messages are directed to the Messages window for the current instance of $FrontEndSession. It does not permanently change it in your FrontEnd beyond the current session.
  • ◼
  • This package changes the value of the option DynamicEvaluationTimeout for the current instance of $FrontEndSession. It does not permanently change it in your FrontEnd beyond the current session. The value that it changes to is given by $DynamicEvaluationTimeoutValue.
  • Prompt cells
    Prompt cells are cells of the following form (in these three examples, the coloring highlights the value chosen in the "role" menu):
    Each such cell represents a single item in a prompt.
    Each such cell has an input field for the content. When the content is filled in this example of three prompt cells represent a JSON prompt to a ChatGPT API session as in this example:
    [ { "role":"system", "content":"A message for the system." }, { "role":"user", "content":"Query that a user may write." }, { "role":"assistant", "content":"Response that the assistant might write in response to the user's query." }]
    It also can be represented as a list of associations:
    ​​ "role""system","content""A message for the system.",​​ "role""user","content""Query that a user may write.",​​ "role""assistant","content""Response that the assistant might write in response to the user's query."​​
    ◼
  • If the value of the "name" menu choice is None, then there is no "name" key in the associated prompt data.
  • Notebooks with prompt cells
    ◼
  • In a single notebook the set of prompt cells in it represents the full "engineered prompt" that you might use in a ChatGPT API query.
  • ◼
  • You can use the "Insert a Prompt Cell" button to add a new prompt cell into your notebook after the current cursor location.
  • ◼
  • You can copy, paste, or delete prompt cells in your notebook.
  • ◼
  • A prompt, computed from the full ordered set of prompt cells in a notebook comprises the full prompt.
  • ◼
  • You can automatically create a set or prompt cells in a new notebook (a "prompt notebook") by selecting a text cell and clicking on the "Create a Prompt Notebook" button. A new notebook will be created, with the number of prompt cells equal to the number of sentences in the text. The "contents" portions of the prompt cells will automatically be filled in with the sentences
  • ◼
  • If no text cell was selected then a new prompt notebook will be created with a single prompt cell.
  • ◼
  • The text cell should only contain text without any formatting.
  • ◼
  • The "Default role" radio button can be used to choose what role the prompt cells will have as their initial setting in their "role" menus.
  • A prompt notebook will contain a set of buttons in its DockedCell that allows you to open the Palette or to open a ChatGPT user interface in Mathematica—either a for a single question to test your prompt, or in a conversational mode.
    You can save a prompt notebook for future use.
    When a prompt notebook is opened in a new Mathematica session it will automatically load the ChatGPTPromptExplorer code.
    Showing and copying prompts
    From a prompt notebook you can extract the full set of prompts by using:
    ◼
  • The buttons under "Show Prompts" or "Copy Prompts" lets you retrieve the prompts as a list of Associations.
  • ◼
  • "Show Prompts" opens up a new notebook with the prompt list in a "Program" cell.
  • ◼
  • "API" shows the prompts in the form needed for the OpenAI API.
  • ◼
  • "ChatObject" shows the prompts in the form needed for the defining a ChatObject.
  • ◼
  • "Copy Prompts" copies the prompt list to your clipboard.
  • ◼
  • The "Show Prompts: JSON" or "Copy Prompts: JSON" buttons to retrieve the prompts as a JSON expression.
  • ◼
  • "Show Prompts: JSON" opens up a new notebook with the prompt JSON text in a "Program" cell.
  • ◼
  • "Show Prompts: JSON String" opens up a new notebook with the prompt JSON text in a "Program" cell displayed in String format.
  • ◼
  • "Copy Prompts: JSON" copies the prompt JSON text list to your clipboard.
  • ◼
  • The "Show ChatObject" or "Copy ChatObject" buttons to retrieve the prompts as a ChatObject expression.
  • ◼
  • "Show ChatObject" opens up a new notebook with the prompt JSON text in an "Input" cell.
  • ◼
  • "Copy ChatObject" copies the prompt 's ChatObject to your clipboard.
  • Exploring prompts with the ChatGPT API
    There are two user interfaces provided to explore your prompts by passing questions into the ChatGPT API. These are opened by the "ChatGPT single Question from Prompts" and "ChatGPT Conversation with Prompts" buttons.

    "ChatGPT single Question from Prompts" button

    When a prompt notebook is selected this button will open a user interface that allows you to ask a question to ChatGPT via its API. I will use the prompt that you designed in the prompt notebook as the basis for asking the question.
    As you can see from the above screenshot, the prompt is included in the user interface. You can also set the maximum number of tokes, the temperature, and the API model to use.
    ◼
  • If there is no prompt notebook selected then the user interface will be a "plain vanilla" ChatGPT question and answer interface with no "prompt priming".
  • "ChatGPT Conversation with Prompts" button

    In contrast to the single question user interface above, this user interface let's you carry on a conversation with ChatGPT via its API.
    As before, if a prompt notebook was selected, then the user interface will be primed with the prompts (and if not then it will be "plain vanilla").
    Using this you can carry on a conversation to see the implications of your prompts to ongoing follow-on queries.

    Exporting user input as new prompts

    When using this user interface without any prompt priming (and even if you do), the set of user inputs can be opened up as a new prompt notebook.
    Clicking on the "Prompt Notebook From History" button will open up a new prompt notebook based on the user input history from the conversation.
    You can then use this as the basis for additional prompt development. (For example by starting, in this case, by deleting the final prompt cell.

    "Chatbook" button

    This button will open up a Chatbook with the "Plain Chat" persona. It will have a ChatInput cell pre-populated with the JSON form of the prompt, and that ChatInput cell will be automatically evaluated.

    © 2025 Wolfram. All rights reserved.

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