Skip to content

Commit 059b2fd

Browse files
committed
Merge branch 'main' of github.com:victordibia/agent-framework into devui_move_samples
2 parents 53bf3c4 + c2c8ec3 commit 059b2fd

File tree

231 files changed

+7428
-3032
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+7428
-3032
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "Python 3",
33
"image": "mcr.microsoft.com/devcontainers/python:3.13-bullseye",
44
"features": {
5-
"ghcr.io/va-h/devcontainers-features/uv:1": {}
5+
"ghcr.io/va-h/devcontainers-features/uv:1": {},
6+
"ghcr.io/devcontainers/features/azure-cli:1.2.8": {}
67
},
78
"postCreateCommand": "bash ./devsetup.sh",
89
"workspaceFolder": "/workspaces/agent-framework/python/",

.devcontainer/dotnet/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"image": "mcr.microsoft.com/devcontainers/dotnet:9.0",
44
"features": {
55
"ghcr.io/devcontainers/features/dotnet:2.4.0": {},
6-
"ghcr.io/devcontainers/features/powershell:1.5.1": {}
6+
"ghcr.io/devcontainers/features/powershell:1.5.1": {},
7+
"ghcr.io/devcontainers/features/azure-cli:1.2.8": {}
78
},
89
"workspaceFolder": "/workspaces/agent-framework/dotnet/",
910
"customizations": {

.github/.linkspector.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
dirs:
1+
dirs:
22
- .
3+
excludedFiles:
4+
- ./python/CHANGELOG.md
35
ignorePatterns:
46
- pattern: "/github/"
57
- pattern: "./actions"
@@ -18,7 +20,7 @@ ignorePatterns:
1820
# excludedDirs:
1921
# Folders which include links to localhost, since it's not ignored with regular expressions
2022
baseUrl: https://github.com/microsoft/agent-framework/
21-
aliveStatusCodes:
23+
aliveStatusCodes:
2224
- 200
2325
- 206
2426
- 429

.github/workflows/dotnet-build-and-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ jobs:
160160
AzureAI__DeploymentName: ${{ vars.AZUREAI__DEPLOYMENTNAME }}
161161
AzureAI__BingConnectionId: ${{ vars.AZUREAI__BINGCONECTIONID }}
162162
FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }}
163+
FOUNDRY_MEDIA_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MEDIA_DEPLOYMENT_NAME }}
163164
FOUNDRY_MODEL_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MODEL_DEPLOYMENT_NAME }}
164165
FOUNDRY_CONNECTION_GROUNDING_TOOL: ${{ vars.FOUNDRY_CONNECTION_GROUNDING_TOOL }}
165166

.github/workflows/dotnet-format.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ jobs:
8686
run: docker pull mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }}
8787

8888
# This step will run dotnet format on each of the unique csproj files and fail if any changes are made
89+
# exclude-diagnostics should be removed after fixes for IL2026 and IL3050 are out: https://github.com/dotnet/sdk/issues/51136
8990
- name: Run dotnet format
9091
if: steps.find-csproj.outputs.csproj_files != ''
9192
run: |
9293
for csproj in ${{ steps.find-csproj.outputs.csproj_files }}; do
9394
echo "Running dotnet format on $csproj"
94-
docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet format $csproj --verify-no-changes --verbosity diagnostic"
95+
docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet format $csproj --verify-no-changes --verbosity diagnostic --exclude-diagnostics IL2026 IL3050"
9596
done

.github/workflows/python-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
fail-fast: true
1818
matrix:
1919
python-version: ["3.10", "3.11", "3.12", "3.13"]
20-
os: [ubuntu-latest, windows-latest, macos-latest]
20+
# todo: add macos-latest when problems are resolved
21+
os: [ubuntu-latest, windows-latest]
2122
env:
2223
UV_PYTHON: ${{ matrix.python-version }}
2324
permissions:

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,35 @@ if __name__ == "__main__":
119119

120120
### Basic Agent - .NET
121121

