Skip to content

Commit 19bb9f4

Browse files
authored
Merge branch 'main' into dependabot/pip/python/poethepoet-0.43.0
2 parents 48bf7ae + 5e8fe0b commit 19bb9f4

294 files changed

Lines changed: 5337 additions & 961 deletions

File tree

Some content is hidden

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

.github/workflows/dotnet-verify-samples.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ jobs:
6363
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
6464
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
6565

66+
- name: Generate filtered solution
67+
shell: pwsh
68+
run: |
69+
./dotnet/eng/scripts/New-FilteredSolution.ps1 `
70+
-Solution dotnet/agent-framework-dotnet.slnx `
71+
-TargetFramework net10.0 `
72+
-Configuration Debug `
73+
-OutputPath dotnet/filtered.slnx `
74+
-Verbose
75+
76+
- name: Build solution
77+
shell: bash
78+
run: dotnet build dotnet/filtered.slnx -f net10.0 --warnaserror
79+
6680
- name: Run verify-samples
6781
id: verify
6882
working-directory: dotnet

.github/workflows/python-merge-tests.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ jobs:
115115
-m "not integration"
116116
--timeout=120 --session-timeout=900 --timeout_method thread
117117
--retries 2 --retry-delay 5
118+
--junitxml=pytest.xml
118119
working-directory: ./python
119120
- name: Surface failing tests
120121
if: always()
121122
uses: pmeier/pytest-results-action@v0.7.2
122123
with:
123-
path: ./python/**.xml
124+
path: ./python/pytest.xml
124125
summary: true
125126
display-options: fEX
126127
fail-on-empty: false
@@ -163,6 +164,7 @@ jobs:
163164
-n logical --dist worksteal
164165
--timeout=120 --session-timeout=900 --timeout_method thread
165166
--retries 2 --retry-delay 5
167+
--junitxml=pytest.xml
166168
working-directory: ./python
167169
- name: Test OpenAI samples
168170
timeout-minutes: 10
@@ -173,7 +175,7 @@ jobs:
173175
if: always()
174176
uses: pmeier/pytest-results-action@v0.7.2
175177
with:
176-
path: ./python/**.xml
178+
path: ./python/pytest.xml
177179
summary: true
178180
display-options: fEX
179181
fail-on-empty: false
@@ -225,6 +227,7 @@ jobs:
225227
-n logical --dist worksteal
226228
--timeout=120 --session-timeout=900 --timeout_method thread
227229
--retries 2 --retry-delay 5
230+
--junitxml=pytest.xml
228231
working-directory: ./python
229232
- name: Test Azure samples
230233
timeout-minutes: 10
@@ -235,7 +238,7 @@ jobs:
235238
if: always()
236239
uses: pmeier/pytest-results-action@v0.7.2
237240
with:
238-
path: ./python/**.xml
241+
path: ./python/pytest.xml
239242
summary: true
240243
display-options: fEX
241244
fail-on-empty: false
@@ -285,6 +288,7 @@ jobs:
285288
-n logical --dist worksteal
286289
--timeout=120 --session-timeout=900 --timeout_method thread
287290
--retries 2 --retry-delay 5
291+
--junitxml=pytest.xml
288292
working-directory: ./python
289293
- name: Stop local MCP server
290294
if: always()
@@ -310,7 +314,7 @@ jobs:
310314
if: always()
311315
uses: pmeier/pytest-results-action@v0.7.2
312316
with:
313-
path: ./python/**.xml
317+
path: ./python/pytest.xml
314318
summary: true
315319
display-options: fEX
316320
fail-on-empty: false
@@ -375,12 +379,13 @@ jobs:
375379
-x
376380
--timeout=360 --session-timeout=900 --timeout_method thread
377381
--retries 2 --retry-delay 5
382+
--junitxml=pytest.xml
378383
working-directory: ./python
379384
- name: Surface failing tests
380385
if: always()
381386
uses: pmeier/pytest-results-action@v0.7.2
382387
with:
383-
path: ./python/**.xml
388+
path: ./python/pytest.xml
384389
summary: true
385390
display-options: fEX
386391
fail-on-empty: false
@@ -430,12 +435,13 @@ jobs:
430435
-n logical --dist worksteal
431436
--timeout=120 --session-timeout=900 --timeout_method thread
432437
--retries 2 --retry-delay 5
438+
--junitxml=pytest.xml
433439
working-directory: ./python
434440
- name: Surface failing tests
435441
if: always()
436442
uses: pmeier/pytest-results-action@v0.7.2
437443
with:
438-
path: ./python/**.xml
444+
path: ./python/pytest.xml
439445
summary: true
440446
display-options: fEX
441447
fail-on-empty: false
@@ -489,13 +495,13 @@ jobs:
489495
echo "Cosmos DB emulator did not become ready in time." >&2
490496
exit 1
491497
- name: Test with pytest (Cosmos integration)
492-
run: uv run --directory packages/azure-cosmos poe integration-tests -n logical --dist worksteal --timeout=120 --session-timeout=900 --timeout_method thread --retries 2 --retry-delay 5
498+
run: uv run --directory packages/azure-cosmos poe integration-tests -n logical --dist worksteal --timeout=120 --session-timeout=900 --timeout_method thread --retries 2 --retry-delay 5 --junitxml=pytest.xml
493499
working-directory: ./python
494500
- name: Surface failing tests
495501
if: always()
496502
uses: pmeier/pytest-results-action@v0.7.2
497503
with:
498-
path: ./python/**.xml
504+
path: ./python/pytest.xml
499505
summary: true
500506
display-options: fEX
501507
fail-on-empty: false

.github/workflows/python-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ jobs:
4040
UV_CACHE_DIR: /tmp/.uv-cache
4141
# Unit tests
4242
- name: Run all tests
43-
run: uv run poe test -A
43+
run: uv run poe test -A --junitxml=pytest.xml
4444
working-directory: ./python
4545

4646
# Surface failing tests
4747
- name: Surface failing tests
4848
if: always()
4949
uses: pmeier/pytest-results-action@v0.7.2
5050
with:
51-
path: ./python/**.xml
51+
path: ./python/pytest.xml
5252
summary: true
5353
display-options: fEX
5454
fail-on-empty: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ htmlcov/
4747
.cache
4848
nosetests.xml
4949
coverage.xml
50+
pytest.xml
51+
python-coverage.xml
5052
*.cover
5153
*.py,cover
5254
.hypothesis/

README.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,42 +120,42 @@ if __name__ == "__main__":
120120
```
121121

