Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4c55bd9
Initial plan
Copilot Jan 22, 2026
5a39df4
Add GitHub Copilot SDK AIAgent implementation with tests
Copilot Jan 22, 2026
9178095
Add projects to solution and fix sample imports
Copilot Jan 22, 2026
b365707
Improve pragma comment clarity in GithubCopilotAgentThread
Copilot Jan 22, 2026
44f3ab6
Address PR feedback: internal constructor/setter, remove CopilotClien…
Copilot Jan 23, 2026
09d526f
Merge branch 'main' into copilot/add-aiagent-implementation
westey-m Jan 23, 2026
52ba627
Add ownsClient parameter to allow caller control over client disposal
Copilot Jan 23, 2026
c348e7d
Fix unit tests by removing await using to avoid StreamJsonRpc disposa…
Copilot Jan 23, 2026
b45d14a
Fix file encoding: add UTF-8 BOM to Program.cs
Copilot Jan 23, 2026
c3f94cb
Fix dotnet-format errors: UTF-8 BOM, remove unused logger, add this q…
Copilot Jan 23, 2026
97f4457
Fix test file encoding and remove redundant cast
Copilot Jan 23, 2026
4ae34d3
Merge branch 'main' into copilot/add-aiagent-implementation
westey-m Jan 23, 2026
a5b7aeb
Add AsAIAgent extension methods for CopilotClient with tests
Copilot Jan 23, 2026
02e6c0e
Merge branch 'main' into copilot/add-aiagent-implementation
dmytrostruk Jan 23, 2026
c643abc
Remove IL suppressions, use TryComplete for channel writer, remove TC…
Copilot Jan 25, 2026
7f82795
Keep session alive across calls, add tools overload, add tests
Copilot Jan 25, 2026
4d781b8
Revert session persistence changes - sessions dispose after each call
Copilot Jan 25, 2026
8501a5d
Add CreatedAt property mapping using DateTimeOffset.UtcNow
Copilot Jan 25, 2026
a8dd828
Add DataContent handling via temp files and attachments
Copilot Jan 25, 2026
e28bb5e
Fix formatting: remove extra indentation, simplify Path references, r…
Copilot Jan 25, 2026
6836ca1
Refactor: extract helper methods to reduce duplication in DataContent…
Copilot Jan 25, 2026
9172cac
Merge branch 'main' into copilot/add-aiagent-implementation
dmytrostruk Jan 26, 2026
67d7b11
Updated sample and session config mapping
dmytrostruk Jan 26, 2026
efef054
Added instructions parameter
dmytrostruk Jan 26, 2026
7c9d36c
Updated README
dmytrostruk Jan 26, 2026
5b07a21
Address PR feedback: reorder params, optimize dictionary, update pref…
Copilot Jan 26, 2026
8ec23a1
Remove StreamJsonRpc reference from sample project
Copilot Jan 26, 2026
251ad7c
Fix parameter ordering: tools now after description, rename to s_medi…
Copilot Jan 26, 2026
ced7299
Fix streaming prompt: change Python to C# for Fibonacci example
Copilot Jan 26, 2026
396d0aa
Handle all SDK events, add UsageContent support, fix model name, remo…
Copilot Jan 26, 2026
105ce0b
Merge branch 'main' into copilot/add-aiagent-implementation
dmytrostruk Jan 26, 2026
1a38887
Merge branch 'main' into copilot/add-aiagent-implementation
dmytrostruk Jan 26, 2026
77b50d7
Resolved build errors
dmytrostruk Jan 26, 2026
9cb4c1f
Addressed comments
dmytrostruk Jan 26, 2026
6e36901
Small fix
dmytrostruk Jan 26, 2026
493536b
Addressed comment
dmytrostruk Jan 26, 2026
50f7c47
Small fix
dmytrostruk Jan 26, 2026
0ae50a6
Addressed comments
dmytrostruk Jan 26, 2026
c9b4753
Added integration tests
dmytrostruk Jan 27, 2026
6ccde66
Small update
dmytrostruk Jan 27, 2026
6803d49
Merge branch 'main' into copilot/add-aiagent-implementation
dmytrostruk Jan 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<PackageVersion Include="Microsoft.SemanticKernel.Agents.AzureAI" Version="1.67.0-preview" />
<PackageVersion Include="Microsoft.SemanticKernel.Plugins.OpenApi" Version="1.67.0" />
<!-- Agent SDKs -->
<PackageVersion Include="GitHub.Copilot.SDK" Version="0.1.10" />
<PackageVersion Include="Microsoft.Agents.CopilotStudio.Client" Version="1.3.171-beta" />
<!-- M365 Agents SDK -->
<PackageVersion Include="AdaptiveCards" Version="3.1.0" />
Expand Down
3 changes: 3 additions & 0 deletions dotnet/agent-framework-dotnet.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Agent_With_AzureOpenAIChatCompletion.csproj" />
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Agent_With_AzureOpenAIResponses.csproj" />
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Agent_With_CustomImplementation.csproj" />
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_GithubCopilot/Agent_With_GithubCopilot.csproj" />
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_GoogleGemini/Agent_With_GoogleGemini.csproj" />
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_Ollama/Agent_With_Ollama.csproj" />
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_ONNX/Agent_With_ONNX.csproj" />
Expand Down Expand Up @@ -395,6 +396,7 @@
<Project Path="src/Microsoft.Agents.AI.Abstractions/Microsoft.Agents.AI.Abstractions.csproj" />
<Project Path="src/Microsoft.Agents.AI.AGUI/Microsoft.Agents.AI.AGUI.csproj" />
<Project Path="src/Microsoft.Agents.AI.Anthropic/Microsoft.Agents.AI.Anthropic.csproj" />
<Project Path="src/Microsoft.Agents.AI.GithubCopilot/Microsoft.Agents.AI.GithubCopilot.csproj" />
<Project Path="src/Microsoft.Agents.AI.AzureAI.Persistent/Microsoft.Agents.AI.AzureAI.Persistent.csproj" />
<Project Path="src/Microsoft.Agents.AI.AzureAI/Microsoft.Agents.AI.AzureAI.csproj" />
<Project Path="src/Microsoft.Agents.AI.CopilotStudio/Microsoft.Agents.AI.CopilotStudio.csproj" />
Expand Down Expand Up @@ -438,6 +440,7 @@
<Project Path="tests/Microsoft.Agents.AI.Abstractions.UnitTests/Microsoft.Agents.AI.Abstractions.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.AGUI.UnitTests/Microsoft.Agents.AI.AGUI.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.Anthropic.UnitTests/Microsoft.Agents.AI.Anthropic.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.GithubCopilot.UnitTests/Microsoft.Agents.AI.GithubCopilot.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.AzureAI.Persistent.UnitTests/Microsoft.Agents.AI.AzureAI.Persistent.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.AzureAI.UnitTests/Microsoft.Agents.AI.AzureAI.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/Microsoft.Agents.AI.CosmosNoSql.UnitTests.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net10.0</TargetFrameworks>

