├── .devcontainer
    ├── devcontainer.json
    └── setup.sh
├── .env.examples
├── .github
    └── dependabot.yml
├── .gitignore
├── .vscode
    └── settings.json
├── 00.ForBeginners
    ├── 01-intro-to-ai-agents
    │   └── code_samples
    │   │   ├── dotnet-agent-framework-travelagent.ipynb
    │   │   └── python-agent-framework-travelagent.ipynb
    ├── 02-explore-agentic-frameworks
    │   └── code_samples
    │   │   ├── dotnet-agent-framework-basicagent.ipynb
    │   │   └── python-agent-framework-basicagent.ipynb
    ├── 03-agentic-design-patterns
    │   └── code_samples
    │   │   ├── dotnet-agent-framework-ghmodel-basicagent.ipynb
    │   │   └── python-agent-framework-ghmodel-basicagent.ipynb
    ├── 04-tool-use
    │   └── code_samples
    │   │   ├── dotnet-agent-framework-ghmodels-tool.ipynb
    │   │   └── python-agent-framework-ghmodel-tools.ipynb
    ├── 05-agentic-rag
    │   └── code_samples
    │   │   ├── document.md
    │   │   ├── dotnet-agent-framework-aifoundry-file-search.ipynb
    │   │   └── python-agent-framework-aifoundry-file-search.ipynb
    ├── 07-planning-design
    │   └── code_samples
    │   │   ├── dotnet-agent-framrwork-ghmodel-planningdesign.ipynb
    │   │   └── python-agent-framrwork-ghmodel-planningdesign.ipynb
    ├── 08-multi-agent
    │   └── code_samples
    │   │   ├── dotnet-agent-framework-ghmodel-workflow-multi-agents.ipynb
    │   │   └── python-agent-framework-ghmodel-workflow-multi-agents.ipynb
    └── README.md
├── 01.AgentFoundation
    └── README.md
├── 02.CreateYourFirstAgent
    ├── README.md
    └── code_samples
    │   ├── dotNET
    │       └── dotnet-travelagent-ghmodel.ipynb
    │   └── python
    │       └── python-travelagent-ghmodel.ipynb
├── 03.ExploerAgentFramework
    ├── README.md
    └── code_samples
    │   ├── dotNET
    │       ├── 01-dotnet-agent-framework-aoai.ipynb
    │       ├── 02-dotnet-agent-framrwork-ghmodel.ipynb
    │       ├── 03-dotnet-agent-framework-aifoundry.ipynb
    │       └── 04-dotnet-agent-framework-foundrylocal.ipynb
    │   └── python
    │       ├── 01-python-agent-framework-aoai.ipynb
    │       ├── 02-python-agent-framrwork-ghmodel.ipynb
    │       ├── 03-python-agent-framework-aifoundry.ipynb
    │       └── 04-python-agent-framrwork-foundrylocal.ipynb
├── 04.Tools
    ├── README.md
    └── code_samples
    │   ├── dotNET
    │       └── foundry
    │       │   ├── 01-dotnet-agent-framework-aifoundry-vision.ipynb
    │       │   ├── 02-dotnet-agent-framework-aifoundry-code-interpreter.ipynb
    │       │   ├── 03-dotnet-agent-framework-aifoundry-binggrounding.ipynb
    │       │   └── 04-dotnet-agent-framework-aifoundry-file-search.ipynb
    │   ├── files
    │       ├── demo.md
    │       └── home.png
    │   └── python
    │       └── foundry
    │           ├── 01.python-agent-framework-aifoundry-vision.ipynb
    │           ├── 02.python-agent-framework-aifoundry-code-interpreter.ipynb
    │           ├── 03.python-agent-framework-aifoundry-binggrounding.ipynb
    │           └── 04.python-agent-framework-aifoundry-file-search.ipynb
├── 05.Providers
    ├── README.md
    └── code_samples
    │   ├── dotNET
    │       ├── 01-dotnet-agent-framework-aifoundry-mcp
    │       │   └── AgentMCP.Console
    │       │   │   ├── .env.examples
    │       │   │   ├── AgentMCP.Console.csproj
    │       │   │   ├── AgentMCP.Console.sln
    │       │   │   └── Program.cs
    │       └── 02-dotnet-agent-framework-aifoundry-a2a
    │       │   └── README.md
    │   └── python
    │       └── 01-python-agent-framework-aifoundry-mcp.ipynb
├── 06.RAGs
    ├── README.md
    └── code_samples
    │   ├── dotNET
    │       └── dotnet-agent-framework-aifoundry-file-search.ipynb
    │   ├── files
    │       └── demo.md
    │   └── python
    │       └── python-agent-framework-aifoundry-file-search.ipynb
├── 07.Workflow
    ├── README.md
    └── code_samples
    │   ├── dotNET
    │       ├── 01.dotnet-agent-framework-workflow-ghmodel-basic.ipynb
    │       ├── 02.dotnet-agent-framework-workflow-ghmodel-sequential.ipynb
    │       ├── 03.dotnet-agent-framework-workflow-ghmodel-concurrent.ipynb
    │       └── 04.dotnet-agent-framework-workflow-aifoundry-condition.ipynb
    │   ├── imgs
    │       └── home.png
    │   └── python
    │       ├── 01.python-agent-framework-workflow-ghmodel-basic.ipynb
    │       ├── 02.python-agent-framework-workflow-ghmodel-sequential.ipynb
    │       ├── 03.python-agent-framework-workflow-ghmodel-concurrent.ipynb
    │       └── 04.python-agent-framework-workflow-aifoundry-condition.ipynb
├── 08.EvaluationAndTracing
    ├── README.md
    └── python
    │   ├── basic_agent_workflow_devui
    │       ├── frontdesk_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       ├── main.py
    │       ├── reviewer_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       ├── test_simple.py
    │       └── travelplan_workflow
    │       │   ├── __init__.py
    │       │   └── workflow.py
    │   ├── foundry_agent
    │       ├── __init__.py
    │       └── agent.py
    │   ├── multi_workflow_aifoundry_devui
    │       ├── .env.example
    │       ├── __init__.py
    │       ├── contentreview_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       ├── evangelist_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       ├── main.py
    │       ├── publisher_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       └── workflow
    │       │   ├── __init__.py
    │       │   └── workflow.py
    │   ├── multi_workflow_foundrylocal_devui
    │       ├── main.py
    │       ├── plan_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       ├── researcher_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       └── workflow
    │       │   ├── __init__.py
    │       │   └── workflow.py
    │   ├── multi_workflow_ghmodel_devui
    │       ├── .env.example
    │       ├── contentreview_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       ├── evangelist_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       ├── main.py
    │       ├── publisher_agent
    │       │   ├── __init__.py
    │       │   └── agent.py
    │       └── workflow
    │       │   ├── __init__.py
    │       │   └── workflow.py
    │   └── tracer_aspire
    │       └── simple.py
├── CODE_OF_CONDUCT.md
├── Installation
    └── requirements.txt