122122
### Basic Agent - .NET
123-
124-
Create a simple Agent, using OpenAI Responses, that writes a haiku about the Microsoft Agent Framework
125-
126-
```c#
127-
// dotnet add package Microsoft.Agents.AI.OpenAI --prerelease
128-
using Microsoft.Agents.AI;
129-
using OpenAI;
130-
using OpenAI.Responses;
131-
132-
// Replace the <apikey> with your OpenAI API key.
133-
var agent = new OpenAIClient("<apikey>")
134-
.GetResponsesClient("gpt-4o-mini")
135-
.AsAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
136-
137-
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
138-
```
139-
140123
Create a simple Agent, using Microsoft Foundry with token-based auth, that writes a haiku about the Microsoft Agent Framework
141124

142125
```c#
143-
// dotnet add package Microsoft.Agents.AI.AzureAI --prerelease
144-
// dotnet add package Azure.Identity
126+
// dotnet add package Microsoft.Agents.AI.Foundry
145127
// Use `az login` to authenticate with Azure CLI
146128
using Azure.AI.Projects;
147129
using Azure.Identity;
148-
using Microsoft.Agents.AI;
130+
using System;
131+
using Azure.AI.Projects;
132+
using Azure.Identity;
149133

150134
var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set.");
151-
var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
135+
var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-5.4-mini";
152136

153137
var agent = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
154138
.AsAIAgent(model: deploymentName, name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
155139

156140
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
157141
```
158142

