Align notebook with updated basic workflow code - #705
Conversation
|
👋 Thanks for contributing Marietta (@marietta-a)! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Lesson 08 “basic workflow” .NET notebook to match the newer workflow sample introduced in PR #653, primarily by switching to the current agent creation, streaming execution, and streaming event types.
Changes:
- Updated referenced SDK/package versions in the notebook (including moving to floating major versions for some packages).
- Migrated agent creation from
GetOpenAIResponseClient(...).CreateAIAgent(...)toGetChatClient(...).AsIChatClient().AsAIAgent(...). - Updated streaming execution/event handling (
StreamAsync→RunStreamingAsync,AgentRunUpdateEvent→AgentResponseUpdateEvent).
Suppressed comments (3)
08-multi-agent/code_samples/workflows-agent-framework/dotNET/01.dotnet-agent-framework-workflow-ghmodel-basic.ipynb:205
- This cell output lists floating versions (e.g.,
OpenTelemetry.Api, 1.*) whileexecution_countis null, so the stored "Installed Packages" output may be stale/misleading. Consider clearing outputs and letting readers run the cell to see resolved versions.
"outputs": [
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.Identity, 1.15.0</span></li><li><span>OpenTelemetry.Api, 1.*</span></li><li><span>System.Linq.Async, 6.0.3</span></li></ul></div></div>"
]
08-multi-agent/code_samples/workflows-agent-framework/dotNET/01.dotnet-agent-framework-workflow-ghmodel-basic.ipynb:249
- This cell output shows a floating version (
Microsoft.Agents.AI.Workflows, 1.*) rather than the resolved version, which can be confusing in a saved notebook. Consider clearing outputs (or re-running and capturing resolved versions).
"outputs": [
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Agents.AI.Workflows, 1.*</span></li></ul></div></div>"
]
08-multi-agent/code_samples/workflows-agent-framework/dotNET/01.dotnet-agent-framework-workflow-ghmodel-basic.ipynb:277
- This cell output shows a floating/prerelease range (
Microsoft.Agents.AI.OpenAI, 1.*-*) rather than the resolved version. For a saved notebook, it’s clearer either to capture the resolved version or clear this output.
"outputs": [
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Agents.AI.OpenAI, 1.*-*</span></li></ul></div></div>"
]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "#r \"nuget: Azure.Identity, 1.15.0\"\n", | ||
| "#r \"nuget: System.Linq.Async, 6.0.3\"\n", | ||
| "#r \"nuget: OpenTelemetry.Api, 1.0.0\"\n", | ||
| "#r \"nuget: OpenTelemetry.Api, 1.0.0\"" | ||
| "#r \"nuget: OpenTelemetry.Api, 1.*\"\n", | ||
| "#r \"nuget: OpenTelemetry.Api, 1.*\"" |
| "outputs": [ | ||
| { | ||
| "data": { | ||
| "text/html": [ | ||
| "<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Extensions.AI, 9.9.1</span></li></ul></div></div>" | ||
| "<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Extensions.AI, 10.*</span></li></ul></div></div>" | ||
| ] |
| "// #r \"nuget: Microsoft.Extensions.AI.OpenAI, 1.*-*\"" | ||
| ] |
| "string messageData=\"\";\n", | ||
| "await foreach (WorkflowEvent evt in run.WatchStreamAsync().ConfigureAwait(false))\n", | ||
| "{\n", | ||
| " if (evt is AgentRunUpdateEvent executorComplete)\n", | ||
| " if (evt is AgentResponseUpdateEvent executorComplete)\n", | ||
| " {\n", | ||
| " if(id==\"\")\n", | ||
| " {\n", |
This PR aligns the notebook with the updated basic workflow in #653