├── LICENSE
├── README.bak.md
├── README.md
├── SECURITY.md
├── SUPPORT.md
├── changelog.md
├── check_imports.py
└── pyproject.toml
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the
 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
 3 | {
 4 | 	"name": "C# (.NET)",
 5 | 	// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
 6 | 	"image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm",
 7 |     "postCreateCommand": "bash ./.devcontainer/setup.sh",
 8 | 	"features": {
 9 | 		"ghcr.io/devcontainers/features/azure-cli:1": {},
10 | 		"ghcr.io/devcontainers/features/github-cli:1": {},
11 | 		"ghcr.io/rocker-org/devcontainer-features/miniforge:2": {},
12 | 		"ghcr.io/azure/azure-dev/azd:0": {}
13 | 	},
14 | 	"customizations": {
15 | 		"vscode": {
16 | 			"extensions": [
17 | 				"ms-dotnettools.vscode-dotnet-pack",
18 | 				"ms-python.vscode-python-envs",
19 | 				"ms-python.python"
20 | 			]
21 | 		}
22 | 	}
23 | 
24 | 	// Features to add to the dev container. More info: https://containers.dev/features.
25 | 	// "features": {},
26 | 
27 | 	// Use 'forwardPorts' to make a list of ports inside the container available locally.
28 | 	// "forwardPorts": [5000, 5001],
29 | 	// "portsAttributes": {
30 | 	//		"5001": {
31 | 	//			"protocol": "https"
32 | 	//		}
33 | 	// }
34 | 
35 | 	// Use 'postCreateCommand' to run commands after the container is created.
36 | 	// "postCreateCommand": "dotnet restore",
37 | 
38 | 	// Configure tool-specific properties.
39 | 	// "customizations": {},
40 | 
41 | 	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
42 | 	// "remoteUser": "root"
43 | }
44 | 
--------------------------------------------------------------------------------
/.devcontainer/setup.sh:
--------------------------------------------------------------------------------
1 | sudo apt update
2 | sudo apt install graphviz -y
3 | conda activate base
--------------------------------------------------------------------------------
/.env.examples:
--------------------------------------------------------------------------------
 1 | GITHUB_TOKEN="Your GitHub Models Token"
 2 | GITHUB_ENDPOINT="Your GitHub Models Endpoint"
 3 | GITHUB_MODEL_ID="Your GitHub Model ID"
 4 | 
 5 | AZURE_OPENAI_ENDPOINT="Your Azure OpenAI Endpoint"
 6 | AZURE_OPENAI_CHAT_DEPLOYMENT_NAME ="Your Azure OpenAI Model Deployment Name"
 7 | 
 8 | 
 9 | FOUNDRYLOCAL_ENDPOINT="Your Foundry Local Endpoint http://localhost:5272/v1"
10 | FOUNDRYLOCAL_MODEL_DEPLOYMENT_NAME="Your Foundry Local Model Deployment Name"
11 | 
12 | 
13 | AZURE_AI_PROJECT_ENDPOINT ="Your Azure AI Foundry Project Endpoint"
14 | AZURE_AI_MODEL_DEPLOYMENT_NAME ="Your Azure AI Foundry Project Deployment Name"
15 | 
16 | BING_CONNECTION_ID="Your Bing Connection ID"
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
 1 | # To get started with Dependabot version updates, you'll need to specify which
 2 | # package ecosystems to update and where the package manifests are located.
 3 | # Please see the documentation for more information:
 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
 5 | # https://containers.dev/guide/dependabot
 6 | 
 7 | version: 2
 8 | updates:
 9 |  - package-ecosystem: "devcontainers"
10 |    directory: "/"
11 |    schedule:
12 |      interval: weekly
13 | 
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
  1 | ## Ignore Visual Studio temporary files, build results, and
  2 | ## files generated by popular Visual Studio add-ons.
  3 | ##
  4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
  5 | 
  6 | # User-specific files
  7 | *.rsuser
  8 | *.suo
  9 | *.user
 10 | *.userosscache
 11 | *.sln.docstates
 12 | *.env
 13 | 
 14 | # User-specific files (MonoDevelop/Xamarin Studio)
 15 | *.userprefs
 16 | 
 17 | # Mono auto generated files
 18 | mono_crash.*
 19 | 
 20 | # Build results
 21 | [Dd]ebug/
 22 | [Dd]ebugPublic/
 23 | [Rr]elease/
 24 | [Rr]eleases/
 25 | x64/
 26 | x86/
 27 | [Ww][Ii][Nn]32/
 28 | [Aa][Rr][Mm]/
 29 | [Aa][Rr][Mm]64/
 30 | [Aa][Rr][Mm]64[Ee][Cc]/
 31 | bld/
 32 | [Oo]bj/
 33 | [Oo]ut/
 34 | [Ll]og/
 35 | [Ll]ogs/
 36 | 
 37 | # Build results on 'Bin' directories
 38 | **/[Bb]in/*
 39 | # Uncomment if you have tasks that rely on *.refresh files to move binaries
 40 | # (https://github.com/github/gitignore/pull/3736)
 41 | #!**/[Bb]in/*.refresh
 42 | 
 43 | # Visual Studio 2015/2017 cache/options directory
 44 | .vs/
 45 | # Uncomment if you have tasks that create the project's static files in wwwroot
 46 | #wwwroot/
 47 | 
 48 | # Visual Studio 2017 auto generated files
 49 | Generated\ Files/
 50 | 
 51 | # MSTest test Results
 52 | [Tt]est[Rr]esult*/
 53 | [Bb]uild[Ll]og.*
 54 | *.trx
 55 | 
 56 | # NUnit
 57 | *.VisualState.xml
 58 | TestResult.xml
 59 | nunit-*.xml
 60 | 
 61 | # Approval Tests result files
 62 | *.received.*
 63 | 
 64 | # Build Results of an ATL Project
 65 | [Dd]ebugPS/
 66 | [Rr]eleasePS/
 67 | dlldata.c
 68 | 
 69 | # Benchmark Results
 70 | BenchmarkDotNet.Artifacts/
 71 | 
 72 | # .NET Core
 73 | project.lock.json
 74 | project.fragment.lock.json
 75 | artifacts/
 76 | 
 77 | # ASP.NET Scaffolding
 78 | ScaffoldingReadMe.txt
 79 | 
 80 | # StyleCop
 81 | StyleCopReport.xml
 82 | 
 83 | # Files built by Visual Studio
 84 | *_i.c
 85 | *_p.c
 86 | *_h.h
 87 | *.ilk
 88 | *.meta
 89 | *.obj
 90 | *.idb
 91 | *.iobj
 92 | *.pch
 93 | *.pdb
 94 | *.ipdb
 95 | *.pgc
 96 | *.pgd
 97 | *.rsp
 98 | # but not Directory.Build.rsp, as it configures directory-level build defaults
 99 | !Directory.Build.rsp
