GitHub and OpenIA join forces to create artificial intelligence capable of auto-completing code

GitHub Copilot works with OpenAI’s artificial intelligence to make writing code as easy as possible supporting multiple programming languages.

GitHub, the collaborative software development platform, has associated with OpenAI to create an artificial intelligence tool which helps to write code more efficiently. This solution, called GitHub Copilot, is able to suggest code and, in some cases, even complete functions. To put it simply, it could be similar to Gmail’s autocomplete, for example, when writing emails, but applied to the field of programming.

The partnership has allowed OpenAI’s artificial intelligence system (Codex Model) to be trained with millions of lines of code stored on GitHub. In this way, it has learned to provide accurate advice: AI is not inventing code, rather it is using and learning from code that other developers (flesh and blood) have already written and which has been ratified by the community. In a simplified way, it could be said that what GitHub Copilot is doing is googling for us and presenting the best results. GitHub Copilot does not want to replace developers, but rather focus on being a tool for improving productivity and facilitating the learning of different programming languages. It supports a wide range of frameworks and languages. Right now it is able to support Python, JavaScript, TypeScript, Ruby and Go developers, and is expected to include more languages in the future.

EU-Japan.AI PLA Article 0029EN image 01

GitHub Copilot tries to make writing code as easy as possible. The system analyses the context of the editor and transforms comments into code. This can be very useful for quickly producing repetitive code patterns. Also, GitHub Copilot suggests tests that match the code being written and facilitates software development in any of the supported programming languages. All thanks to its ability to interpret the reliability of the suggested code by focusing on secure and effective code. Changes are not applied immediately; the user can choose which suggestion to accept or reject. It is also possible to manually edit the suggested code. Github Copilot is able to learn from the code it analyses every day to offer more specific and useful recommendations. This is thanks to the artificial intelligence model that brings it to life.

The process is as follows:

  • The user starts writing code in the editor.
  • That code provides a context to GitHub Copilot for what the user wants to achieve.
  • The specialised AI provides suggestions based on public (largely GitHub’s own) code and text from the internet that seemingly fits the context.
  • An answer of what AI interprets as ideal is shown, but alternatives are also be provided.
  • The user reviews the recommendations and accepts or rejects whatever it deems appropriate providing feedback to the service.