Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorEvent.cs
T
Ben Thomas 647db9635a .NET: Rename workflows projects (#975)
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows

* Removing local settings.

* Removing remining old files from merge.
2025-09-29 18:30:45 +00:00

26 lines
874 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json.Serialization;
namespace Microsoft.Agents.AI.Workflows;
/// <summary>
/// Base class for <see cref="Executor"/>-scoped events.
/// </summary>
[JsonDerivedType(typeof(ExecutorInvokedEvent))]
[JsonDerivedType(typeof(ExecutorCompletedEvent))]
[JsonDerivedType(typeof(ExecutorFailedEvent))]
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})";
}