143+
Create a simple Agent, using OpenAI Responses, that writes a haiku about the Microsoft Agent Framework
144+
145+
```c#
146+
// dotnet add package Microsoft.Agents.AI.OpenAI
147+
using System;
148+
using OpenAI;
149+
using OpenAI.Responses;
150+
151+
// Replace the <apikey> with your OpenAI API key.
152+
var agent = new OpenAIClient("<apikey>")
153+
.GetResponsesClient()
154+
.AsAIAgent(model: "gpt-5.4-mini", name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
155+
156+
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
157+
```
158+
159159
## More Examples & Samples
160160

161161
### Python
@@ -207,4 +207,9 @@ The samples typically read configuration from environment variables. Common requ
207207

208208
## Important Notes
209209

210-
If you use the Microsoft Agent Framework to build applications that operate with third-party servers or agents, you do so at your own risk. We recommend reviewing all data being shared with third-party servers or agents and being cognizant of third-party practices for retention and location of data. It is your responsibility to manage whether your data will flow outside of your organization's Azure compliance and geographic boundaries and any related implications.
210+
> [!IMPORTANT]
211+
> If you use Microsoft Agent Framework to build applications that operate with any third-party servers, agents, code, or non-Azure Direct models (“Third-Party Systems”), you do so at your own risk. Third-Party Systems are Non-Microsoft Products under the Microsoft Product Terms and are governed by their own third-party license terms. You are responsible for any usage and associated costs.
212+
>
213+
>We recommend reviewing all data being shared with and received from Third-Party Systems and being cognizant of third-party practices for handling, sharing, retention and location of data. It is your responsibility to manage whether your data will flow outside of your organization’s Azure compliance and geographic boundaries and any related implications, and that appropriate permissions, boundaries and approvals are provisioned.
214+
>
215+
>You are responsible for carefully reviewing and testing applications you build using Microsoft Agent Framework in the context of your specific use cases, and making all appropriate decisions and customizations. This includes implementing your own responsible AI mitigations such as metaprompt, content filters, or other safety systems, and ensuring your applications meet appropriate quality, reliability, security, and trustworthiness standards. See also: [Transparency FAQ](./TRANSPARENCY_FAQ.md)

dotnet/.github/skills/verify-samples-tool/SKILL.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ The `verify-samples` project (`dotnet/eng/verify-samples/`) is an automated tool
99

1010
## Running verify-samples
1111

12+
**Important:** By default, samples must be pre-built before running verify-samples. Build the solution first, or pass `--build` to build samples during the run:
13+
1214
```bash
1315
cd dotnet
16+
dotnet build agent-framework-dotnet.slnx -f net10.0
17+
```
18+
19+
Then run verify-samples:
1420

21+
```bash
1522
# Run all samples across all categories
1623
dotnet run --project eng/verify-samples -- --log results.log --csv results.csv
1724

@@ -24,6 +31,10 @@ dotnet run --project eng/verify-samples -- Agent_Step02_StructuredOutput Agent_S
2431
# Control parallelism (default 8)
2532
dotnet run --project eng/verify-samples -- --parallel 8 --log results.log
2633

34+
# Build samples during run (skips the need for a prior build step)
35+
# This may cause build conflicts as multiple samples are built in parallel, so use with caution
36+
dotnet run --project eng/verify-samples -- --build --log results.log
37+
2738
# Combine options
2839
dotnet run --project eng/verify-samples -- --category 03-workflows --parallel 4 --log results.log --csv results.csv --md results.md
2940
```

