Exploring the Promptfile Playground
The Promptfile Playground is an interactive sandbox for testing your
<Assistant> ```js const foo = "bar"; ``` </Assistant>
Executing your Promptfile in the Playground triggers a sequence of interactive actions:
Variable Inputs: If your Promptfile contains variables, the Playground will first request the respective inputs. If your Promptfile doesn't contain any variables, this step is skipped, and the process moves directly to the next stage.
LLM Query: The Playground will then query the Language Learning Model (LLM) defined at the start of your file (e.g.,
gpt-3.5-turbo) with the blocks you've provided in your Promptfile. A generated response is produced, allowing for continuation of the conversation.
Continuing the Conversation: You are provided with a chat interface to continue the conversation with the LLM. Any messages you write here are wrapped in an
<User>block before being sent to the model, forming a seamless and iterative chat session.
These steps lead to an ongoing interaction where the LLM response and your subsequent inputs create a dynamic conversation. The flow of this process can be monitored by inputting a response and then opening the session file, located at the top-right corner of the Playground.
Looking for inspiration? Check out our examples and copy one into your Promptfile.
Choose either of these options to launch the Playground:
Command (⌘) + Enter (↩).
- Execute the
Promptfile: run playgroundcommand from the VS Code Command Palette.
To sustain the dialogue with the LLM, simply enter a new text into the
You can revisit your past exchanges by clicking on a session ID. This action opens the selected conversation history as a Promptfile in a new VS Code tab.
Monitor your token consumption at the bottom of the editor within your Promptfile. For token counting, Promptfile currently employs tiktoken (opens in a new tab).
To view what's displayed in the Playground, click
Open session file.
To publish your Promptfile as a GitHub Gist, create a personal access token with read/write permissions to create a Gist. You can learn how to do this here (opens in a new tab). Save your GitHub token in the Promptfile settings by pressing
Command (⌘) + Shift (⇧) + P, searching for Promptfile: open settings, and pasting your keys in the VS Code setting.
Alternatively, you can define your API key in your environment as
The Playground includes a status indicator positioned next to your Promptfile name, assisting in tracking the synchronization status between the Playground and any modifications to your file. If you make changes in your file, remember to save them and then initiate a
New Session in the Playground for those changes to take effect.
- Orange Dot: An orange dot indicates that the Playground is running an outdated version of your Promptfile. To update the Playground with your latest changes, click the
New Sessionbutton to restart the session.
- No Dot: If there's no dot, it signifies that your Playground is up-to-date with the most recent version of your Promptfile.
With the Playground's interactive and intuitive features, you can refine and perfect your .prompt files effectively. Happy experimenting!