Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorEvent.cs
T
Jacob AlberandGitHub ce70ca1a9f .NET: feat: Implement Magentic Orchestration for .NET (#5595)
* feat: Implement Magentic Orchestration for .NET

* fixup: Update for review comments

* fix: Fix FenceJsonRegexPattern

* fix: Format

* fix: Updates for PR feedback

* fix: Add missing serialized types to source gen for trimming

* fix: Address PR Comments
2026-05-07 18:36:15 +00:00

28 lines
985 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json.Serialization;
using Microsoft.Agents.AI.Workflows.Specialized.Magentic;
namespace Microsoft.Agents.AI.Workflows;
/// <summary>
/// Base class for <see cref="Executor"/>-scoped events.
/// </summary>
[JsonDerivedType(typeof(ExecutorInvokedEvent))]
[JsonDerivedType(typeof(ExecutorCompletedEvent))]
[JsonDerivedType(typeof(ExecutorFailedEvent))]
[JsonDerivedType(typeof(MagenticOrchestratorEvent))]
public class ExecutorEvent(string executorId, object? data) : WorkflowEvent(data)
{
/// <summary>
/// The identifier of the executor that generated this event.
/// </summary>
public string ExecutorId => executorId;
/// <inheritdoc/>
public override string ToString() =>
this.Data is not null ?
$"{this.GetType().Name}(Executor = {this.ExecutorId}, Data: {this.Data.GetType()} = {this.Data})" :
$"{this.GetType().Name}(Executor = {this.ExecutorId})";
}