<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GitHub.Copilot.SDK" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\src\Microsoft.Agents.AI.GithubCopilot\Microsoft.Agents.AI.GithubCopilot.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft. All rights reserved.

// This sample shows how to create and use a simple AI agent with GitHub Copilot SDK.

using GitHub.Copilot.SDK;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.GithubCopilot;

// Create a Copilot client with default options
var copilotClientOptions = new CopilotClientOptions
{
AutoStart = true
};

// Create an instance of the AIAgent using GitHub Copilot SDK
AIAgent agent = new GithubCopilotAgent(copilotClientOptions);

// Invoke the agent and output the text result
AgentResponse response = await agent.RunAsync("Tell me a joke about a pirate.");
Comment thread
westey-m marked this conversation as resolved.
Outdated
Console.WriteLine(response);
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Prerequisites
Comment thread
westey-m marked this conversation as resolved.

Before you begin, ensure you have the following prerequisites:

- .NET 10 SDK or later
- GitHub Copilot CLI installed and available in your PATH (or provide a custom path)

## Setting up GitHub Copilot CLI

To use this sample, you need to have the GitHub Copilot CLI installed. You can install it by following the instructions at:
https://github.com/github/copilot-sdk

Once installed, ensure the `copilot` command is available in your PATH, or configure a custom path using `CopilotClientOptions`.

