# Playground

The OpenAI Playground built using the components.

Source: https://webjs.dev/ui/examples/playground

[Get Started](https://webjs.dev/ui/docs/installation) [View Components](https://webjs.dev/ui/docs/components)

## neutral

Copy and paste the following code into your CSS file.

```css title="styles/globals.css"
:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}
```

![Playground](https://webjs.dev/images/examples/playground-light.png?v=15a1cc02620d) ![Playground](https://webjs.dev/images/examples/playground-dark.png?v=a4aa31b7026c)

## Playground

No presets found. Grammatical Standard English Summarize for a 2nd grader Text to command Q&A English to other languages Parse unstructured data Classification Natural language to Python Explain code Chat More examples

## Save preset

This will save the current playground state as a preset which you can access later or share with others.

Name

Description

## View code

You can use the following code to start integrating your current prompt and settings into your application.

```
import osimport openaiopenai.api_key = os.getenv("OPENAI_API_KEY")response = openai.Completion.create( model="davinci", prompt="", temperature=0.9, max_tokens=5, top_p=1, frequency_penalty=0, presence_penalty=0,)
```

Your API Key can be found here. You should use environment variables or a secret management tool to expose your key to your applications.

### Share preset

Anyone who has this link and an OpenAI account will be able to view this.

- Link

Content filter preferences Delete preset

## Content filter preferences

The content filter flags text that may violate our content policy. It's powered by our moderation endpoint which is free to use to moderate your OpenAI API traffic. Learn more.

#### Playground Warnings

Show a warning when content is flagged A warning will be shown when sexual, hateful, violent or self-harm content is detected.

## Are you absolutely sure?

This action cannot be undone. This preset will no longer be accessible by you or others you've shared it with.

Cancel Delete

Mode Choose the interface that best suits your task. You can provide: a simple prompt to complete, starting and ending text to insert a completion within, or some text with instructions to edit it.

Model The model which will generate the completion. Some models are suitable for natural language tasks, others specialize in code. Learn more.

No Models found. text-davinci-003 text-curie-001 text-babbage-001 text-ada-001 code-davinci-002 code-cushman-001

Temperature 0.56

Controls randomness: lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.

Maximum Length 256

The maximum number of tokens to generate. Requests can use up to 2,048 or 4,000 tokens, shared between prompt and completion. The exact limit varies by model.

Top P 0.9

Control diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered.

- Submit

- Submit

- Input

Instructions

- Submit
