-
Notifications
You must be signed in to change notification settings - Fork 260
Add GitHub Copilot LLM Backend Integration #5693
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
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.
This looks great!
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.
Approving for EngSys
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Overview
This PR adds GitHub Copilot as a new LLM backend for the Azure Developer CLI (azd) agent, enabling developers to use GitHub Copilot's language models for AI-assisted development workflows within azd.
Changes
Core Integration
pkg/llm/github_copilot.go): Complete implementation of GitHub Copilot as an LLM backendAuthentication Flow
The implementation includes a complete OAuth device flow authentication system:
Technical Implementation Details
OpenAI API Reuse
We reuse the OpenAI model structure from langchaingo because:
Token Management Strategy
~/.azd/gh-cp/gh(JSON format)~/.azd/gh-cp/cp(JSON format with expiration)Integration Points
cmd/container.go): Registers the new provider as "github-copilot"internal/agent/agent_factory.go): Updates context handling for authenticationcmd/init.go): Enables GitHub Copilot for AI-assisted project initializationpkg/llm/model_factory.go): Adds context parameter for authentication flowspkg/llm/manager.go): Adds new LlmTypeGhCp constant and string representationSecurity Considerations
Benefits for azd Users
Resolves
Closes #5679 - Copilot integration
Testing
Configuration Example
Users can configure GitHub Copilot as their default LLM backend:
azd config set ai.model.type github-copilotThe first time they use an AI-assisted command, they'll be prompted to authenticate with GitHub, after which tokens are automatically managed.