Codex JavaScript Sandbox vs Playground

Hi,

How is Codex in the “JavaScript Sandbox” different from Codex in the “Playground”. Using the Javascript Sandbox, the code generated looks more complete and accurate, the playground seems to be more random. Is there a difference between this two? How does the Javascript Sandbox determine/set the temperature and response length?

Thanks,
Ravin.

3 Likes

Hi Ravin,

great question. The main difference I can imagine to start with is the playground version can support multiple languages (including Python). I believe the javascript one is restricted in that way.

if you’re interested in configuration settings, you can take a look at the javascript sandbox’s network requests (by pressing F12 to see your browser’s Developer tools) and see what it is sending over in terms of temperature/response length:

The entire payload is:

{
    "prompt": "<|endoftext|>/* I start with a blank HTML page, and incrementally modify it via <script> injection. Written for Chrome. */\n/* Command: Add \"Hello World\", by adding an HTML DOM node */\nvar helloWorld = document.createElement('div');\nhelloWorld.innerHTML = 'Hello World';\ndocument.body.appendChild(helloWorld);\n/* Command: Clear the page. */\nwhile (document.body.firstChild) {\n  document.body.removeChild(document.body.firstChild);\n}\n\n/* Command: a red circle in the middle of the screen */\n",
    "stream": true,
    "max_tokens": 1000,
    "temperature": 0,
    "stop": "/* Command:"
}

hope this helps, have fun!

3 Likes

Hi @bakztfuture

Thank you for sharing your finding!

Sincerely,
Ravin

1 Like