-
Notifications
You must be signed in to change notification settings - Fork 203
feat(copilot): improved support for AccessToken and Enterprise API #406
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
Conversation
447ebeb to
c3f73e3
Compare
|
amazing! |
caarlos0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple of suggestions, but this looks great, and works well too!
thanks so much!
|
I really appreciate it! Suggestions implemented and fixed the linting errors. Thinking back about what you said, it doesn't really make sense to export those copilot specific constants either. I left just the |
|
BTW, yesterday, GitHub announced a new "Free Tier" with limited access (50 chat requests/month). My guess is that they are using I don't have a GitHub account without a Copilot subscription, but if someone could verify this, please let me know. |
|
Thanks for the PR ❤️ |
Implements GitHub Copilot authentication with a new HTTP HttpClient, including token handling and support for new models.
Authentication and Configuration Updates:
copilot.go: Introduced a newCopilotHTTPClientstruct to manage HTTP requests and token handling for Copilot, including methods for retrieving and refreshing tokens. This change also includes defining constants for the Copilot authentication URL, editor version, and user-agent.mods.go: Updated thestartCompletionCmdfunction to use the newCopilotHTTPClientfor authentication, replacing the previous method of sending the RefreshToken to the API. This ensures that the token is properly managed and refreshed as needed.Model Configuration Updates:
config_template.yml: Added new model configurations forgpt-4,gpt-3.5-turbo,o1-preview-2024-09-12,o1-mini-2024-09-12, andclaude-3.5-sonnet, including their respective aliases and maximum input characters. Updated the existinggpt-4omodel configuration togpt-4o-2024-05-13with new aliases.copilot.go:Future work:
References: