Provides a simple HTTP API to interface with GitHub Copilot, including native GitHub authentication.
pip install -r requirements.txt
python3 api.py [port]
Send a POST request to http://localhost:8080/api
with the following JSON body:
{
"prompt": "# hello world function\n\n",
"language": "python"
}
The response will be a plain text string containing the generated code.
def hello_world():
In order to build a complete code snippet, iteratively append the generated code to the prompt and send it back to the API until the response is empty.