Run a prompt

Write messages, set variables and parameters, and run a prompt in the Playground

The Playground tab is where an open template turns into a model response. This guide picks up with a template already open, either a fresh one from Create a prompt or the support-agent prompt built here, using the same running example as Understanding Prompts.

The Playground splits into two panels. The left panel is the editor: your messages, with a header row above them for the model picker and its parameters. The toolbar at the top of the workbench holds the Variables control and Run Prompt. The right panel is the output panel, where the response appears once you run the prompt.

Write the messages

Write the system message and the user message in the editor. For support-agent, the system message sets the agent’s role and the user message carries the question it has to answer:

  • System: “You are a support agent for {{company_name}}.”
  • User: “Answer the following customer question clearly and professionally: {{customer_question}}

{{company_name}} and {{customer_question}} are variables here. You’ll supply values for them in the Variables panel, covered next.

Click Add Message to add more, for example an assistant message showing the model a sample answer.

Note

The editor always keeps at least one message. Try to remove the only one left and it blocks you with “You must have at least one prompt.”

Declare variables and supply values

Typing {{name}} in any message declares that variable: there’s no separate declare step. Open Variables in the toolbar, next to Run Prompt, to see every variable the template declares.

  • Each row holds one full set of values, and each row is one run.
  • Import Dataset and Generate Sample Data sit above the table if you’d rather not type the rows in by hand.

For support-agent, fill in a row with something like Acme for company_name and Do you offer refunds after 30 days? for customer_question.

Every variable needs a value before the prompt runs. If one is still empty, clicking Run Prompt opens the Variables panel instead of running.

Choose a model

Choose the model that runs the prompt, from the model picker in the editor header. There’s no default: every prompt needs a model selected before it runs. If none is chosen, clicking Run Prompt opens the model picker instead of running.

Set the parameters

Set the parameters that shape the model’s output, things like temperature, max tokens, and top-p, from the same editor header. See Model configuration for the full list of parameters and their valid ranges.

Run the prompt and read the output

Click Run Prompt. The response fills in the output panel as the model generates it, rather than appearing all at once, so you can start reading before it finishes. For support-agent, a good response is a short, direct answer to customer_question that reads as coming from company_name, matching the clear, professional tone the messages ask for.

Note

If another prompt in your organization already uses the same name, the run stops before it starts. Renaming it clears the conflict.

See Prompt FAQ & fixes for other reasons a run can fail and how to fix them.

Stop a run in progress

Stop Generating takes the place of Run Prompt while a run is in flight, in the same spot in the header. If a run is taking too long or heading somewhere you don’t want, click it to cancel.

Dive deeper

Was this page helpful?

Questions & Discussion