mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
647db9635a
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows * Removing local settings. * Removing remining old files from merge.
30 lines
901 B
C#
30 lines
901 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows;
|
|
|
|
/// <summary>
|
|
/// Base class for <see cref="Workflow"/>-scoped events.
|
|
/// </summary>
|
|
[JsonDerivedType(typeof(ExecutorEvent))]
|
|
[JsonDerivedType(typeof(SuperStepEvent))]
|
|
[JsonDerivedType(typeof(WorkflowStartedEvent))]
|
|
[JsonDerivedType(typeof(WorkflowErrorEvent))]
|
|
[JsonDerivedType(typeof(WorkflowWarningEvent))]
|
|
[JsonDerivedType(typeof(WorkflowOutputEvent))]
|
|
[JsonDerivedType(typeof(RequestInfoEvent))]
|
|
public class WorkflowEvent(object? data = null)
|
|
{
|
|
/// <summary>
|
|
/// Optional payload
|
|
/// </summary>
|
|
public object? Data => data;
|
|
|
|
/// <inheritdoc/>
|
|
public override string ToString() =>
|
|
this.Data is not null ?
|
|
$"{this.GetType().Name}(Data: {this.Data.GetType()} = {this.Data})" :
|
|
$"{this.GetType().Name}()";
|
|
}
|