-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET: Add AIAgent implementation for GitHub Copilot SDK #3395
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
base: main
Are you sure you want to change the base?
Conversation
|
@westey-m I was talking with @SteveSanderson earlier today about doing exactly this. :) |
Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
dotnet/src/Microsoft.Agents.AI.GithubCopilot/GithubCopilotAgentThread.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.GithubCopilot/GithubCopilotAgentThread.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.GithubCopilot/GithubCopilotAgentThread.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.GithubCopilot/GithubCopilotAgentThread.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/AgentProviders/Agent_With_GithubCopilot/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/AgentProviders/Agent_With_GithubCopilot/README.md
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.GithubCopilot/GithubCopilotAgent.cs
Outdated
Show resolved
Hide resolved
| switch (evt) | ||
| { | ||
| case AssistantMessageDeltaEvent deltaEvent: | ||
| updates.Add(ConvertToAgentResponseUpdate(deltaEvent)); |
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.
@copilot, can't we yield updates here as soon as we receive them instead of waiting till the end?
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.
Done in 44f3ab6. Changed to use a channel to yield updates as they arrive instead of collecting them.
…tOptions ctor, streaming improvements, better sample, container warning Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
dotnet/src/Microsoft.Agents.AI.GithubCopilot/GithubCopilotAgent.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
|
@copilot, I'm receiving some additional dotnet-format errors now, please fix. |
…ualifier, remove unnecessary usings Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
|
@copilot, here are some more dotnet-format errors to fix: |
Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
Fixed in 97f4457. Added UTF-8 BOM to test files, removed redundant cast, and removed unnecessary using directive. |
|
@copilot, similar to other agents, we should have Also make sure to add tests for the new code added. |
Co-authored-by: westey-m <164392973+westey-m@users.noreply.github.com>
Done in a5b7aeb. Added |
Motivation and Context
Adds support for GitHub Copilot SDK as an agent provider, enabling agentic capabilities through the Copilot platform.
Description
New Project:
Microsoft.Agents.AI.GithubCopilotImplements
GithubCopilotAgentfollowing the established A2AAgent/CopilotStudioAgent pattern:CopilotClientandCopilotSessionRunAsync) and streaming (RunStreamingAsync) operations with real-time update delivery via channelsGithubCopilotAgentThreadmanages conversation sessions via session IDs (internal constructor and setter for proper encapsulation)IAsyncDisposablewith optional client ownership viaownsClientparameter (defaults to false), allowing callers to control whether the agent disposes the CopilotClientAsAIAgentextension methods onCopilotClientfor easy AIAgent creation (similar to A2AClientExtensions and AnthropicClientExtensions)Target Framework Constraint
Only targets .NET 8.0+ (
TargetFrameworksCore) - GitHub.Copilot.SDK doesn't support netstandard2.0 or net472.Usage Example
Additional Changes
GitHub.Copilot.SDKv0.1.10 to central package managementsamples/GettingStarted/AgentProviders/Agent_With_GithubCopilotdemonstrating code generation capabilitiesAsAIAgentextension methodMicrosoft.Agents.AI.GithubCopilot.UnitTests(including 4 tests for extension methods)Contribution Checklist
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.