dotnet/eng/verify-samples/AgentsSamples.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ internal static class AgentsSamples
246246
ExpectedOutputDescription =
247247
[
248248
"The output should contain information about both the current time and the weather in Seattle.",
249-
"The weather information should reference the plugin result: cloudy with a high of 15°C.",
249+
"The weather information should be similar to: cloudy with a high of 15°C. Exact phrasing may vary.",
250250
"The output should not contain error messages or stack traces.",
251251
],
252252
},
@@ -521,7 +521,7 @@ internal static class AgentsSamples
521521
OptionalEnvironmentVariables = ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
522522
ExpectedOutputDescription =
523523
[
524-
"The output should demonstrate server-side conversation sessions with non-streaming and streaming turns.",
524+
"The output should contain multiple joke responses showing a multi-turn conversation.",
525525
"The output should not contain error messages or stack traces.",
526526
],
527527
},

dotnet/eng/verify-samples/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
// dotnet run -- --log results.log # Write sequential log to file
1515
// dotnet run -- --csv results.csv # Write CSV summary to file
1616
// dotnet run -- --md results.md # Write Markdown summary to file
17+
// dotnet run -- --build # Build samples during run (default: --no-build)
18+
// Note: By default, this tool expects sample build outputs to already exist.
19+
// Pre-build the solution before running, or pass --build to avoid missing build output failures.
1720
//
1821
// Required environment variables (for AI-powered samples):
1922
// AZURE_OPENAI_ENDPOINT
@@ -63,7 +66,7 @@
6366
// Run all samples
6467
var reporter = new ConsoleReporter();
6568
var verifier = new SampleVerifier(chatClient);
66-
var orchestrator = new VerificationOrchestrator(verifier, reporter, dotnetRoot, TimeSpan.FromMinutes(3), logWriter);
69+
var orchestrator = new VerificationOrchestrator(verifier, reporter, dotnetRoot, TimeSpan.FromMinutes(3), logWriter, buildSamples: options.BuildSamples);
6770

6871
var run = await orchestrator.RunAllAsync(options.Samples, options.MaxParallelism);
6972

dotnet/eng/verify-samples/SampleRunner.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,32 @@ internal static class SampleRunner
2020
{
2121
/// <summary>
2222
/// Runs <c>dotnet run --framework net10.0</c> in the given project directory.
23+
/// When <paramref name="build"/> is false (the default), <c>--no-build</c> is passed
24+
/// to skip building, assuming the project was pre-built.
2325
/// </summary>
2426
public static Task<SampleRunResult> RunAsync(
2527
string projectPath,
2628
TimeSpan timeout,
29+
bool build = false,
2730
CancellationToken cancellationToken = default)
28-
=> RunAsync(projectPath, "run --framework net10.0", timeout, inputs: null, inputDelayMs: 0, cancellationToken: cancellationToken);
31+
=> RunAsync(projectPath, DotnetRunArgs(build), timeout, inputs: null, inputDelayMs: 0, cancellationToken: cancellationToken);
2932

3033
/// <summary>
3134
/// Runs <c>dotnet run --framework net10.0</c> with stdin inputs.
35+
/// When <paramref name="build"/> is false (the default), <c>--no-build</c> is passed
36+
/// to skip building, assuming the project was pre-built.
3237
/// </summary>
3338
public static Task<SampleRunResult> RunAsync(
3439
string projectPath,
3540
TimeSpan timeout,
3641
string?[]? inputs,
3742
int inputDelayMs = 2000,
43+
bool build = false,
3844
CancellationToken cancellationToken = default)
39-
=> RunAsync(projectPath, "run --framework net10.0", timeout, inputs, inputDelayMs, cancellationToken);
45+
=> RunAsync(projectPath, DotnetRunArgs(build), timeout, inputs, inputDelayMs, cancellationToken);
46+
47+
private static string DotnetRunArgs(bool build) =>
48+
$"run {(build ? "" : "--no-build")} --framework net10.0";
4049

4150
/// <summary>
4251
/// Runs an arbitrary <c>dotnet</c> command in the given working directory.

0 commit comments

Comments
 (0)