Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/DirectEdgeData.cs
T
Ben ThomasandGitHub 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

41 lines
1.3 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using Microsoft.Agents.AI.Workflows.Execution;
using PredicateT = System.Func<object?, bool>;
namespace Microsoft.Agents.AI.Workflows;
/// <summary>
/// Represents a directed edge between two nodes, optionally associated with a condition that determines whether the
/// edge is active.
/// </summary>
public sealed class DirectEdgeData : EdgeData
{
internal DirectEdgeData(string sourceId, string sinkId, EdgeId id, PredicateT? condition = null) : base(id)
{
this.SourceId = sourceId;
this.SinkId = sinkId;
this.Condition = condition;
this.Connection = new([sourceId], [sinkId]);
}
/// <summary>
/// The Id of the source <see cref="Executor"/> node.
/// </summary>
public string SourceId { get; }
/// <summary>
/// The Id of the destination <see cref="Executor"/> node.
/// </summary>
public string SinkId { get; }
/// <summary>
/// An optional predicate determining whether the edge is active for a given message. If <see langword="null"/>,
/// the edge is always active when a message is generated by the source.
/// </summary>
public PredicateT? Condition { get; }
/// <inheritdoc />
internal override EdgeConnection Connection { get; }
}