Getting same results as codex javascript sandox?

Hi, I am just starting to play with the codex, but I am struggling with the prompt design. My question is, how to create a prompt so that the results in the playground are the same as the results in the javascript sandbox? Thank you for the help :slight_smile:

1 Like

I think I got it. This prompt is outputting exactly the same results as javascript sandbox …

<!-- Create a javascript code. Create a webpage with the title saying "Let's input your name". Under the title, there is a form with the submit button. The button has a text called "Submit your name". -->
<html>
    <head>
        <script>
        document.addEventListener("DOMContentLoaded", function() {

reverse-engineered from jsfidle export :slight_smile:

2 Likes

Seems the JavaScript Sandbox uses the following prompt

<|endoftext|>/* I start with a blank HTML page, and incrementally modify it via <script> injection. Written for Chrome. */
/* Command: Add "Hello World", by adding an HTML DOM node */
var helloWorld = document.createElement('div');
helloWorld.innerHTML = 'Hello World';
document.body.appendChild(helloWorld);
/* Command: Clear the page. */
while (document.body.firstChild) {
  document.body.removeChild(document.body.firstChild);
}

/* Command: YOUR INSTRUCTIONS GOES HERE */

max_tokens set to 1000, stop set to /* Command:

2 Likes

Found a blog post that goes into some details on how the JavaScript sandbox works

1 Like