100 | *.sbr
101 | *.tlb
102 | *.tli
103 | *.tlh
104 | *.tmp
105 | *.tmp_proj
106 | *_wpftmp.csproj
107 | *.log
108 | *.tlog
109 | *.vspscc
110 | *.vssscc
111 | .builds
112 | *.pidb
113 | *.svclog
114 | *.scc
115 | 
116 | # Chutzpah Test files
117 | _Chutzpah*
118 | 
119 | # Visual C++ cache files
120 | ipch/
121 | *.aps
122 | *.ncb
123 | *.opendb
124 | *.opensdf
125 | *.sdf
126 | *.cachefile
127 | *.VC.db
128 | *.VC.VC.opendb
129 | 
130 | # Visual Studio profiler
131 | *.psess
132 | *.vsp
133 | *.vspx
134 | *.sap
135 | 
136 | # Visual Studio Trace Files
137 | *.e2e
138 | 
139 | # TFS 2012 Local Workspace
140 | $tf/
141 | 
142 | # Guidance Automation Toolkit
143 | *.gpState
144 | 
145 | # ReSharper is a .NET coding add-in
146 | _ReSharper*/
147 | *.[Rr]e[Ss]harper
148 | *.DotSettings.user
149 | 
150 | # TeamCity is a build add-in
151 | _TeamCity*
152 | 
153 | # DotCover is a Code Coverage Tool
154 | *.dotCover
155 | 
156 | # AxoCover is a Code Coverage Tool
157 | .axoCover/*
158 | !.axoCover/settings.json
159 | 
160 | # Coverlet is a free, cross platform Code Coverage Tool
161 | coverage*.json
162 | coverage*.xml
163 | coverage*.info
164 | 
165 | # Visual Studio code coverage results
166 | *.coverage
167 | *.coveragexml
168 | 
169 | # NCrunch
170 | _NCrunch_*
171 | .NCrunch_*
172 | .*crunch*.local.xml
173 | nCrunchTemp_*
174 | 
175 | # MightyMoose
176 | *.mm.*
177 | AutoTest.Net/
178 | 
179 | # Web workbench (sass)
180 | .sass-cache/
181 | 
182 | # Installshield output folder
183 | [Ee]xpress/
184 | 
185 | # DocProject is a documentation generator add-in
186 | DocProject/buildhelp/
187 | DocProject/Help/*.HxT
188 | DocProject/Help/*.HxC
189 | DocProject/Help/*.hhc
190 | DocProject/Help/*.hhk
191 | DocProject/Help/*.hhp
192 | DocProject/Help/Html2
193 | DocProject/Help/html
194 | 
195 | # Click-Once directory
196 | publish/
197 | 
198 | # Publish Web Output
199 | *.[Pp]ublish.xml
200 | *.azurePubxml
201 | # Note: Comment the next line if you want to checkin your web deploy settings,
202 | # but database connection strings (with potential passwords) will be unencrypted
203 | *.pubxml
204 | *.publishproj
205 | 
206 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
207 | # checkin your Azure Web App publish settings, but sensitive information contained
208 | # in these scripts will be unencrypted
209 | PublishScripts/
210 | 
211 | # NuGet Packages
212 | *.nupkg
213 | # NuGet Symbol Packages
214 | *.snupkg
215 | # The packages folder can be ignored because of Package Restore
216 | **/[Pp]ackages/*
217 | # except build/, which is used as an MSBuild target.
218 | !**/[Pp]ackages/build/
219 | # Uncomment if necessary however generally it will be regenerated when needed
220 | #!**/[Pp]ackages/repositories.config
221 | # NuGet v3's project.json files produces more ignorable files
222 | *.nuget.props
223 | *.nuget.targets
224 | 
225 | # Microsoft Azure Build Output
226 | csx/
227 | *.build.csdef
228 | 
229 | # Microsoft Azure Emulator
230 | ecf/
231 | rcf/
232 | 
233 | # Windows Store app package directories and files
234 | AppPackages/
235 | BundleArtifacts/
236 | Package.StoreAssociation.xml
237 | _pkginfo.txt
238 | *.appx
239 | *.appxbundle
240 | *.appxupload
241 | 
242 | # Visual Studio cache files
243 | # files ending in .cache can be ignored
244 | *.[Cc]ache
245 | # but keep track of directories ending in .cache
246 | !?*.[Cc]ache/
247 | 
248 | # Others
249 | ClientBin/
250 | ~$*
251 | *~
252 | *.dbmdl
253 | *.dbproj.schemaview
254 | *.jfm
255 | *.pfx
256 | *.publishsettings
257 | orleans.codegen.cs
258 | 
259 | # Including strong name files can present a security risk
260 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
261 | #*.snk
262 | 
263 | # Since there are multiple workflows, uncomment next line to ignore bower_components
264 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
265 | #bower_components/
266 | 
267 | # RIA/Silverlight projects
268 | Generated_Code/
269 | 
270 | # Backup & report files from converting an old project file
271 | # to a newer Visual Studio version. Backup files are not needed,
272 | # because we have git ;-)
273 | _UpgradeReport_Files/
274 | Backup*/
275 | UpgradeLog*.XML
276 | UpgradeLog*.htm
277 | ServiceFabricBackup/
278 | *.rptproj.bak
279 | 
280 | # SQL Server files
281 | *.mdf
282 | *.ldf
283 | *.ndf
284 | 
285 | # Business Intelligence projects
286 | *.rdl.data
287 | *.bim.layout
288 | *.bim_*.settings
289 | *.rptproj.rsuser
290 | *- [Bb]ackup.rdl
291 | *- [Bb]ackup ([0-9]).rdl
292 | *- [Bb]ackup ([0-9][0-9]).rdl
293 | 
294 | # Microsoft Fakes
295 | FakesAssemblies/
296 | 
297 | # GhostDoc plugin setting file
298 | *.GhostDoc.xml
299 | 
300 | # Node.js Tools for Visual Studio
301 | .ntvs_analysis.dat
302 | node_modules/
303 | 
304 | # Visual Studio 6 build log
305 | *.plg
306 | 
307 | # Visual Studio 6 workspace options file
308 | *.opt
309 | 
310 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
311 | *.vbw
312 | 
313 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
314 | *.vbp
315 | 
316 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
317 | *.dsw
318 | *.dsp
319 | 
320 | # Visual Studio 6 technical files
321 | *.ncb
322 | *.aps
323 | 
324 | # Visual Studio LightSwitch build output
325 | **/*.HTMLClient/GeneratedArtifacts
326 | **/*.DesktopClient/GeneratedArtifacts
327 | **/*.DesktopClient/ModelManifest.xml
328 | **/*.Server/GeneratedArtifacts
329 | **/*.Server/ModelManifest.xml
330 | _Pvt_Extensions
331 | 
332 | # Paket dependency manager
333 | **/.paket/paket.exe
334 | paket-files/
335 | 
336 | # FAKE - F# Make
337 | **/.fake/
338 | 
339 | # CodeRush personal settings
340 | **/.cr/personal
341 | 
342 | # Python Tools for Visual Studio (PTVS)
343 | **/__pycache__/
344 | *.pyc
345 | 
346 | # Cake - Uncomment if you are using it
347 | #tools/**
348 | #!tools/packages.config
349 | 
350 | # Tabs Studio
351 | *.tss
352 | 
353 | # Telerik's JustMock configuration file
354 | *.jmconfig
355 | 
356 | # BizTalk build output
357 | *.btp.cs
358 | *.btm.cs
359 | *.odx.cs
360 | *.xsd.cs
361 | 
362 | # OpenCover UI analysis results
363 | OpenCover/
364 | 
365 | # Azure Stream Analytics local run output
366 | ASALocalRun/
367 | 
368 | # MSBuild Binary and Structured Log
369 | *.binlog
370 | MSBuild_Logs/
371 | 
372 | # AWS SAM Build and Temporary Artifacts folder
373 | .aws-sam
374 | 
375 | # NVidia Nsight GPU debugger configuration file
376 | *.nvuser
377 | 
378 | # MFractors (Xamarin productivity tool) working folder
379 | **/.mfractor/
380 | 
381 | # Local History for Visual Studio
382 | **/.localhistory/
383 | 
384 | # Visual Studio History (VSHistory) files
385 | .vshistory/
386 | 
387 | # BeatPulse healthcheck temp database
388 | healthchecksdb
389 | 
390 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
391 | MigrationBackup/
392 | 
393 | # Ionide (cross platform F# VS Code tools) working folder
394 | **/.ionide/
395 | 
396 | # Fody - auto-generated XML schema
397 | FodyWeavers.xsd
398 | 
399 | # VS Code files for those working on multiple tools
400 | .vscode/*
401 | !.vscode/settings.json
402 | !.vscode/tasks.json
403 | !.vscode/launch.json
404 | !.vscode/extensions.json
405 | !.vscode/*.code-snippets
406 | 
407 | # Local History for Visual Studio Code
408 | .history/
409 | 
410 | # Built Visual Studio Code Extensions
411 | *.vsix
412 | 
413 | # Windows Installer files from build outputs
414 | *.cab
415 | *.msi
416 | *.msix
417 | *.msm
418 | *.msp
419 | 
420 | # macOS specific files
421 | .DS_Store
422 | .DS_Store?
423 | ._*
424 | .Spotlight-V100
425 | .Trashes
426 | ehthumbs.db
427 | Thumbs.db
428 | 
429 | # Linux specific files
430 | *~
431 | .nfs*
432 | 
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 |     "FSharp.suggestGitignore": false
3 | }
--------------------------------------------------------------------------------
/00.ForBeginners/05-agentic-rag/code_samples/document.md:
--------------------------------------------------------------------------------
1 | - Contoso Travel offers luxury vacation packages to exotic destinations worldwide.
2 | - Our premium travel services include personalized itinerary planning and 24/7 concierge support.
3 | - Contoso's travel insurance covers medical emergencies, trip cancellations, and lost baggage.
4 | - Popular destinations include the Maldives, Swiss Alps, and African safaris.
5 | - Contoso Travel provides exclusive access to boutique hotels and private guided tours.
--------------------------------------------------------------------------------
/00.ForBeginners/05-agentic-rag/code_samples/python-agent-framework-aifoundry-file-search.ipynb:
--------------------------------------------------------------------------------
  1 | {
  2 |  "cells": [
  3 |   {
  4 |    "cell_type": "code",
  5 |    "execution_count": 1,
  6 |    "id": "3a7e1e59",
  7 |    "metadata": {},
  8 |    "outputs": [],
  9 |    "source": [
 10 |     "# ! pip install agent-framework-azure-ai -U"
 11 |    ]
 12 |   },
 13 |   {
 14 |    "cell_type": "code",
 15 |    "execution_count": 2,
 16 |    "id": "97f08567",
 17 |    "metadata": {},
 18 |    "outputs": [],
 19 |    "source": [
 20 |     "import os\n",
 21 |     "\n",
 22 |     "from azure.identity.aio import AzureCliCredential\n",
 23 |     "from azure.ai.projects.aio import AIProjectClient\n",
 24 |     "from dotenv import load_dotenv\n",
 25 |     "\n",
 26 |     "from azure.ai.agents.models import FilePurpose,FileSearchTool\n",
 27 |     "from agent_framework.azure import AzureAIAgentClient\n",
 28 |     "from agent_framework import ChatAgent,HostedFileSearchTool,HostedVectorStoreContent"
 29 |    ]
 30 |   },
 31 |   {
 32 |    "cell_type": "code",
 33 |    "execution_count": 3,
 34 |    "id": "2a3bcf9d",
 35 |    "metadata": {},
 36 |    "outputs": [
 37 |     {
 38 |      "data": {
 39 |       "text/plain": [
 40 |        "True"
 41 |       ]
 42 |      },
 43 |      "execution_count": 3,
 44 |      "metadata": {},
 45 |      "output_type": "execute_result"
 46 |     }
 47 |    ],
 48 |    "source": [
 49 |     "load_dotenv()"
 50 |    ]
 51 |   },
 52 |   {
 53 |    "cell_type": "code",
 54 |    "execution_count": 4,
 55 |    "id": "3d3ca050",
 56 |    "metadata": {},
 57 |    "outputs": [],
 58 |    "source": [
 59 |     "async def create_vector_store(client: AIProjectClient) -> tuple[str, HostedVectorStoreContent]:\n",
 60 |     "    \"\"\"Create a vector store with sample documents.\"\"\"\n",
 61 |     "    file_path = './document.md'\n",
 62 |     "    file = await client.agents.files.upload_and_poll(file_path=file_path, purpose=\"assistants\")\n",
 63 |     "    print(f\"Uploaded file, file ID: {file.id}\")\n",
 64 |     "\n",
 65 |     "\n",
 66 |     "    vector_store = await client.agents.vector_stores.create_and_poll(file_ids=[file.id], name=\"graph_knowledge_base\")\n",
 67 |     "\n",
 68 |     "    print(f\"Created vector store, ID: {vector_store.id}\")\n",
 69 |     "\n",
 70 |     "\n",
 71 |     "    return file.id, HostedVectorStoreContent(vector_store_id=vector_store.id)"
 72 |    ]
 73 |   },
 74 |   {
 75 |    "cell_type": "code",
 76 |    "execution_count": null,
 77 |    "id": "0aef5316",
 78 |    "metadata": {},
 79 |    "outputs": [
 80 |     {
 81 |      "name": "stdout",
 82 |      "output_type": "stream",
 83 |      "text": [
 84 |       "Uploaded file, file ID: assistant-4ZfGbrB55GSNSvKGE8Nnhi\n",
 85 |       "Created vector store, ID: vs_MbrOhkt7ZnLsUdXwc8Sqptkh\n",
 86 |       "Agent created. You can now ask questions about the uploaded document.\n",
 87 |       "Contoso's travel insurance coverage includes protections for medical emergencies, trip cancellations, and lost baggage. This coverage is part of their premium travel services, which also offer personalized itinerary planning and 24/7 concierge support for luxury vacation packages to exotic destinations worldwide【4:0†document.md】."
 88 |      ]
 89 |     }
 90 |    ],
 91 |    "source": [
 92 |     "async with (\n",
 93 |     "        AzureCliCredential() as credential,\n",
 94 |     "        AIProjectClient(endpoint=os.environ[\"AZURE_AI_PROJECT_ENDPOINT\"], credential=credential) as client,\n",
 95 |     "    ):\n",
 96 |     "\n",
 97 |     "        file_id, vector_store = await create_vector_store(client)\n",
 98 |     "        file_search = FileSearchTool(vector_store_ids=[vector_store.vector_store_id])\n",
 99 |     "        created_agent = await client.agents.create_agent(\n",
100 |     "            model=os.environ[\"AZURE_AI_MODEL_DEPLOYMENT_NAME\"], \n",
101 |     "            name=\"PythonRAGAgent\",\n",
102 |     "            instructions=\"\"\"\n",
103 |     "                    You are an AI assistant designed to answer user questions using only the information retrieved from the provided document(s).\n",
104 |     "\n",
105 |     "                    - If a user's question cannot be answered using the retrieved context, **you must clearly respond**: \n",
106 |     "                    \"I'm sorry, but the uploaded document does not contain the necessary information to answer that question.\"\n",
107 |     "                    - Do not answer from general knowledge or reasoning. Do not make assumptions or generate hypothetical explanations.\n",
108 |     "                    - Do not provide definitions, tutorials, or commentary that is not explicitly grounded in the content of the uploaded file(s).\n",
109 |     "                    - If a user asks a question like \"What is a Neural Network?\", and this is not discussed in the uploaded document, respond as instructed above.\n",
110 |     "                    - For questions that do have relevant content in the document (e.g., Contoso's travel insurance coverage), respond accurately, and cite the document explicitly.\n",
111 |     "\n",
112 |     "                    You must behave as if you have no external knowledge beyond what is retrieved from the uploaded document.\n",
113 |     "                    \"\"\",\n",
114 |     "            tools = file_search.definitions,\n",
115 |     "            tool_resources= file_search.resources\n",
116 |     "        )\n",
117 |     "        chat_client=AzureAIAgentClient(project_client=client, agent_id=created_agent.id)\n",
118 |     "\n",
119 |     "\n",
120 |     "        async with ChatAgent(\n",
121 |     "                # passing in the client is optional here, so if you take the agent_id from the portal\n",
122 |     "                # you can use it directly without the two lines above.\n",
123 |     "                chat_client=chat_client,\n",
124 |     "            ) as agent:\n",
125 |     "                    \n",
126 |     "\n",
127 |     "            print(\"Agent created. You can now ask questions about the uploaded document.\")\n",
128 |     "\n",
129 |     "            query = \"Can you explain Contoso's travel insurance coverage?\"\n",
130 |     "\n",
131 |     "            async for chunk in agent.run_stream(query, tools=HostedFileSearchTool(inputs=vector_store)):\n",
132 |     "\n",
133 |     "                if chunk.text:\n",
134 |     "                    print(chunk.text, end=\"\", flush=True)"
135 |    ]
136 |   }
137 |  ],
138 |  "metadata": {
139 |   "kernelspec": {
140 |    "display_name": "agentenv",
141 |    "language": "python",
142 |    "name": "python3"
143 |   },
144 |   "language_info": {
145 |    "codemirror_mode": {
146 |     "name": "ipython",
147 |     "version": 3
148 |    },
149 |    "file_extension": ".py",
150 |    "mimetype": "text/x-python",
151 |    "name": "python",
152 |    "nbconvert_exporter": "python",
153 |    "pygments_lexer": "ipython3",
154 |    "version": "3.12.10"
155 |   },
156 |   "polyglot_notebook": {
157 |    "kernelInfo": {
158 |     "defaultKernelName": "csharp",
159 |     "items": [
160 |      {
161 |       "aliases": [],
162 |       "name": "csharp"
163 |      }
164 |     ]
165 |    }
166 |   }
167 |  },
168 |  "nbformat": 4,
169 |  "nbformat_minor": 5
170 | }
171 | 
--------------------------------------------------------------------------------
/00.ForBeginners/README.md:
--------------------------------------------------------------------------------
  1 | # Microsoft Agent Framework Examples for AI Agents Beginners
  2 | 
  3 | This section provides comprehensive Microsoft Agent Framework examples that extend and complement the content from [Microsoft's AI Agents for Beginners](https://github.com/microsoft/ai-agents-for-beginners) curriculum. These practical code samples demonstrate how to build intelligent agents using both Python and .NET implementations of the Microsoft Agent Framework.
  4 | 
  5 | ## 🎯 Overview
  6 | 
  7 | The examples in this directory are designed to provide hands-on experience with Microsoft Agent Framework, covering fundamental concepts through advanced multi-agent systems. Each lesson includes both Python and .NET code samples to accommodate different development preferences and environments.
  8 | 
  9 | ## 📚 Learning Path
 10 | 
 11 | ### 01. Introduction to AI Agents
 12 | Learn the foundational concepts of AI agents and get started with your first Microsoft Agent Framework implementation.
 13 | 
 14 | **Code Samples:**
 15 | - **Python:** [`python-agent-framework-travelagent.ipynb`](./01-intro-to-ai-agents/code_samples/python-agent-framework-travelagent.ipynb)
 16 | - **.NET:** [`dotnet-agent-framework-travelagent.ipynb`](./01-intro-to-ai-agents/code_samples/dotnet-agent-framework-travelagent.ipynb)
 17 | 
 18 | ### 02. Explore Agentic Frameworks
 19 | Dive deeper into the Microsoft Agent Framework architecture and understand different implementation patterns.
 20 | 
 21 | **Code Samples:**
 22 | - **Python:** [`python-agent-framework-basicagent.ipynb`](./02-explore-agentic-frameworks/code_samples/python-agent-framework-basicagent.ipynb)
 23 | - **.NET:** [`dotnet-agent-framework-basicagent.ipynb`](./02-explore-agentic-frameworks/code_samples/dotnet-agent-framework-basicagent.ipynb)
 24 | 
 25 | ### 03. Agentic Design Patterns
 26 | Explore common design patterns and best practices for building robust AI agents with GitHub Models integration.
 27 | 
 28 | **Code Samples:**
 29 | - **Python:** [`python-agent-framework-ghmodel-basicagent.ipynb`](./03-agentic-design-patterns/code_samples/python-agent-framework-ghmodel-basicagent.ipynb)
 30 | - **.NET:** [`dotnet-agent-framework-ghmodel-basicagent.ipynb`](./03-agentic-design-patterns/code_samples/dotnet-agent-framework-ghmodel-basicagent.ipynb)
 31 | 
 32 | ### 04. Tool Use and Integration
 33 | Learn how to enhance your agents with external tools and capabilities using GitHub Models.
 34 | 
 35 | **Code Samples:**
 36 | - **Python:** [`python-agent-framework-ghmodel-tools.ipynb`](./04-tool-use/code_samples/python-agent-framework-ghmodel-tools.ipynb)
 37 | - **.NET:** [`dotnet-agent-framework-ghmodels-tool.ipynb`](./04-tool-use/code_samples/dotnet-agent-framework-ghmodels-tool.ipynb)
 38 | 
 39 | ### 05. Agentic RAG (Retrieval-Augmented Generation)
 40 | Implement knowledge-enhanced agents using Azure AI Foundry's file search capabilities.
 41 | 
 42 | **Code Samples:**
 43 | - **Python:** [`python-agent-framework-aifoundry-file-search.ipynb`](./05-agentic-rag/code_samples/python-agent-framework-aifoundry-file-search.ipynb)
 44 | - **.NET:** [`dotnet-agent-framework-aifoundry-file-search.ipynb`](./05-agentic-rag/code_samples/dotnet-agent-framework-aifoundry-file-search.ipynb)
 45 | 
 46 | **Supporting Files:**
 47 | - [`document.md`](./05-agentic-rag/code_samples/document.md) - Sample document for RAG demonstrations
 48 | 
 49 | ### 07. Planning and Design
 50 | Explore advanced planning capabilities and design patterns with GitHub Models integration.
 51 | 
 52 | **Code Samples:**
 53 | - **Python:** [`python-agent-framrwork-ghmodel-planningdesign.ipynb`](./07-planning-design/code_samples/python-agent-framrwork-ghmodel-planningdesign.ipynb)
 54 | - **.NET:** [`dotnet-agent-framrwork-ghmodel-planningdesign.ipynb`](./07-planning-design/code_samples/dotnet-agent-framrwork-ghmodel-planningdesign.ipynb)
 55 | 
 56 | ### 08. Multi-Agent Systems
 57 | Build collaborative multi-agent workflows using GitHub Models for complex problem-solving scenarios.
 58 | 
 59 | **Code Samples:**
 60 | - **Python:** [`python-agent-framework-ghmodel-workflow-multi-agents.ipynb`](./08-multi-agent/code_samples/python-agent-framework-ghmodel-workflow-multi-agents.ipynb)
 61 | - **.NET:** [`dotnet-agent-framework-ghmodel-workflow-multi-agents.ipynb`](./08-multi-agent/code_samples/dotnet-agent-framework-ghmodel-workflow-multi-agents.ipynb)
 62 | 
 63 | ### 09. Metacognition
 64 | *Coming Soon* - Advanced metacognitive capabilities for self-aware agents.
 65 | 
 66 | ### 10. AI Agents in Production
 67 | *Coming Soon* - Best practices for deploying and managing agents in production environments.
 68 | 
 69 | ### 11. Agentic Protocols
 70 | *Coming Soon* - Advanced communication protocols and standards for agent interactions.
 71 | 
 72 | ### 12. Context Engineering
 73 | *Coming Soon* - Advanced techniques for context management and optimization.
 74 | 
 75 | ## 🛠 Prerequisites
 76 | 
 77 | ### Development Environment
 78 | - **Python:** Python 3.10 or higher
 79 | - **.NET:** .NET 9.0 or higher
 80 | - Visual Studio Code with appropriate extensions
 81 | 
 82 | ### Required Services
 83 | - **Azure AI Foundry:** For RAG examples and advanced capabilities
 84 | - **GitHub Models:** For GitHub-integrated examples
 85 | - **Azure OpenAI Service:** For certain provider examples
 86 | 
 87 | ### Environment Configuration
 88 | 
 89 | Create a `.env` file or set environment variables for the examples:
 90 | 
 91 | ```env
 92 | # GitHub Models Configuration
 93 | GITHUB_TOKEN=your_github_token
 94 | GITHUB_ENDPOINT=https://models.inference.ai.azure.com
 95 | GITHUB_MODEL_ID=gpt-4o-mini
 96 | 
 97 | # Azure AI Foundry Configuration
 98 | FOUNDRY_PROJECT_ENDPOINT=your_foundry_endpoint
 99 | FOUNDRY_MODEL_DEPLOYMENT_NAME=your_model_name
100 | 
101 | # Azure OpenAI Configuration (if needed)
102 | AZURE_OPENAI_ENDPOINT=your_aoai_endpoint
103 | AZURE_OPENAI_API_KEY=your_aoai_key
104 | AZURE_OPENAI_DEPLOYMENT_NAME=your_deployment_name
105 | ```
106 | 
107 | ## 🚀 Getting Started
108 | 
109 | 1. **Choose your preferred language:** Python or .NET
110 | 2. **Start with lesson 01:** Introduction to AI Agents
111 | 3. **Follow the sequential path:** Each lesson builds upon previous concepts
112 | 4. **Experiment with the code:** Modify examples to understand the framework better
113 | 5. **Apply learnings:** Use the patterns in your own agent projects
114 | 
115 | ## 📝 Code Sample Structure
116 | 
117 | Each code sample is provided as a Jupyter notebook (`.ipynb`) containing:
118 | - **Detailed explanations** of concepts and implementation
119 | - **Step-by-step code** with comments and documentation
120 | - **Practical examples** you can run and modify
121 | - **Best practices** for Microsoft Agent Framework usage
122 | 
123 | ## 🔗 Related Resources
124 | 
125 | - [Microsoft AI Agents for Beginners](https://github.com/microsoft/ai-agents-for-beginners) - Foundational curriculum
126 | - [Microsoft Agent Framework](https://github.com/microsoft/agent-framework) - Official framework repository
127 | - [Azure AI Foundry](https://azure.microsoft.com/en-us/products/ai-foundry) - AI development platform
128 | - [GitHub Models](https://github.com/marketplace/models) - GitHub's AI model marketplace
129 | 
130 | ## 🤝 Contributing
131 | 
132 | We welcome contributions to improve these examples:
133 | - Report issues or bugs
134 | - Suggest new examples or improvements
135 | - Submit pull requests with enhancements
136 | - Share your own agent implementations
137 | 
138 | ---
139 | 
140 | **Ready to build intelligent agents?** Start with [lesson 01](./01-intro-to-ai-agents/) and begin your Microsoft Agent Framework journey! 🚀
--------------------------------------------------------------------------------
/01.AgentFoundation/README.md:
--------------------------------------------------------------------------------
 1 | # Unlocking Autonomous Intelligence: A Guide to AI Agents
 2 | 
 3 | In the rapidly evolving landscape of artificial intelligence, AI Agents represent a significant leap towards truly autonomous and intelligent systems. This tutorial will demystify what AI Agents are, introduce you to Microsoft's powerful tools for building them – specifically the Azure AI Foundry Agent Service and the Microsoft Agent Framework – and prepare you to harness their potential.
 4 | 
 5 | ## What Exactly is an AI Agent?
 6 | 
 7 | Imagine a sophisticated digital assistant that doesn't just respond to commands, but can understand a high-level goal, break it down into actionable steps, and then execute those steps using various tools to achieve the desired outcome, all on its own. That's an AI Agent.
 8 | 
 9 | At its core, an AI Agent is a system driven by a **Large Language Model (LLM)**. This LLM acts as the agent's "brain," providing the reasoning and planning capabilities. To achieve its goals, an agent leverages:
10 | 
11 | * **The LLM (Reasoning Engine):** This is where the magic happens. The LLM interprets your request, generates a plan, makes decisions, and even learns from its experiences.
12 | * **Tools (Action Executors):** Agents are equipped with a diverse set of "tools" that allow them to interact with the external world. These can be anything from searching the internet, calling an API, sending an email, querying a database, or even controlling other software.
13 | * **Memory (Experience & Context):** To act intelligently over time, agents need memory. This can range from a short-term memory to keep track of the current conversation to a long-term memory that stores past observations and learnings, informing future decisions and adapting its behavior.
14 | 
15 | By orchestrating these components, an agent can tackle complex problems, automate workflows, and provide intelligent assistance far beyond simple Q&A.
16 | 
17 | ## Introducing Azure AI Foundry Agent Service: Your Agent Development Hub
18 | 
19 | Developing robust and scalable AI agents for enterprise applications can be complex. This is where the **Azure AI Foundry Agent Service** comes in. Integrated within Azure AI Studio, this service provides a comprehensive, managed platform designed to streamline the entire lifecycle of building, testing, and deploying sophisticated AI agents.
20 | 
21 | Think of it as your dedicated workshop for agent creation, offering:
22 | 
23 | * **Enterprise-Grade Orchestration:** A powerful framework that manages the intricate logic of how your agent reasons, selects tools, and executes multi-step plans reliably.
24 | * **Seamless Tool Integration:** Easily connect your agents to a vast array of tools, including pre-built connectors and the flexibility to integrate your own custom functions and APIs.
25 | * **Managed Infrastructure:** Focus entirely on your agent's intelligence and capabilities, not on infrastructure management. Azure handles the underlying compute, scalability, and deployment complexities.
26 | * **Robust Evaluation & Monitoring:** Tools to rigorously evaluate your agent's performance, ensure safety, and monitor its behavior in real-world scenarios, allowing for continuous improvement.
27 | 
28 | The Azure AI Foundry Agent Service accelerates your journey from an initial agent concept to a production-ready, highly capable AI assistant.
29 | 
30 | ## The Microsoft Agent Framework: The Future of Agent Building
31 | 
32 | The **Microsoft Agent Framework** represents the cutting-edge evolution of Microsoft's commitment to AI agent development. It is a unified, comprehensive framework built to empower developers to create intelligent, natural language-driven agents, and to facilitate the orchestration of multiple agents working collaboratively on complex tasks.
33 | 
34 | This framework is the spiritual successor and consolidation of learnings from pioneering projects like **Semantic Kernel** and **AutoGen**. It integrates the best features and advanced capabilities from these frameworks into a single, cohesive platform, aiming to provide:
35 | 
36 | * **Unified Development Experience:** A consistent and powerful way to build agents, regardless of their complexity or target application.
37 | * **Advanced Orchestration:** Tools to design and manage intricate agent workflows, including scenarios where multiple agents interact and delegate tasks to each other.
38 | * **Focus on Natural Language Interaction:** Strong emphasis on enabling agents to understand and communicate with users effectively through natural language.
39 | 
40 | The Microsoft Agent Framework is designed to be the foundational layer for the next generation of intelligent, autonomous systems, making agent development more accessible and powerful than ever before.
41 | 
42 | 
43 | 
--------------------------------------------------------------------------------
/03.ExploerAgentFramework/code_samples/dotNET/01-dotnet-agent-framework-aoai.ipynb:
--------------------------------------------------------------------------------
  1 | {
  2 |  "cells": [
  3 |   {
  4 |    "cell_type": "code",
  5 |    "execution_count": 1,
  6 |    "id": "667cae86",
  7 |    "metadata": {
  8 |     "language_info": {
  9 |      "name": "polyglot-notebook"
 10 |     },
 11 |     "polyglot_notebook": {
 12 |      "kernelName": "csharp"
 13 |     }
 14 |    },
 15 |    "outputs": [
 16 |     {
 17 |      "data": {
 18 |       "text/html": [
 19 |        "
Installed Packages- Microsoft.Extensions.AI, 9.9.0
 Installed Packages- Azure.AI.OpenAI, 2.1.0
- Azure.Identity, 1.15.0
- OpenAI, 2.4.0
 Installed Packages- Microsoft.Agents.AI.OpenAI, 1.0.0-preview.251001.2
 Installed Packages- microsoft.agents.ai, 1.0.0-preview.251001.2
 Installed Packages- Microsoft.Extensions.AI, 9.9.1
 Installed Packages- Microsoft.Agents.AI.OpenAI, 1.0.0-preview.251001.2
 Installed Packages- microsoft.agents.ai, 1.0.0-preview.251001.2
 Installed Packages- Microsoft.Extensions.AI, 9.9.1
 Installed Packages- Azure.AI.Agents.Persistent, 1.2.0-beta.5
- Azure.Identity, 1.15.0
- System.Linq.Async, 6.0.3
 Installed Packages- Microsoft.Agents.AI.AzureAI, 1.0.0-preview.251001.2
 Installed Packages- microsoft.agents.ai, 1.0.0-preview.251001.2
 Installed Packages- Microsoft.Extensions.AI, 9.9.0
 Installed Packages- Microsoft.Agents.AI.OpenAI, 1.0.0-preview.251001.2
 Installed Packages- microsoft.agents.ai, 1.0.0-preview.251001.2
 Installed Packages- Microsoft.Extensions.AI, 9.9.1
 Installed Packages- Azure.AI.Agents.Persistent, 1.2.0-beta.5
- Azure.Identity, 1.15.0
- System.Linq.Async, 6.0.3
 Installed Packages- Microsoft.Agents.AI.AzureAI, 1.0.0-preview.251001.2
 Installed Packages- microsoft.agents.ai, 1.0.0-preview.251001.2
 Installed Packages- Microsoft.Extensions.AI.OpenAI, 9.9.1-preview.1.25474.6
 
• Added comprehensive documentation for evaluation and debugging tools
• Updated Tutorial Progression to include advanced evaluation techniques
• Enhanced Key Features section with evaluation and tracing capabilities
• Improved project navigation with accurate directory references |
14 | 
15 | #### Repository Structure Alignment
16 | 
17 | | Section | Updates |
18 | |---------|---------|
19 | | Repository Structure Table | • Added `08.EvaluationAndTracing` with Python-only samples
• Documented DevUI visualization tools
• Listed observability and tracing examples
• Maintained consistency with actual project structure |
20 | | Tutorial Progression | • Added evaluation and tracing as advanced level topic
• Organized learning path from beginner to advanced concepts
• Enhanced developer journey documentation |
21 | | Key Features | • Documented DevUI for visual debugging
• Added observability tools for agent tracing
• Highlighted evaluation capabilities for agent development |
22 | 
23 | ## 2025-10-08
24 | 
25 | ### Added Evaluation and Tracing Components
26 | 
27 | **Summary:** Introduced comprehensive evaluation and tracing capabilities for agent development with DevUI visualization and observability features
28 | 
29 | #### Sample Code and Documentation
30 | 
31 | ***Folder*** - *08.EvaluationAndTracing*
32 | 
33 | | Component | Content Added |
34 | |-----------|---------------|
35 | | `README.md` | • Comprehensive tutorial on evaluation and tracing
• DevUI setup and usage instructions
• Observability configuration guide
• Key features and benefits documentation |
36 | 
37 | ***Folder*** - *08.EvaluationAndTracing/python*
38 | 
39 | | Sample | Implementation |
40 | |--------|----------------|
41 | | `basic_agent_workflow_devui/` | • Basic agent workflow with DevUI integration
• Real-time session visualization example
• Interactive debugging demonstration |
42 | | `multi_workflow_ghmodel_devui/` | • Multi-agent workflow with DevUI support
• Complex interaction pattern visualization
• GitHub Models integration with monitoring |
43 | | `tracer_aspire/` | • Observability and logging configuration
• Step-by-step execution tracing
• Python logging framework integration |
44 | 
45 | ## 2025-10-07
46 | 
47 | 
48 | #### Python Samples Update
49 | 
50 | ***Folder*** - *00.ForBeginners/05-agentic-rag/code_samples*
51 | 
52 | | File | Changes Made |
53 | |------|--------------|
54 | | `python-agent-framework-aifoundry-file-search.ipynb` | • Updated Azure AI Foundry file search integration
• Enhanced document processing with vector store management
• Improved RAG capabilities with `HostedFileSearchTool`
• Updated agent creation with persistent file search tools |
55 | 
56 | ***Folder*** - *03.ExploerAgentFramework/code_samples/python*
57 | 
58 | | File | Changes Made |
59 | |------|--------------|
60 | | `03-python-agent-framework-aifoundry.ipynb` | • Updated Azure AI Foundry basic agent integration
• Enhanced agent lifecycle management
• Improved `AzureAIAgentClient` initialization patterns
• Updated async context management for agents |
61 | 
62 | ***Folder*** - *04.Tools/code_samples/python/foundry*
63 | 
64 | | File | Changes Made |
65 | |------|--------------|
66 | | `01.python-agent-framework-aifoundry-vision.ipynb` | • Updated Azure AI Foundry vision capabilities
• Enhanced image processing with base64 encoding
• Improved multimodal content handling
• Updated vision agent creation with furniture consultation features |
67 | | `02.python-agent-framework-aifoundry-code-interpreter.ipynb` | • Updated Azure AI Foundry code interpreter integration
• Enhanced code execution capabilities
• Improved `HostedCodeInterpreterTool` implementation
• Updated mathematical computation features |
68 | | `03.python-agent-framework-aifoundry-binggrounding.ipynb` | • Updated Azure AI Foundry Bing grounding integration
• Enhanced web search capabilities
• Improved `HostedWebSearchTool` implementation
• Updated connection-based search functionality |
69 | | `04.python-agent-framework-aifoundry-file-search.ipynb` | • Updated Azure AI Foundry advanced file search
• Enhanced vector store creation and management
• Improved document upload and processing workflows
• Updated streaming response capabilities for file search |
70 | 
71 | ## 2025-10-03
72 | 
73 | ### Fixed GraphViz Integration
74 | 
75 | **Summary:** Added GraphViz installation and visualization capabilities to all workflow samples
76 | 
77 | #### A. DevContainer Update
78 | 
79 | | Component | Change Description |
80 | |-----------|-------------------|
81 | | Development Environment | Added GraphViz system package to devcontainer configuration |
82 | | Installation | Pre-configured GraphViz to eliminate manual setup steps |
83 | 
84 | #### B. Workflow Samples Update
85 | 
86 | ***Folder*** - *07.Workflow/code_samples/python*
87 | 
88 | | File | Changes Made |
89 | |------|--------------|
90 | | `01.python-agent-framework-workflow-ghmodel-basic.ipynb` | • Added `sudo apt install graphviz -y` installation
• Integrated WorkflowViz for workflow visualization
• Added SVG export with `viz.export(format="svg")`
• Implemented inline notebook rendering with HTML fallback |
91 | | `02.python-agent-framework-workflow-ghmodel-sequential.ipynb` | • Added GraphViz system installation commands
• Integrated workflow visualization for sequential pipeline
• Added SVG generation for three-agent workflow
• Implemented consistent visualization pattern |
92 | | `03.python-agent-framework-workflow-ghmodel-concurrent.ipynb` | • Added GraphViz installation for concurrent workflows
• Implemented parallel execution diagram generation
• Added visual representation of concurrent agents
• Consistent SVG export functionality |
93 | | `04.python-agent-framework-workflow-aifoundry-condition.ipynb` | • Added GraphViz support for conditional workflows
• Implemented decision tree diagram generation
• Added conditional branching visualization
• Consistent visualization approach |
--------------------------------------------------------------------------------
/check_imports.py:
--------------------------------------------------------------------------------
  1 | #!/usr/bin/env python3
  2 | """
  3 | Script to validate that all Python imports in Jupyter notebooks are properly organized using isort.
  4 | """
  5 | 
  6 | import os
  7 | import json
  8 | import subprocess
  9 | import tempfile
 10 | from pathlib import Path
 11 | 
 12 | 
 13 | def extract_python_cells_from_notebook(notebook_path):
 14 |     """Extract Python code cells from a Jupyter notebook."""
 15 |     with open(notebook_path, 'r', encoding='utf-8') as f:
 16 |         notebook = json.load(f)
 17 |     
 18 |     python_code = []
 19 |     for cell in notebook.get('cells', []):
 20 |         if cell.get('cell_type') == 'code' and cell.get('metadata', {}).get('language') == 'python':
 21 |             source = cell.get('source', [])
 22 |             if isinstance(source, list):
 23 |                 code = ''.join(source)
 24 |             else:
 25 |                 code = source
 26 |             
 27 |             # Skip cells that are just pip installs or shell commands
 28 |             if not code.strip().startswith(('!', '%')):
 29 |                 python_code.append(code)
 30 |     
 31 |     return '\n\n'.join(python_code)
 32 | 
 33 | 
 34 | def check_imports_with_isort(code):
 35 |     """Check if the imports in the code are properly organized using isort."""
 36 |     with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as temp_file:
 37 |         temp_file.write(code)
 38 |         temp_file.flush()
 39 |         
 40 |         try:
 41 |             # Run isort in check mode
 42 |             result = subprocess.run(
 43 |                 ['isort', '--check-only', '--diff', temp_file.name],
 44 |                 capture_output=True,
 45 |                 text=True
 46 |             )
 47 |             
 48 |             if result.returncode == 0:
 49 |                 return True, "Imports are properly organized"
 50 |             else:
 51 |                 return False, result.stdout
 52 |         finally:
 53 |             os.unlink(temp_file.name)
 54 | 
 55 | 
 56 | def main():
 57 |     """Main function to check all Python notebooks."""
 58 |     root_dir = Path(__file__).parent
 59 |     notebook_files = list(root_dir.rglob('*.ipynb'))
 60 |     
 61 |     python_notebooks = []
 62 |     for notebook_path in notebook_files:
 63 |         if 'python' in str(notebook_path):
 64 |             python_notebooks.append(notebook_path)
 65 |     
 66 |     print(f"Found {len(python_notebooks)} Python notebooks to check:")
 67 |     
 68 |     all_good = True
 69 |     for notebook_path in python_notebooks:
 70 |         print(f"\nChecking: {notebook_path.relative_to(root_dir)}")
 71 |         
 72 |         try:
 73 |             code = extract_python_cells_from_notebook(notebook_path)
 74 |             if not code.strip():
 75 |                 print("  ✓ No Python code to check")
 76 |                 continue
 77 |                 
 78 |             is_organized, message = check_imports_with_isort(code)
 79 |             if is_organized:
 80 |                 print("  ✓ Imports are properly organized")
 81 |             else:
 82 |                 print("  ✗ Imports need reorganization:")
 83 |                 print(f"    {message}")
 84 |                 all_good = False
 85 |                 
 86 |         except Exception as e:
 87 |             print(f"  ✗ Error checking notebook: {e}")
 88 |             all_good = False
 89 |     
 90 |     if all_good:
 91 |         print("\n🎉 All Python imports are properly organized!")
 92 |     else:
 93 |         print("\n❌ Some imports need to be reorganized.")
 94 |     
 95 |     return 0 if all_good else 1
 96 | 
 97 | 
 98 | if __name__ == "__main__":
 99 |     exit(main())
100 | 
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
 1 | [tool.isort]
 2 | profile = "black"
 3 | multi_line_output = 3
 4 | include_trailing_comma = true
 5 | force_grid_wrap = 0
 6 | use_parentheses = true
 7 | ensure_newline_before_comments = true
 8 | line_length = 88
 9 | known_first_party = ["agent_framework"]
10 | known_third_party = ["azure", "openai", "dotenv"]
11 | sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
12 | import_heading_stdlib = ""
13 | import_heading_thirdparty = ""
14 | import_heading_firstparty = ""
15 | import_heading_localfolder = ""
16 | 
--------------------------------------------------------------------------------