122+
Create a simple Agent, using OpenAI Responses, that writes a haiku about the Microsoft Agent Framework
123+
124+
```c#
125+
// dotnet add package Microsoft.Agents.AI.OpenAI --prerelease
126+
using System;
127+
using OpenAI;
128+
129+
// Replace the <apikey> with your OpenAI API key.
130+
var agent = new OpenAIClient("<apikey>")
131+
.GetOpenAIResponseClient("gpt-4o-mini")
132+
.CreateAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
133+
134+
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
135+
```
136+
137+
Create a simple Agent, using Azure OpenAI Responses with token based auth, that writes a haiku about the Microsoft Agent Framework
138+
122139
```c#
123140
// dotnet add package Microsoft.Agents.AI.OpenAI --prerelease
124-
// dotnet add package Azure.AI.OpenAI
125141
// dotnet add package Azure.Identity
126142
// Use `az login` to authenticate with Azure CLI
127143
using System;
128-
using Azure.AI.OpenAI;
129-
using Azure.Identity;
130-
using Microsoft.Agents.AI;
131144
using OpenAI;
132145

133-
var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!;
134-
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME")!;
135-
136-
var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
137-
.GetOpenAIResponseClient(deploymentName)
146+
// Replace <resource> and gpt-4o-mini with your Azure OpenAI resource name and deployment name.
147+
var agent = new OpenAIClient(
148+
new BearerTokenPolicy(new AzureCliCredential(), "https://ai.azure.com/.default"),
149+
new OpenAIClientOptions() { Endpoint = new Uri("https://<resource>.openai.azure.com/openai/v1") })
150+
.GetOpenAIResponseClient("gpt-4o-mini")
138151
.CreateAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
139152

140153
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));

dotnet/agent-framework-dotnet.slnx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<Project Path="samples/GettingStarted/Agents/Agent_Step13_Memory/Agent_Step13_Memory.csproj" />
5353
<Project Path="samples/GettingStarted/Agents/Agent_Step14_Middleware/Agent_Step14_Middleware.csproj" />
5454
<Project Path="samples/GettingStarted/Agents/Agent_Step15_Plugins/Agent_Step15_Plugins.csproj" />
55+
<Project Path="samples/GettingStarted/Agents/Agent_Step16_ChatReduction/Agent_Step16_ChatReduction.csproj" />
5556
</Folder>
5657
<Folder Name="/Samples/GettingStarted/AgentWithOpenAI/">
5758
<File Path="samples/GettingStarted/AgentWithOpenAI/README.md" />
@@ -79,9 +80,10 @@
7980
<Project Path="samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/03_MultiSelection.csproj" />
8081
</Folder>
8182
<Folder Name="/Samples/GettingStarted/Workflows/Declarative/">
82-
<Project Path="samples/GettingStarted/Workflows/Declarative/DeclarativeWorkflow.csproj" />
83-
<Project Path="samples/GettingStarted/Workflows/DeclarativeCode/DeclarativeCode.csproj" />
84-
<Project Path="samples/GettingStarted/Workflows/DeclarativeEject/DeclarativeEject.csproj" />
83+
<File Path="samples/GettingStarted/Workflows/Declarative/README.md" />
84+
<Project Path="samples/GettingStarted/Workflows/Declarative/ExecuteCode/ExecuteCode.csproj" />
85+
<Project Path="samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/ExecuteWorkflow.csproj" />
86+
<Project Path="samples/GettingStarted/Workflows/Declarative/GenerateCode/GenerateCode.csproj" />
8587
</Folder>
8688
<Folder Name="/Samples/GettingStarted/Workflows/Declarative/Examples/">
8789
<File Path="../workflow-samples/DeepResearch.yaml" />
@@ -111,6 +113,7 @@
111113
<Project Path="samples/GettingStarted/Workflows/HumanInTheLoop/HumanInTheLoopBasic/HumanInTheLoopBasic.csproj" />
112114
</Folder>
113115
<Folder Name="/Samples/GettingStarted/Workflows/Observability/">
116+
<Project Path="samples/GettingStarted/Workflows/Observability/ApplicationInsights/ApplicationInsights.csproj" />
114117
<Project Path="samples/GettingStarted/Workflows/Observability/AspireDashboard/AspireDashboard.csproj" />
115118
</Folder>
116119
<Folder Name="/Samples/GettingStarted/Workflows/Visualization/">
@@ -170,6 +173,11 @@
170173
<Project Path="samples/SemanticKernelMigration/AzureOpenAIResponses/Step03_ToolCall/AzureOpenAIResponses_Step03_ToolCall.csproj" />
171174
<Project Path="samples/SemanticKernelMigration/AzureOpenAIResponses/Step04_DependencyInjection/AzureOpenAIResponses_Step04_DependencyInjection.csproj" />
172175
</Folder>
176+
<Folder Name="/Samples/SemanticKernelMigration/AgentOrchestrations/">
177+
<Project Path="samples/SemanticKernelMigration/AgentOrchestrations/Step01_Concurrent/AgentOrchestrations_Step01_Concurrent.csproj" />
178+
<Project Path="samples/SemanticKernelMigration/AgentOrchestrations/Step02_Sequential/AgentOrchestrations_Step02_Sequential.csproj" />
179+
<Project Path="samples/SemanticKernelMigration/AgentOrchestrations/Step03_Handoff/AgentOrchestrations_Step03_Handoff.csproj" />
180+
</Folder>
173181
<Folder Name="/Solution Items/">
174182
<File Path=".editorconfig" />
175183
<File Path=".gitignore" />
@@ -289,6 +297,7 @@
289297
<Project Path="src/Microsoft.Agents.AI.CopilotStudio/Microsoft.Agents.AI.CopilotStudio.csproj" />
290298
<Project Path="src/Microsoft.Agents.AI.Hosting.A2A.AspNetCore/Microsoft.Agents.AI.Hosting.A2A.AspNetCore.csproj" />
291299
<Project Path="src/Microsoft.Agents.AI.Hosting.A2A/Microsoft.Agents.AI.Hosting.A2A.csproj" />
300+
<Project Path="src/Microsoft.Agents.AI.Hosting.OpenAI/Microsoft.Agents.AI.Hosting.OpenAI.csproj" />
292301
<Project Path="src/Microsoft.Agents.AI.Hosting/Microsoft.Agents.AI.Hosting.csproj" />
293302
<Project Path="src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj" />
294303
<Project Path="src/Microsoft.Agents.AI.Workflows.Declarative/Microsoft.Agents.AI.Workflows.Declarative.csproj" />

dotnet/nuget/nuget-package.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<PropertyGroup>
33
<!-- Central version prefix - applies to all nuget packages. -->
44
<VersionPrefix>1.0.0</VersionPrefix>
5-
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix).251002.1</PackageVersion>
6-
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)-preview.251002.1</PackageVersion>
5+
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix).251007.1</PackageVersion>
6+
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)-preview.251007.1</PackageVersion>
77

88
<Configurations>Debug;Release;Publish</Configurations>
99
<IsPackable>true</IsPackable>

dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/AgentWebChat.AgentHost.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<ProjectReference Include="..\..\..\src\Microsoft.Agents.AI.Hosting\Microsoft.Agents.AI.Hosting.csproj" />
1414
<ProjectReference Include="..\..\..\src\Microsoft.Agents.AI\Microsoft.Agents.AI.csproj" />
1515
<ProjectReference Include="..\..\..\src\Microsoft.Agents.AI.Hosting.A2A.AspNetCore\Microsoft.Agents.AI.Hosting.A2A.AspNetCore.csproj" />
16+
<ProjectReference Include="..\..\..\src\Microsoft.Agents.AI.Hosting.OpenAI\Microsoft.Agents.AI.Hosting.OpenAI.csproj" />
1617
<ProjectReference Include="..\AgentWebChat.ServiceDefaults\AgentWebChat.ServiceDefaults.csproj" />
1718
</ItemGroup>
1819

0 commit comments

Comments
 (0)