From 547b06a4825546c05695f4129b4ed842988810ae Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Thu, 12 Feb 2026 12:17:41 -0800 Subject: [PATCH 1/3] Renamed with comments --- .../AzureAgentProvider.cs | 2 +- .../DeclarativeWorkflowOptions.cs | 4 ++-- .../Extensions/AgentProviderExtensions.cs | 2 +- .../Kit/AgentExecutor.cs | 4 ++-- .../Kit/RootExecutor.cs | 2 +- .../AddConversationMessageExecutor.cs | 2 +- .../CopyConversationMessagesExecutor.cs | 2 +- .../ObjectModel/CreateConversationExecutor.cs | 2 +- .../ObjectModel/InvokeAzureAgentExecutor.cs | 2 +- .../ObjectModel/QuestionExecutor.cs | 2 +- .../RequestExternalInputExecutor.cs | 2 +- .../RetrieveConversationMessageExecutor.cs | 2 +- .../RetrieveConversationMessagesExecutor.cs | 2 +- ...ntProvider.cs => ResponseAgentProvider.cs} | 10 ++++++++-- .../DeclarativeWorkflowContextTest.cs | 4 ++-- .../DeclarativeWorkflowOptionsTest.cs | 20 +++++++++---------- .../DeclarativeWorkflowTest.cs | 8 ++++---- ...clarativeWorkflowOptionsExtensionsTests.cs | 2 +- .../MockAgentProvider.cs | 4 ++-- 19 files changed, 42 insertions(+), 36 deletions(-) rename dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/{WorkflowAgentProvider.cs => ResponseAgentProvider.cs} (92%) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.AzureAI/AzureAgentProvider.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.AzureAI/AzureAgentProvider.cs index c45e601990..9f909ad84e 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.AzureAI/AzureAgentProvider.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.AzureAI/AzureAgentProvider.cs @@ -25,7 +25,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative; /// project endpoint and credentials to authenticate requests. /// A instance representing the endpoint URL of the Foundry project. This must be a valid, non-null URI pointing to the project. /// The credentials used to authenticate with the Foundry project. This must be a valid instance of . -public sealed class AzureAgentProvider(Uri projectEndpoint, TokenCredential projectCredentials) : WorkflowAgentProvider +public sealed class AzureAgentProvider(Uri projectEndpoint, TokenCredential projectCredentials) : ResponseAgentProvider { private readonly Dictionary _versionCache = []; private readonly Dictionary _agentCache = []; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/DeclarativeWorkflowOptions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/DeclarativeWorkflowOptions.cs index ab7794f1b8..c4808f9311 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/DeclarativeWorkflowOptions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/DeclarativeWorkflowOptions.cs @@ -13,12 +13,12 @@ namespace Microsoft.Agents.AI.Workflows.Declarative; /// /// Configuration options for workflow execution. /// -public sealed class DeclarativeWorkflowOptions(WorkflowAgentProvider agentProvider) +public sealed class DeclarativeWorkflowOptions(ResponseAgentProvider agentProvider) { /// /// Defines the agent provider. /// - public WorkflowAgentProvider AgentProvider { get; } = Throw.IfNull(agentProvider); + public ResponseAgentProvider AgentProvider { get; } = Throw.IfNull(agentProvider); /// /// Defines the configuration settings for the workflow. diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs index 19dd4aae75..714ce4747d 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/AgentProviderExtensions.cs @@ -10,7 +10,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.Extensions; internal static class AgentProviderExtensions { public static async ValueTask InvokeAgentAsync( - this WorkflowAgentProvider agentProvider, + this ResponseAgentProvider agentProvider, string executorId, IWorkflowContext context, string agentName, diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/AgentExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/AgentExecutor.cs index 9545b9d1ff..aea534a258 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/AgentExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/AgentExecutor.cs @@ -14,10 +14,10 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.Kit; /// The executor id /// Session to support formula expressions. /// Provider for accessing and manipulating agents and conversations. -public abstract class AgentExecutor(string id, FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id, session) +public abstract class AgentExecutor(string id, FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id, session) { /// - /// Invokes an agent using the provided . + /// Invokes an agent using the provided . /// /// The workflow execution context providing messaging and state services. /// The name or identifier of the agent. diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/RootExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/RootExecutor.cs index 4439207701..641ecc78a0 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/RootExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/RootExecutor.cs @@ -18,7 +18,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.Kit; public abstract class RootExecutor : Executor, IResettableExecutor where TInput : notnull { private readonly IConfiguration? _configuration; - private readonly WorkflowAgentProvider _agentProvider; + private readonly ResponseAgentProvider _agentProvider; private readonly WorkflowFormulaState _state; private readonly Func? _inputTransform; diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs index 30c887ffe2..21c14de546 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs @@ -12,7 +12,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class AddConversationMessageExecutor(AddConversationMessage model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) : +internal sealed class AddConversationMessageExecutor(AddConversationMessage model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken = default) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CopyConversationMessagesExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CopyConversationMessagesExecutor.cs index bf5be5310f..381abcb84d 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CopyConversationMessagesExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CopyConversationMessagesExecutor.cs @@ -13,7 +13,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class CopyConversationMessagesExecutor(CopyConversationMessages model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) : +internal sealed class CopyConversationMessagesExecutor(CopyConversationMessages model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken = default) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CreateConversationExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CreateConversationExecutor.cs index 7bfaed1ab0..f4af4d447e 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CreateConversationExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/CreateConversationExecutor.cs @@ -11,7 +11,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class CreateConversationExecutor(CreateConversation model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) : +internal sealed class CreateConversationExecutor(CreateConversation model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken = default) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs index 0e03b45bc1..0a02771c3e 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs @@ -17,7 +17,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class InvokeAzureAgentExecutor(InvokeAzureAgent model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) : +internal sealed class InvokeAzureAgentExecutor(InvokeAzureAgent model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { public static class Steps diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/QuestionExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/QuestionExecutor.cs index 5592b7e7fe..07013e6570 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/QuestionExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/QuestionExecutor.cs @@ -16,7 +16,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class QuestionExecutor(Question model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) : +internal sealed class QuestionExecutor(Question model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { public static class Steps diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RequestExternalInputExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RequestExternalInputExecutor.cs index 16635149c6..a0a39790bc 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RequestExternalInputExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RequestExternalInputExecutor.cs @@ -12,7 +12,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class RequestExternalInputExecutor(RequestExternalInput model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) +internal sealed class RequestExternalInputExecutor(RequestExternalInput model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { public static class Steps diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessageExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessageExecutor.cs index 5ce3869ed1..05b950f14c 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessageExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessageExecutor.cs @@ -11,7 +11,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class RetrieveConversationMessageExecutor(RetrieveConversationMessage model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) : +internal sealed class RetrieveConversationMessageExecutor(RetrieveConversationMessage model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken = default) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessagesExecutor.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessagesExecutor.cs index 96c3ceee1a..a790e78f63 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessagesExecutor.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/RetrieveConversationMessagesExecutor.cs @@ -13,7 +13,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.ObjectModel; -internal sealed class RetrieveConversationMessagesExecutor(RetrieveConversationMessages model, WorkflowAgentProvider agentProvider, WorkflowFormulaState state) : +internal sealed class RetrieveConversationMessagesExecutor(RetrieveConversationMessages model, ResponseAgentProvider agentProvider, WorkflowFormulaState state) : DeclarativeActionExecutor(model, state) { protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken = default) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/WorkflowAgentProvider.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ResponseAgentProvider.cs similarity index 92% rename from dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/WorkflowAgentProvider.cs rename to dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ResponseAgentProvider.cs index cfd75d1ca4..b2800ae7ff 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/WorkflowAgentProvider.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ResponseAgentProvider.cs @@ -11,9 +11,15 @@ namespace Microsoft.Agents.AI.Workflows.Declarative; /// -/// Base class for workflow agent providers. +/// Defines contract used by declarative workflow actions to invoke and manipulate agents and conversations. /// -public abstract class WorkflowAgentProvider +/// +/// The shape of this provider contract is very much opinionated around patterns that exist in the Open AI Responses API. +/// In addition to direct usage of the Responses API, Foundry V2 agents are supported as they are fundamentally based on +/// the Open AI Responses API. Using other or patterns that are not +/// based on the Response API is currently not supported. +/// +public abstract class ResponseAgentProvider { /// /// Gets or sets a collection of additional tools an agent is able to automatically invoke. diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowContextTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowContextTest.cs index 20d9a32878..d3fa36ffac 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowContextTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowContextTest.cs @@ -14,7 +14,7 @@ public class DeclarativeWorkflowContextTests public void InitializeDefaultValues() { // Act - Mock mockProvider = new(MockBehavior.Strict); + Mock mockProvider = new(MockBehavior.Strict); DeclarativeWorkflowOptions context = new(mockProvider.Object); // Assert @@ -34,7 +34,7 @@ public void InitializeExplicitValues() ILoggerFactory loggerFactory = LoggerFactory.Create(builder => { }); // Act - Mock mockProvider = new(MockBehavior.Strict); + Mock mockProvider = new(MockBehavior.Strict); DeclarativeWorkflowOptions context = new(mockProvider.Object) { MaximumCallDepth = MaxCallDepth, diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowOptionsTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowOptionsTest.cs index 73c4792e32..64e14d66ac 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowOptionsTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowOptionsTest.cs @@ -65,7 +65,7 @@ public void Dispose() public void ConfigureTelemetry_DefaultIsNull() { // Arrange - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); // Act DeclarativeWorkflowOptions options = new(mockProvider.Object); @@ -78,7 +78,7 @@ public void ConfigureTelemetry_DefaultIsNull() public void ConfigureTelemetry_CanBeSet() { // Arrange - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); bool callbackInvoked = false; // Act @@ -103,7 +103,7 @@ public void ConfigureTelemetry_CanBeSet() public void TelemetryActivitySource_DefaultIsNull() { // Arrange - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); // Act DeclarativeWorkflowOptions options = new(mockProvider.Object); @@ -116,7 +116,7 @@ public void TelemetryActivitySource_DefaultIsNull() public void TelemetryActivitySource_CanBeSet() { // Arrange - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); // Act DeclarativeWorkflowOptions options = new(mockProvider.Object) @@ -133,7 +133,7 @@ public async Task BuildWorkflow_WithDefaultTelemetry_AppliesTelemetryAsync() { // Arrange using Activity testActivity = new Activity("DefaultTelemetryTest").Start()!; - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); DeclarativeWorkflowOptions options = new(mockProvider.Object) { ConfigureTelemetry = _ => { }, @@ -161,7 +161,7 @@ public async Task BuildWorkflow_WithTelemetryActivitySource_AppliesTelemetryAsyn { // Arrange using Activity testActivity = new Activity("TelemetryActivitySourceTest").Start()!; - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); DeclarativeWorkflowOptions options = new(mockProvider.Object) { TelemetryActivitySource = this._activitySource, @@ -188,7 +188,7 @@ public async Task BuildWorkflow_WithConfigureTelemetry_AppliesConfigurationAsync { // Arrange using Activity testActivity = new Activity("ConfigureTelemetryTest").Start()!; - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); bool configureInvoked = false; DeclarativeWorkflowOptions options = new(mockProvider.Object) { @@ -223,7 +223,7 @@ public async Task BuildWorkflow_WithoutTelemetry_DoesNotCreateActivitiesAsync() { // Arrange using Activity testActivity = new Activity("NoTelemetryTest").Start()!; - Mock mockProvider = CreateMockProvider(); + Mock mockProvider = CreateMockProvider(); DeclarativeWorkflowOptions options = new(mockProvider.Object) { LoggerFactory = NullLoggerFactory.Instance @@ -245,9 +245,9 @@ public async Task BuildWorkflow_WithoutTelemetry_DoesNotCreateActivitiesAsync() Assert.Empty(capturedActivities); } - private static Mock CreateMockProvider() + private static Mock CreateMockProvider() { - Mock mockAgentProvider = new(MockBehavior.Strict); + Mock mockAgentProvider = new(MockBehavior.Strict); mockAgentProvider .Setup(provider => provider.CreateConversationAsync(It.IsAny())) .Returns(() => Task.FromResult(Guid.NewGuid().ToString("N"))); diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs index 9b3e4bbdaa..392988b07b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/DeclarativeWorkflowTest.cs @@ -239,7 +239,7 @@ public void UnsupportedAction(Type type) AdaptiveDialog dialog = dialogBuilder.Build(); WorkflowFormulaState state = new(RecalcEngineFactory.Create()); - Mock mockAgentProvider = CreateMockProvider("1"); + Mock mockAgentProvider = CreateMockProvider("1"); DeclarativeWorkflowOptions options = new(mockAgentProvider.Object); WorkflowActionVisitor visitor = new(new DeclarativeWorkflowExecutor(WorkflowActionVisitor.Steps.Root("anything"), options, state, (message) => DeclarativeWorkflowBuilder.DefaultTransform(message)), state, options); WorkflowElementWalker walker = new(visitor); @@ -374,14 +374,14 @@ private async Task RunWorkflowAsync(string workflowPath, TInput workflow private Workflow CreateWorkflow(string workflowPath, TInput workflowInput) where TInput : notnull { using StreamReader yamlReader = File.OpenText(Path.Combine("Workflows", workflowPath)); - Mock mockAgentProvider = CreateMockProvider($"{workflowInput}"); + Mock mockAgentProvider = CreateMockProvider($"{workflowInput}"); DeclarativeWorkflowOptions workflowContext = new(mockAgentProvider.Object) { LoggerFactory = this.Output }; return DeclarativeWorkflowBuilder.Build(yamlReader, workflowContext); } - private static Mock CreateMockProvider(string input) + private static Mock CreateMockProvider(string input) { - Mock mockAgentProvider = new(MockBehavior.Strict); + Mock mockAgentProvider = new(MockBehavior.Strict); mockAgentProvider.Setup(provider => provider.CreateConversationAsync(It.IsAny())).Returns(() => Task.FromResult(Guid.NewGuid().ToString("N"))); mockAgentProvider.Setup(provider => provider.CreateMessageAsync(It.IsAny(), It.IsAny(), It.IsAny())).Returns(Task.FromResult(new ChatMessage(ChatRole.Assistant, input))); return mockAgentProvider; diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/DeclarativeWorkflowOptionsExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/DeclarativeWorkflowOptionsExtensionsTests.cs index 85fa389283..ce1b44ef02 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/DeclarativeWorkflowOptionsExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Extensions/DeclarativeWorkflowOptionsExtensionsTests.cs @@ -58,7 +58,7 @@ private static DeclarativeWorkflowOptions CreateOptions( int? maximumExpressionLength = null, int? maximumCallDepth = null) { - Mock providerMock = new(MockBehavior.Strict); + Mock providerMock = new(MockBehavior.Strict); return new(providerMock.Object) { diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/MockAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/MockAgentProvider.cs index 1c496c3936..82987028fb 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/MockAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/MockAgentProvider.cs @@ -11,9 +11,9 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.UnitTests; /// -/// Mock implementation of for unit testing purposes. +/// Mock implementation of for unit testing purposes. /// -internal sealed class MockAgentProvider : Mock +internal sealed class MockAgentProvider : Mock { public IList ExistingConversationIds { get; } = []; From 8a470c429a8289b66a3e66e48a86402a9f4b04cb Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Thu, 12 Feb 2026 12:51:50 -0800 Subject: [PATCH 2/3] Fix rename arcs --- .../Workflows/Declarative/ExecuteCode/Generated.cs | 4 ++-- .../Workflows/Declarative/ExecuteWorkflow/Program.cs | 2 +- .../CodeGen/AddConversationMessageTemplate.cs | 2 +- .../CodeGen/AddConversationMessageTemplate.tt | 2 +- .../CodeGen/CopyConversationMessagesTemplate.cs | 2 +- .../CodeGen/CopyConversationMessagesTemplate.tt | 2 +- .../CodeGen/CreateConversationTemplate.cs | 2 +- .../CodeGen/CreateConversationTemplate.tt | 2 +- .../CodeGen/InvokeAzureAgentTemplate.cs | 2 +- .../CodeGen/InvokeAzureAgentTemplate.tt | 2 +- .../CodeGen/RetrieveConversationMessageTemplate.cs | 2 +- .../CodeGen/RetrieveConversationMessageTemplate.tt | 2 +- .../CodeGen/RetrieveConversationMessagesTemplate.cs | 2 +- .../CodeGen/RetrieveConversationMessagesTemplate.tt | 2 +- .../CodeGen/WorkflowActionTemplateTest.cs | 4 ++-- .../Workflows/AddConversationMessage.cs | 6 +++--- .../Workflows/CopyConversationMessages.cs | 6 +++--- .../Workflows/CreateConversation.cs | 6 +++--- .../Workflows/InvokeAgent.cs | 6 +++--- .../Workflows/RetrieveConversationMessage.cs | 6 +++--- .../Workflows/RetrieveConversationMessages.cs | 6 +++--- 21 files changed, 35 insertions(+), 35 deletions(-) diff --git a/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteCode/Generated.cs b/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteCode/Generated.cs index 49a6ced2b7..59383b9cfa 100644 --- a/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteCode/Generated.cs +++ b/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteCode/Generated.cs @@ -49,7 +49,7 @@ protected override async ValueTask ExecuteAsync(TInput message, IWorkflowContext /// /// Invokes an agent to process messages and return a response within a conversation context. /// - internal sealed class QuestionStudentExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : AgentExecutor(id: "question_student", session, agentProvider) + internal sealed class QuestionStudentExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : AgentExecutor(id: "question_student", session, agentProvider) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) @@ -86,7 +86,7 @@ await InvokeAgentAsync( /// /// Invokes an agent to process messages and return a response within a conversation context. /// - internal sealed class QuestionTeacherExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : AgentExecutor(id: "question_teacher", session, agentProvider) + internal sealed class QuestionTeacherExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : AgentExecutor(id: "question_teacher", session, agentProvider) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) diff --git a/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs b/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs index 36eb9af2d1..fdbf9d1026 100644 --- a/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs @@ -67,7 +67,7 @@ private async Task ExecuteAsync() /// /// Create the workflow from the declarative YAML. Includes definition of the - /// and the associated . + /// and the associated . /// private Workflow CreateWorkflow() { diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/AddConversationMessageTemplate.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/AddConversationMessageTemplate.cs index 34e1cb0020..0064483589 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/AddConversationMessageTemplate.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/AddConversationMessageTemplate.cs @@ -35,7 +35,7 @@ public override string TransformText() this.Write("\n/// \n/// Adds a new message to the specified agent conversation\n/// \ninternal sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(this.Name)); - this.Write("Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExe" + + this.Write("Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExe" + "cutor(id: \""); this.Write(this.ToStringHelper.ToStringWithCulture(this.Id)); this.Write("\", session)\n{\n // \n protected override async ValueTask /// Adds a new message to the specified agent conversation /// -internal sealed class <#= this.Name #>Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) +internal sealed class <#= this.Name #>Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CopyConversationMessagesTemplate.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CopyConversationMessagesTemplate.cs index c29b7ed714..78fadd1982 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CopyConversationMessagesTemplate.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CopyConversationMessagesTemplate.cs @@ -34,7 +34,7 @@ public override string TransformText() this.Write("\n/// \n/// Copies one or more messages into the specified agent conversat" + "ion.\n/// \ninternal sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(this.Name)); - this.Write("Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExe" + + this.Write("Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExe" + "cutor(id: \""); this.Write(this.ToStringHelper.ToStringWithCulture(this.Id)); this.Write("\", session)\n{\n // \n protected override async ValueTask /// Copies one or more messages into the specified agent conversation. /// -internal sealed class <#= this.Name #>Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) +internal sealed class <#= this.Name #>Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.cs index 1a27946e42..58d4217285 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.cs @@ -32,7 +32,7 @@ public override string TransformText() this.Write(this.ToStringHelper.ToStringWithCulture(this.Model.ConversationId)); this.Write("\" variable.\n/// \ninternal sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(this.Name)); - this.Write("Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExe" + + this.Write("Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExe" + "cutor(id: \""); this.Write(this.ToStringHelper.ToStringWithCulture(this.Id)); this.Write(@""", session) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.tt b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.tt index 902bcc2ff4..c2e2ebd786 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.tt +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/CreateConversationTemplate.tt @@ -6,7 +6,7 @@ /// /// Creates a new conversation and stores the identifier value to the "<#= this.Model.ConversationId #>" variable. /// -internal sealed class <#= this.Name #>Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) +internal sealed class <#= this.Name #>Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) { protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) { diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.cs index 3cb2642f79..beb3634df3 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.cs @@ -39,7 +39,7 @@ public override string TransformText() this.Write("\n/// \n/// Invokes an agent to process messages and return a response wit" + "hin a conversation context.\n/// \ninternal sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(this.Name)); - this.Write("Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : AgentExec" + + this.Write("Executor(FormulaSession session, ResponseAgentProvider agentProvider) : AgentExec" + "utor(id: \""); this.Write(this.ToStringHelper.ToStringWithCulture(this.Id)); this.Write("\", session, agentProvider)\n{\n // \n protected override async V" + diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.tt b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.tt index e38068260a..7c86a2de2f 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.tt +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/InvokeAzureAgentTemplate.tt @@ -12,7 +12,7 @@ /// /// Invokes an agent to process messages and return a response within a conversation context. /// -internal sealed class <#= this.Name #>Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : AgentExecutor(id: "<#= this.Id #>", session, agentProvider) +internal sealed class <#= this.Name #>Executor(FormulaSession session, ResponseAgentProvider agentProvider) : AgentExecutor(id: "<#= this.Id #>", session, agentProvider) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessageTemplate.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessageTemplate.cs index 8a3a860914..4015cffa71 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessageTemplate.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessageTemplate.cs @@ -32,7 +32,7 @@ public override string TransformText() this.Write("\n/// \n/// Retrieves a list of messages from an agent conversation.\n/// <" + "/summary>\ninternal sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(this.Name)); - this.Write("Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExe" + + this.Write("Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExe" + "cutor(id: \""); this.Write(this.ToStringHelper.ToStringWithCulture(this.Id)); this.Write("\", session)\n{\n // \n protected override async ValueTask /// Retrieves a list of messages from an agent conversation. /// -internal sealed class <#= this.Name #>Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) +internal sealed class <#= this.Name #>Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessagesTemplate.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessagesTemplate.cs index 1a740ed76c..d9b1ff94dd 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessagesTemplate.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessagesTemplate.cs @@ -38,7 +38,7 @@ public override string TransformText() this.Write("\n/// \n/// Retrieves a specific message from an agent conversation.\n/// <" + "/summary>\ninternal sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(this.Name)); - this.Write("Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExe" + + this.Write("Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExe" + "cutor(id: \""); this.Write(this.ToStringHelper.ToStringWithCulture(this.Id)); this.Write("\", session)\n{\n // \n protected override async ValueTask /// Retrieves a specific message from an agent conversation. /// -internal sealed class <#= this.Name #>Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) +internal sealed class <#= this.Name #>Executor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "<#= this.Id #>", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs index ba74712c32..2f6cedb6dd 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/CodeGen/WorkflowActionTemplateTest.cs @@ -34,11 +34,11 @@ protected static void AssertAgentProvider(bool expected, string workflowCode) { if (expected) { - Assert.Contains(", WorkflowAgentProvider agentProvider", workflowCode); + Assert.Contains($", {nameof(ResponseAgentProvider)} agentProvider", workflowCode); } else { - Assert.DoesNotContain(", WorkflowAgentProvider agentProvider", workflowCode); + Assert.DoesNotContain($", {nameof(ResponseAgentProvider)} agentProvider", workflowCode); } } diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/AddConversationMessage.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/AddConversationMessage.cs index 5692130893..3d4220cf38 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/AddConversationMessage.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/AddConversationMessage.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -52,7 +52,7 @@ protected override async ValueTask ExecuteAsync(TInput message, IWorkflowContext /// /// Adds a new message to the specified agent conversation /// - internal sealed class AddMessageExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "add_message", session) + internal sealed class AddMessageExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "add_message", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) @@ -116,4 +116,4 @@ public static Workflow CreateWorkflow( // Build the workflow return builder.Build(validateOrphans: false); } -} +} \ No newline at end of file diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CopyConversationMessages.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CopyConversationMessages.cs index c5a1fc88fd..79ce7d1632 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CopyConversationMessages.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CopyConversationMessages.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -49,7 +49,7 @@ protected override async ValueTask ExecuteAsync(TInput message, IWorkflowContext /// /// Copies one or more messages into the specified agent conversation. /// - internal sealed class CopyMessagesExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "copy_messages", session) + internal sealed class CopyMessagesExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "copy_messages", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) @@ -92,4 +92,4 @@ public static Workflow CreateWorkflow( // Build the workflow return builder.Build(validateOrphans: false); } -} +} \ No newline at end of file diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CreateConversation.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CreateConversation.cs index 21e86a5765..8672a259f4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CreateConversation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/CreateConversation.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -51,7 +51,7 @@ protected override async ValueTask ExecuteAsync(TInput message, IWorkflowContext /// /// Creates a new conversation and stores the identifier value to the "Local.PrivateConversationId" variable. /// - internal sealed class ConversationCreateExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "conversation_create", session) + internal sealed class ConversationCreateExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "conversation_create", session) { protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) { @@ -85,4 +85,4 @@ public static Workflow CreateWorkflow( // Build the workflow return builder.Build(validateOrphans: false); } -} +} \ No newline at end of file diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/InvokeAgent.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/InvokeAgent.cs index 08002d16fb..297029af1c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/InvokeAgent.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/InvokeAgent.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -54,7 +54,7 @@ await this.InitializeEnvironmentAsync( /// /// Invokes an agent to process messages and return a response within a conversation context. /// - internal sealed class InvokeAgentExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : AgentExecutor(id: "invoke_agent", session, agentProvider) + internal sealed class InvokeAgentExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : AgentExecutor(id: "invoke_agent", session, agentProvider) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) @@ -109,4 +109,4 @@ public static Workflow CreateWorkflow( // Build the workflow return builder.Build(validateOrphans: false); } -} +} \ No newline at end of file diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessage.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessage.cs index b45acec1f8..74a7acba52 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessage.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessage.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -53,7 +53,7 @@ protected override async ValueTask ExecuteAsync(TInput message, IWorkflowContext /// /// Retrieves a list of messages from an agent conversation. /// - internal sealed class GetMessageSingleExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "get_message_single", session) + internal sealed class GetMessageSingleExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "get_message_single", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) @@ -88,4 +88,4 @@ public static Workflow CreateWorkflow( // Build the workflow return builder.Build(validateOrphans: false); } -} +} \ No newline at end of file diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessages.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessages.cs index 781012910c..64d11fc50b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessages.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Workflows/RetrieveConversationMessages.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -51,7 +51,7 @@ protected override async ValueTask ExecuteAsync(TInput message, IWorkflowContext /// /// Retrieves a specific message from an agent conversation. /// - internal sealed class GetMessagesAllExecutor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExecutor(id: "get_messages_all", session) + internal sealed class GetMessagesAllExecutor(FormulaSession session, ResponseAgentProvider agentProvider) : ActionExecutor(id: "get_messages_all", session) { // protected override async ValueTask ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken) @@ -101,4 +101,4 @@ public static Workflow CreateWorkflow( // Build the workflow return builder.Build(validateOrphans: false); } -} +} \ No newline at end of file From 0a4c8abd0342eaf848e495cf1f1df16cef54fcf2 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Thu, 12 Feb 2026 12:55:06 -0800 Subject: [PATCH 3/3] Integration tests --- dotnet/src/Shared/Workflows/Execution/WorkflowFactory.cs | 2 +- .../Framework/WorkflowTest.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dotnet/src/Shared/Workflows/Execution/WorkflowFactory.cs b/dotnet/src/Shared/Workflows/Execution/WorkflowFactory.cs index 08a39afe5e..1f1570312a 100644 --- a/dotnet/src/Shared/Workflows/Execution/WorkflowFactory.cs +++ b/dotnet/src/Shared/Workflows/Execution/WorkflowFactory.cs @@ -24,7 +24,7 @@ internal sealed class WorkflowFactory(string workflowFile, Uri foundryEndpoint) /// /// Create the workflow from the declarative YAML. Includes definition of the - /// and the associated . + /// and the associated . /// public Workflow CreateWorkflow() { diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs index 20cc823553..151e9fc70c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs @@ -134,7 +134,7 @@ public static void Responses(IReadOnlyList responseEvents, T } } - public static async ValueTask MessagesAsync(string? conversationId, Testcase testcase, WorkflowAgentProvider agentProvider) + public static async ValueTask MessagesAsync(string? conversationId, Testcase testcase, ResponseAgentProvider agentProvider) { int minExpectedCount = testcase.Validation.MinMessageCount ?? testcase.Validation.MinResponseCount; int maxExpectedCount = testcase.Validation.MaxMessageCount ?? testcase.Validation.MaxResponseCount ?? minExpectedCount;