This project is a FastAPI server that interacts with the GitHub Copilot API. It authenticates with GitHub and uses the access token to get code completions from GitHub Copilot.
- Python
- FastAPI
- HTTPX
- Clone the repository.
- Install the dependencies with
pip install poetry && poetry install && poetry shell
. - Run the server with
python main.py
.
POST /copilot/completion/
: Get code completions from GitHub Copilot. The request body should contain aprompt
and an optionallanguage
(default is "python").
GITHUB_CLIENT_ID
: Your GitHub client ID.GITHUB_CLIENT_SECRET
: Your GitHub client secret.GITHUB_REDIRECT_URI
: Your GitHub redirect URI.
This project is licensed under the MIT License.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.