Python Sandbox for Codex?

Hey guys!
I noticed there’s a helpful JS Sandbox (OpenAI API) where you can write your input, see the code as well as the rendered output.

Is there a Python Sandbox?

2 Likes

Any other open source one? Or a good python workflow

1 Like

Depends what your doing, I have been playing around with data analysis / viz and for that easy to just copy the code into Google Collab and execute there.

1 Like

I looked for the python sandbox as well but now I just take the code put it in a .py file and run a .bat in cmd line to execute.

1 Like

Hello @m-a.schenk, I think what @pabwright meant by sandbox in this context is that the sandbox is a playground to create various things in. For example, there’s a popular project named “GPT3-Sandbox” on GitHub that is using sandbox in the context that the sandbox is a fun area to play around in!

2 Likes

@m-a.schenk, no worries! Just like GPT-3, we’re always learning new things!

Although I have not used GPT3-Sandbox yet, the example Python scripts provided in this module seems to allow you to initialize the ‘engine’ parameter to any string, which would be the names of the Codex engines, ‘davinci-codex’ or ‘cushman-codex’ as of today.

The module should allow you to make the necessary API calls you’re wanting, but seeing that the module is not under active development and was released on July 19, 2020, I would venture to say that the information you receive will not be rendered by Flask without first modifying the module yourself to achieve the desired output. I could be wrong though, so perhaps try it out and see if it fits your needs!

1 Like

I wrote a Python code running utility called CopyRun. If You decide to use it, read the documentation first! Because the workflow is the same as saving a Python script to a file and executing the file in existing environment, except the workflow is automated, thus faster.
I’m finishing the UI for now, but virtual environment is the next step.
Of course everyone is welcome to contribute to the project to make it safe and usable!

3 Likes

CopyRun is neat! Saves an extra step. Will try this

1 Like

@Sudu I have put together a JupyterLab plugin to run Codex in local environment. You can check it out and let me know how it works. Cheers!

2 Likes

I have same question. Is there a Python Sandbox similar to Java sandbox? OpenAI API

If anyone’s interested, here’s an interactive prompt script i wrote for this purpose, the one thing it doesnt do is run the code, but it can make it easy to play around with the api from terminal. All you need is to export OPENAI_API_KEY= and run python codex.py, Heres a short gif showing its usage: ezgif.com-gif-maker

2 Likes