Adrenaline is a debugger powered by the OpenAI Codex. It not only fixes your code, but teaches you along the way.
Adrenaline can be used here. Simply plug in your broken code and an error message (e.g. a stack trace or natural language description of the error) and click "Debug."
Note that you will have to supply your own OpenAI API key. This is to prevent API misuse.
To run locally, clone the repository and run the following:
$ npm install $ npm run start-local
Adrenaline sends your code and error message to the OpenAI Edit & Insert API (
code-davinci-edit-001), which returns code changes that might fix your error (or at least give you a starting point). The proposed fixes are displayed in-line like a diff, with the option to accept, reject, or modify each code change.
Not only does Adrenaline propose fixes for your errors, but it also explains errors in plain English using GPT-3 (
If your code isn't throwing an exception, it may still contain bugs. Adrenaline can scan your code for potential issues and propose fixes for them, if any exist.
Right now, Adrenaline is just a simple wrapper around GPT-3, meant to demonstrate what's possible with AI-driven debugging. There's many ways it can be improved:
Ultimately, while the OpenAI Codex is surprisingly good at debugging code, I believe a more specialized model trained on all publicly available code could yield better results. There are interesting research questions here, such as how to generate synthetic training data (i.e. how can you systematically break code in a random but non-trivial way?).
Malik Drabla for helping build the initial PoC during AI Hack Week. Ramsey Lehman for design feedback. Paul Bogdan, Michael Usachenko, and Samarth Makhija for various other feedback.
Source Code: https://github.com/shobrook/adrenaline
License: MIT license
OpenAI’s Codex understands language and code, allowing us to build more fluent interfaces. Watch Fiona O’Grady demonstrate a natural language command-line interface using Codex. Test out the code yourself on GitHub: https://msft.it/6007bd5S1
Learn more about Codex from Microsoft CTO Kevin Scott on our AI Blog: https://msft.it/6001bd5I1
#microsoft #ai #codex #openai