## Running the Sample

No additional environment variables are required if using default configuration. The sample will:

1. Create a GitHub Copilot client with default options
2. Create an AI agent using the Copilot SDK
3. Send a message to the agent
4. Display the response

Run the sample:

```powershell
dotnet run
```

## Advanced Usage

You can customize the agent by providing additional configuration:

```csharp
using GitHub.Copilot.SDK;
using Microsoft.Agents.AI.GithubCopilot;
using Microsoft.Extensions.AI;

// Create a Copilot client with custom options
var copilotClientOptions = new CopilotClientOptions
{
CliPath = "/custom/path/to/copilot", // Custom CLI path
Comment thread
dmytrostruk marked this conversation as resolved.
Outdated
LogLevel = "debug", // Enable debug logging
AutoStart = true
};

// Create session configuration with specific model
var sessionConfig = new SessionConfig
Comment thread
dmytrostruk marked this conversation as resolved.
Outdated
{
Model = "gpt-4",
Comment thread
stephentoub marked this conversation as resolved.
Outdated
Comment thread
stephentoub marked this conversation as resolved.
Outdated
Streaming = false
};

// Create an agent with custom configuration
AIAgent agent = new GithubCopilotAgent(
copilotClientOptions,
sessionConfig,
id: "my-copilot-agent",
name: "My Copilot Assistant",
description: "A helpful AI assistant powered by GitHub Copilot"
);

// Use the agent
AgentResponse response = await agent.RunAsync("What is the weather like today?");
Comment thread
stephentoub marked this conversation as resolved.
Outdated
Console.WriteLine(response);
```

## Streaming Responses

To get streaming responses:

```csharp
await foreach (var update in agent.RunStreamingAsync("Tell me a story"))
{
Console.Write(update.Text);
}
```
1 change: 1 addition & 0 deletions dotnet/samples/GettingStarted/AgentProviders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ See the README.md for each sample for the prerequisites for that sample.
|[Creating an AIAgent with Azure OpenAI ChatCompletion](./Agent_With_AzureOpenAIChatCompletion/)|This sample demonstrates how to create an AIAgent using Azure OpenAI ChatCompletion as the underlying inference service|
|[Creating an AIAgent with Azure OpenAI Responses](./Agent_With_AzureOpenAIResponses/)|This sample demonstrates how to create an AIAgent using Azure OpenAI Responses as the underlying inference service|
|[Creating an AIAgent with a custom implementation](./Agent_With_CustomImplementation/)|This sample demonstrates how to create an AIAgent with a custom implementation|
|[Creating an AIAgent with GitHub Copilot](./Agent_With_GithubCopilot/)|This sample demonstrates how to create an AIAgent using GitHub Copilot SDK as the underlying inference service|
|[Creating an AIAgent with Ollama](./Agent_With_Ollama/)|This sample demonstrates how to create an AIAgent using Ollama as the underlying inference service|
|[Creating an AIAgent with ONNX](./Agent_With_ONNX/)|This sample demonstrates how to create an AIAgent using ONNX as the underlying inference service|
|[Creating an AIAgent with OpenAI Assistants](./Agent_With_OpenAIAssistants/)|This sample demonstrates how to create an AIAgent using OpenAI Assistants as the underlying inference service.</br>WARNING: The Assistants API is deprecated and will be shut down. For more information see the OpenAI documentation: https://platform.openai.com/docs/assistants/migration|
Expand Down
Loading
Loading