Skip to main content

Persisting Prompts

With Promptscape, you can save & retrieve prompt and prompt versions as you work. There are two primary persistence mechanisms.

Using VSCode Storage

The easiest way to quickly save your work is to save prompts to VSCode storage. This is done by clicking the 'Save Prompt' button in the Promptscape Studio. When you save a prompt, you'll be asked to provide a name for your prompt. This is the name you'll use to find your prompt for retrieval from the Studio or from the Explorer 'Stored Prompts' view..

To use a prompt that is saved in VSCode Storage, you can either:

  1. Click the 'Load Prompt' button from the Studio, then select it, or
  2. Locate the prompt in the explorer, and click on it once to load it in the studio.

Deleting Stored Prompts

Prompts that are stored in VSCode Storage can be easily deleted from the Studio. Here are the steps to delete a prompt:

  1. Load the Prompt in the Studio
  2. Select 'Delete', located below the prompt input
  3. When prompted, confirm 'Yes' to delete the prompt.

What gets stored

datadescription
prompt namea descriptive reference id for the prompt
prompt textthe actual text of the prompt
variablesassociated variable data, supplied in the variable input

Using Prompt Files

Promptscape can also work with prompts and data directly from your source code! This is a powerful way to test your real-world prompts, and iterate on them to build a consumable asset that can be shipped with your application. Prompt files also enable easy sharing of prompts, versions, and variable data for specific test cases.

Prompt files are JSON.

Important: To make a prompt file discoverable by the Explorer, it must follow the naming convention: *.prompt.json.

Here's an example simple Prompt file:

{
"name": "sayHello",
"systemMessage": "Say {word} in spanish!",
"variables": {
"word": "hello"
}
}

A prompt file must implement the following required keys:

keydescription
nameA descriptive reference name.
systemMessageThe actual prompt text, including bracket-wrapped variable placeholders.

You must also include the following key, if your prompt has variables:

keydescription
variablesA json object with key & value pairs associated with each variable in the prompt. The key names for must match the names as expressed in the prompt.

Creating & Saving Prompt Files

To create or change a prompt file, you should simply create the file by directly editing the JSON file in your workspace, using VSCode. There is no need to edit the prompt through the Studio.

Loading a prompt file

Prompts that adhere to the correct naming convention (*.prompt.json) will be collected and displayed in the explorer, in the 'Prompt Files' section.

prompt-files

Simply left-click on a prompt to load it in the Studio.