Skip to content

Commit e064f94

Browse files
TaoChenOSUmoonbox3
andauthored
Python: Remove duplicate samples (#3899)
* Remove duplicate samples * Correct paths * Update readme * Update readme * Fix ruff --------- Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
1 parent 1441fd9 commit e064f94

25 files changed

Lines changed: 181 additions & 2780 deletions

python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ if __name__ == "__main__":
233233
asyncio.run(main())
234234
```
235235

236-
For more advanced orchestration patterns including Sequential, Concurrent, Group Chat, Handoff, and Magentic orchestrations, see the [orchestration samples](samples/02-agents/orchestrations).
236+
For more advanced orchestration patterns including Sequential, Concurrent, Group Chat, Handoff, and Magentic orchestrations, see the [orchestration samples](samples/03-workflows/orchestrations).
237237

238238
## More Examples & Samples
239239

python/packages/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ if __name__ == "__main__":
213213
asyncio.run(main())
214214
```
215215

216-
**Note**: Sequential, Concurrent, Group Chat, Handoff, and Magentic orchestrations are available. See examples in [orchestration samples](../../samples/02-agents/orchestrations).
216+
**Note**: Sequential, Concurrent, Group Chat, Handoff, and Magentic orchestrations are available. See examples in [orchestration samples](../../samples/03-workflows/orchestrations).
217217

218218
## More Examples & Samples
219219

python/packages/devui/agent_framework_devui/ui/assets/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/packages/devui/frontend/src/data/gallery/sample-entities.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const SAMPLE_ENTITIES: SampleEntity[] = [
3030
description:
3131
"Weather agent using Azure AI Agent (Foundry) with Azure CLI authentication",
3232
type: "agent",
33-
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/foundry_agent/agent.py",
33+
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/02-agents/devui/foundry_agent/agent.py",
3434
tags: ["azure-ai", "foundry", "tools"],
3535
author: "Microsoft",
3636
difficulty: "beginner",
@@ -61,7 +61,7 @@ export const SAMPLE_ENTITIES: SampleEntity[] = [
6161
description:
6262
"Weather agent using Azure OpenAI with API key authentication",
6363
type: "agent",
64-
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/weather_agent_azure/agent.py",
64+
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/02-agents/devui/weather_agent_azure/agent.py",
6565
tags: ["azure", "openai", "tools"],
6666
author: "Microsoft",
6767
difficulty: "beginner",
@@ -99,7 +99,7 @@ export const SAMPLE_ENTITIES: SampleEntity[] = [
9999
description:
100100
"5-step workflow demonstrating email spam detection with branching logic",
101101
type: "workflow",
102-
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/spam_workflow/workflow.py",
102+
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/02-agents/devui/spam_workflow/workflow.py",
103103
tags: ["workflow", "branching", "multi-step"],
104104
author: "Microsoft",
105105
difficulty: "beginner",
@@ -117,7 +117,7 @@ export const SAMPLE_ENTITIES: SampleEntity[] = [
117117
description:
118118
"Advanced data processing workflow with parallel validation, transformation, and quality assurance stages",
119119
type: "workflow",
120-
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/getting_started/devui/fanout_workflow/workflow.py",
120+
url: "https://raw.githubusercontent.com/microsoft/agent-framework/main/python/samples/02-agents/devui/fanout_workflow/workflow.py",
121121
tags: ["workflow", "fan-out", "fan-in", "parallel"],
122122
author: "Microsoft",
123123
difficulty: "advanced",

python/packages/lab/gaia/agent_framework_lab_gaia/gaia.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def is_float(x: Any) -> bool:
186186

187187
if is_float(ground_truth):
188188
# numeric exact match after normalization
189-
return _normalize_number_str(model_answer) == float(ground_truth)
189+
return abs(_normalize_number_str(model_answer) - float(ground_truth)) < 1e-6
190190
if any(ch in ground_truth for ch in [",", ";"]):
191191
# list with per-element compare (number or string)
192192
gt_elems = _split_string(ground_truth)
@@ -196,7 +196,7 @@ def is_float(x: Any) -> bool:
196196
comparisons = []
197197
for ma, gt in zip(ma_elems, gt_elems, strict=False):
198198
if is_float(gt):
199-
comparisons.append(_normalize_number_str(ma) == float(gt))
199+
comparisons.append(abs(_normalize_number_str(ma) - float(gt)) < 1e-6)
200200
else:
201201
comparisons.append(_normalize_str(ma, remove_punct=False) == _normalize_str(gt, remove_punct=False))
202202
return all(comparisons)

python/samples/02-agents/mcp/agent_as_mcp_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"agent-framework": {
1818
"command": "uv",
1919
"args": [
20-
"--directory=<path to project>/agent-framework/python/samples/getting_started/mcp",
20+
"--directory=<path to project>/agent-framework/python/samples/02-agents/mcp",
2121
"run",
2222
"agent_as_mcp_server.py"
2323
],

0 commit comments

Comments
 (0)