.NET Workflows - Enhance support and validation for image input (#1274)

* Updated

* Comments

* Namespace

* Comment

* Cleanup

* Update agent definition

* Disable

* Config

* Enable
This commit is contained in:
Chris
2025-10-08 00:00:34 +00:00
committed by GitHub
parent 362652b966
commit eb049c43a6
17 changed files with 339 additions and 189 deletions
@@ -12,7 +12,6 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests;
/// <summary>
/// Tests execution of workflow created by <see cref="DeclarativeWorkflowBuilder"/>.
/// </summary>
[Collection("Global")]
public sealed class DeclarativeCodeGenTest(ITestOutputHelper output) : WorkflowTest(output)
{
[Theory]
@@ -33,7 +32,7 @@ public sealed class DeclarativeCodeGenTest(ITestOutputHelper output) : WorkflowT
public Task ValidateScenarioAsync(string workflowFileName, string testcaseFileName, bool externalConveration = false) =>
this.RunWorkflowAsync(Path.Combine(GetRepoFolder(), "workflow-samples", workflowFileName), testcaseFileName, externalConveration);
protected override async Task RunAndVerifyAsync<TInput>(Testcase testcase, string workflowPath, DeclarativeWorkflowOptions workflowOptions)
protected override async Task RunAndVerifyAsync<TInput>(Testcase testcase, string workflowPath, DeclarativeWorkflowOptions workflowOptions, TInput input)
{
const string WorkflowNamespace = "Test.WorkflowProviders";
const string WorkflowPrefix = "Test";
@@ -47,15 +46,19 @@ public sealed class DeclarativeCodeGenTest(ITestOutputHelper output) : WorkflowT
workflowProviderName: $"{WorkflowPrefix}WorkflowProvider",
WorkflowNamespace,
workflowOptions,
(TInput)GetInput<TInput>(testcase));
input);
WorkflowEvents workflowEvents = await harness.RunTestcaseAsync(testcase, (TInput)GetInput<TInput>(testcase)).ConfigureAwait(false);
WorkflowEvents workflowEvents = await harness.RunTestcaseAsync(testcase, input).ConfigureAwait(false);
// Verify no action events are present
Assert.Empty(workflowEvents.ActionInvokeEvents);
Assert.Empty(workflowEvents.ActionCompleteEvents);
// Verify the associated conversations
AssertWorkflow.Conversation(workflowOptions.ConversationId, workflowEvents.ConversationEvents, testcase);
// Verify executor events
AssertWorkflow.EventCounts(workflowEvents.ExecutorInvokeEvents.Count - 2, testcase);
AssertWorkflow.EventCounts(workflowEvents.ExecutorCompleteEvents.Count - 2, testcase);
// Verify action sequences
AssertWorkflow.EventSequence(workflowEvents.ExecutorInvokeEvents.Select(e => e.ExecutorId), testcase);
}
finally