diff --git a/README.md b/README.md
index e86cf94e60..5dc11508e7 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ Still have questions? Join our [weekly office hours](./COMMUNITY.md#public-commu
### β¨ **Highlights**
- **Graph-based Workflows**: Connect agents and deterministic functions using data flows with streaming, checkpointing, human-in-the-loop, and time-travel capabilities
- - [Python workflows](./python/samples/getting_started/workflows/) | [.NET workflows](./dotnet/samples/GettingStarted/Workflows/)
+ - [Python workflows](./python/samples/03-workflows/) | [.NET workflows](./dotnet/samples/GettingStarted/Workflows/)
- **AF Labs**: Experimental packages for cutting-edge features including benchmarking, reinforcement learning, and research initiatives
- [Labs directory](./python/packages/lab/)
- **DevUI**: Interactive developer UI for agent development, testing, and debugging workflows
@@ -73,11 +73,11 @@ Still have questions? Join our [weekly office hours](./COMMUNITY.md#public-commu
- **Python and C#/.NET Support**: Full framework support for both Python and C#/.NET implementations with consistent APIs
- [Python packages](./python/packages/) | [.NET source](./dotnet/src/)
- **Observability**: Built-in OpenTelemetry integration for distributed tracing, monitoring, and debugging
- - [Python observability](./python/samples/getting_started/observability/) | [.NET telemetry](./dotnet/samples/GettingStarted/AgentOpenTelemetry/)
+ - [Python observability](./python/samples/02-agents/observability/) | [.NET telemetry](./dotnet/samples/GettingStarted/AgentOpenTelemetry/)
- **Multiple Agent Provider Support**: Support for various LLM providers with more being added continuously
- - [Python examples](./python/samples/getting_started/agents/) | [.NET examples](./dotnet/samples/GettingStarted/AgentProviders/)
+ - [Python examples](./python/samples/02-agents/providers/) | [.NET examples](./dotnet/samples/GettingStarted/AgentProviders/)
- **Middleware**: Flexible middleware system for request/response processing, exception handling, and custom pipelines
- - [Python middleware](./python/samples/getting_started/middleware/) | [.NET middleware](./dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/)
+ - [Python middleware](./python/samples/02-agents/middleware/) | [.NET middleware](./dotnet/samples/GettingStarted/Agents/Agent_Step14_Middleware/)
### π¬ **We want your feedback!**
@@ -159,9 +159,9 @@ Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Fram
### Python
-- [Getting Started with Agents](./python/samples/getting_started/agents): basic agent creation and tool usage
-- [Chat Client Examples](./python/samples/getting_started/chat_client): direct chat client usage patterns
-- [Getting Started with Workflows](./python/samples/getting_started/workflows): basic workflow creation and integration with agents
+- [Getting Started with Agents](./python/samples/01-get-started): progressive tutorial from hello-world to hosting
+- [Agent Concepts](./python/samples/02-agents): deep-dive samples by topic (tools, middleware, providers, etc.)
+- [Getting Started with Workflows](./python/samples/03-workflows): workflow creation and integration with agents
### .NET
diff --git a/agent-samples/README.md b/agent-samples/README.md
index ea5c8b0aeb..953affeb08 100644
--- a/agent-samples/README.md
+++ b/agent-samples/README.md
@@ -1,3 +1,3 @@
# Declarative Agents
-This folder contains sample agent definitions that can be run using the declarative agent support, for python see the [declarative agent python sample folder](../python/samples/getting_started/declarative/).
+This folder contains sample agent definitions that can be run using the declarative agent support, for python see the [declarative agent python sample folder](../python/samples/02-agents/declarative/).
diff --git a/docs/decisions/0012-python-typeddict-options.md b/docs/decisions/0012-python-typeddict-options.md
index 23864c2459..5e754dc3dc 100644
--- a/docs/decisions/0012-python-typeddict-options.md
+++ b/docs/decisions/0012-python-typeddict-options.md
@@ -126,4 +126,4 @@ response = await client.get_response(
Chosen option: **"Option 2: TypedDict with Generic Type Parameters"**, because it provides full type safety, excellent IDE support with autocompletion, and allows users to extend provider-specific options for their use cases. Extended this Generic to ChatAgents in order to also properly type the options used in agent construction and run methods.
-See [typed_options.py](../../python/samples/concepts/typed_options.py) for a complete example demonstrating the usage of typed options with custom extensions.
+See [typed_options.py](../../python/samples/02-agents/typed_options.py) for a complete example demonstrating the usage of typed options with custom extensions.
diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props
index d0227c1dbe..de0efb2eb5 100644
--- a/dotnet/Directory.Packages.props
+++ b/dotnet/Directory.Packages.props
@@ -89,7 +89,7 @@
-
+
diff --git a/dotnet/nuget/nuget-package.props b/dotnet/nuget/nuget-package.props
index 7399e723a7..c87a80361b 100644
--- a/dotnet/nuget/nuget-package.props
+++ b/dotnet/nuget/nuget-package.props
@@ -2,9 +2,9 @@
1.0.0
- $(VersionPrefix)-$(VersionSuffix).260209.1
- $(VersionPrefix)-preview.260209.1
- 1.0.0-preview.260209.1
+ $(VersionPrefix)-$(VersionSuffix).260212.1
+ $(VersionPrefix)-preview.260212.1
+ 1.0.0-preview.260212.1
Debug;Release;Publish
true
diff --git a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs
index 0754f52710..f0533c8461 100644
--- a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs
+++ b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs
@@ -147,21 +147,7 @@ public sealed class GitHubCopilotAgent : AIAgent, IAsyncDisposable
// Create or resume a session with streaming enabled
SessionConfig sessionConfig = this._sessionConfig != null
- ? new SessionConfig
- {
- Model = this._sessionConfig.Model,
- Tools = this._sessionConfig.Tools,
- SystemMessage = this._sessionConfig.SystemMessage,
- AvailableTools = this._sessionConfig.AvailableTools,
- ExcludedTools = this._sessionConfig.ExcludedTools,
- Provider = this._sessionConfig.Provider,
- OnPermissionRequest = this._sessionConfig.OnPermissionRequest,
- McpServers = this._sessionConfig.McpServers,
- CustomAgents = this._sessionConfig.CustomAgents,
- SkillDirectories = this._sessionConfig.SkillDirectories,
- DisabledSkills = this._sessionConfig.DisabledSkills,
- Streaming = true
- }
+ ? CopySessionConfig(this._sessionConfig)
: new SessionConfig { Streaming = true };
CopilotSession copilotSession;
@@ -283,16 +269,64 @@ public sealed class GitHubCopilotAgent : AIAgent, IAsyncDisposable
}
private ResumeSessionConfig CreateResumeConfig()
+ {
+ return CopyResumeSessionConfig(this._sessionConfig);
+ }
+
+ ///
+ /// Copies all supported properties from a source into a new instance
+ /// with set to true.
+ ///
+ internal static SessionConfig CopySessionConfig(SessionConfig source)
+ {
+ return new SessionConfig
+ {
+ Model = source.Model,
+ ReasoningEffort = source.ReasoningEffort,
+ Tools = source.Tools,
+ SystemMessage = source.SystemMessage,
+ AvailableTools = source.AvailableTools,
+ ExcludedTools = source.ExcludedTools,
+ Provider = source.Provider,
+ OnPermissionRequest = source.OnPermissionRequest,
+ OnUserInputRequest = source.OnUserInputRequest,
+ Hooks = source.Hooks,
+ WorkingDirectory = source.WorkingDirectory,
+ ConfigDir = source.ConfigDir,
+ McpServers = source.McpServers,
+ CustomAgents = source.CustomAgents,
+ SkillDirectories = source.SkillDirectories,
+ DisabledSkills = source.DisabledSkills,
+ InfiniteSessions = source.InfiniteSessions,
+ Streaming = true
+ };
+ }
+
+ ///
+ /// Copies all supported properties from a source into a new
+ /// with set to true.
+ ///
+ internal static ResumeSessionConfig CopyResumeSessionConfig(SessionConfig? source)
{
return new ResumeSessionConfig
{
- Tools = this._sessionConfig?.Tools,
- Provider = this._sessionConfig?.Provider,
- OnPermissionRequest = this._sessionConfig?.OnPermissionRequest,
- McpServers = this._sessionConfig?.McpServers,
- CustomAgents = this._sessionConfig?.CustomAgents,
- SkillDirectories = this._sessionConfig?.SkillDirectories,
- DisabledSkills = this._sessionConfig?.DisabledSkills,
+ Model = source?.Model,
+ ReasoningEffort = source?.ReasoningEffort,
+ Tools = source?.Tools,
+ SystemMessage = source?.SystemMessage,
+ AvailableTools = source?.AvailableTools,
+ ExcludedTools = source?.ExcludedTools,
+ Provider = source?.Provider,
+ OnPermissionRequest = source?.OnPermissionRequest,
+ OnUserInputRequest = source?.OnUserInputRequest,
+ Hooks = source?.Hooks,
+ WorkingDirectory = source?.WorkingDirectory,
+ ConfigDir = source?.ConfigDir,
+ McpServers = source?.McpServers,
+ CustomAgents = source?.CustomAgents,
+ SkillDirectories = source?.SkillDirectories,
+ DisabledSkills = source?.DisabledSkills,
+ InfiniteSessions = source?.InfiniteSessions,
Streaming = true
};
}
@@ -427,9 +461,8 @@ public sealed class GitHubCopilotAgent : AIAgent, IAsyncDisposable
string tempFilePath = await dataContent.SaveToAsync(tempDir, cancellationToken).ConfigureAwait(false);
attachments ??= [];
- attachments.Add(new UserMessageDataAttachmentsItem
+ attachments.Add(new UserMessageDataAttachmentsItemFile
{
- Type = UserMessageDataAttachmentsItemType.File,
Path = tempFilePath,
DisplayName = Path.GetFileName(tempFilePath)
});
diff --git a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/Microsoft.Agents.AI.GitHub.Copilot.csproj b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/Microsoft.Agents.AI.GitHub.Copilot.csproj
index f4f79c27bd..4c436263c1 100644
--- a/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/Microsoft.Agents.AI.GitHub.Copilot.csproj
+++ b/dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/Microsoft.Agents.AI.GitHub.Copilot.csproj
@@ -17,6 +17,10 @@
+
+
+
+
diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.cs
index ba15f9d0c7..de779128f5 100644
--- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.cs
+++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.cs
@@ -65,7 +65,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
this._values = [evaluatedValue];
}
- await this.ResetAsync(context, null, cancellationToken).ConfigureAwait(false);
+ await this.ResetAsync(context, cancellationToken).ConfigureAwait(false);
return default;
}
@@ -84,9 +84,19 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
AssignVariable(this.Index, "this._index", tightFormat: true);
}
- this.Write("\n\n this._index++;\n }\n }\n\n public async ValueTask ResetAsy" +
- "nc(IWorkflowContext context, object? _, CancellationToken cancellationToken)\n " +
- " {");
+ this.Write(@"
+
+ this._index++;
+ }
+ }
+
+ public async ValueTask CompleteAsync(IWorkflowContext context, object? _, CancellationToken cancellationToken)
+ {
+ await this.ResetAsync(context, cancellationToken).ConfigureAwait(false);
+ }
+
+ private async ValueTask ResetAsync(IWorkflowContext context, CancellationToken cancellationToken)
+ {");
AssignVariable(this.Value, "UnassignedValue.Instance", tightFormat: true);
diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.tt b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.tt
index 77f13c5184..8a9c8d5910 100644
--- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.tt
+++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/ForeachTemplate.tt
@@ -36,7 +36,7 @@ internal sealed class <#= this.Name #>Executor(FormulaSession session) : ActionE
this._values = [evaluatedValue];
}
- await this.ResetAsync(context, null, cancellationToken).ConfigureAwait(false);
+ await this.ResetAsync(context, cancellationToken).ConfigureAwait(false);
return default;
}
@@ -59,7 +59,12 @@ internal sealed class <#= this.Name #>Executor(FormulaSession session) : ActionE
}
}
- public async ValueTask ResetAsync(IWorkflowContext context, object? _, CancellationToken cancellationToken)
+ public async ValueTask CompleteAsync(IWorkflowContext context, object? _, CancellationToken cancellationToken)
+ {
+ await this.ResetAsync(context, cancellationToken).ConfigureAwait(false);
+ }
+
+ private async ValueTask ResetAsync(IWorkflowContext context, CancellationToken cancellationToken)
{<#
AssignVariable(this.Value, "UnassignedValue.Instance", tightFormat: true);
diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowActionVisitor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowActionVisitor.cs
index a90b1bd9c9..3ecb91ea3a 100644
--- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowActionVisitor.cs
+++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowActionVisitor.cs
@@ -201,7 +201,7 @@ internal sealed class WorkflowActionVisitor : DialogActionVisitor
{
// Transition to end of inner actions
string endActionsId = ForeachExecutor.Steps.End(action.Id);
- this.ContinueWith(new DelegateActionExecutor(endActionsId, this._workflowState, action.ResetAsync), action.Id);
+ this.ContinueWith(new DelegateActionExecutor(endActionsId, this._workflowState, action.CompleteAsync), action.Id);
// Transition to select the next item
this._workflowModel.AddLink(endActionsId, loopId);
}
diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowTemplateVisitor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowTemplateVisitor.cs
index 065f04aaac..56901762f4 100644
--- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowTemplateVisitor.cs
+++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowTemplateVisitor.cs
@@ -163,7 +163,7 @@ internal sealed class WorkflowTemplateVisitor : DialogActionVisitor
{
// Transition to end of inner actions
string endActionsId = ForeachExecutor.Steps.End(action.Id); // Loop continuation
- this.ContinueWith(new EmptyTemplate(endActionsId, this._rootId, $"{action.Id.FormatName()}.{nameof(ForeachExecutor.ResetAsync)}"), action.Id);
+ this.ContinueWith(new EmptyTemplate(endActionsId, this._rootId, $"{action.Id.FormatName()}.{nameof(ForeachExecutor.CompleteAsync)}"), action.Id);
// Transition to select the next item
this._workflowModel.AddLink(endActionsId, loopId);
}
diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/ForeachExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/ForeachExecutor.cs
index 2b4c21c86b..258f3c413b 100644
--- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/ForeachExecutor.cs
+++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/ForeachExecutor.cs
@@ -37,27 +37,21 @@ internal sealed class ForeachExecutor : DeclarativeActionExecutor
protected override async ValueTask