Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hubertusgbecker/add Add GitHub Provider for free GPT-4 chat completions via GitHub Copilot subscription #211

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

hubertusgbecker
Copy link

Summary

  • Introduces a new GitHub Provider to enable free GPT-4 chat completions using only a GitHub Copilot subscription.
  • Implements device code flow for authentication and session token retrieval.
  • Adds a dedicated test (tests/providers/test_github_provider.py) ensuring the provider’s functionality.
  • Updates the README with instructions on using the new provider.
  • Inspired by freegpt.

Implementation Details

  • github_provider.py handles authentication (device code flow) and chat completions.
  • Test file validates streaming responses and confirms correct JSON parsing.
  • Pre-commit formatting ensures code consistency.

How to Test

  1. Install dependencies with poetry install --with dev,test.
  2. Run poetry run pytest tests/providers/test_github_provider.py.
  3. Confirm all tests pass without errors.

Additional Notes

  • This change follows the AISuite CONTRIBUTING.md guidelines.
  • No breaking changes introduced.
  • Happy to address any feedback or review comments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant