mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
eb1117fff4
* adds support for labels in edges, fixes rendering of labels in dot and mermaid, adds rendering of labels in edges * Update dotnet/src/Microsoft.Agents.AI.Workflows/Visualization/WorkflowVisualizer.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * escaping edge labels, adding tests for labels containing strange characters that would break the diagram and enabling the previous signature so the API has backwards compatibility. * Unify label in EdgeData * Edge API adjustments, removed useless "sanitizer" * fixed test --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jacob Alber <jaalber@microsoft.com> Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
30 lines
791 B
C#
30 lines
791 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using Microsoft.Agents.AI.Workflows.Execution;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows;
|
|
|
|
/// <summary>
|
|
/// A base class for edge data, providing access to the <see cref="EdgeConnection"/> representation of the edge.
|
|
/// </summary>
|
|
public abstract class EdgeData
|
|
{
|
|
/// <summary>
|
|
/// Gets the connection representation of the edge.
|
|
/// </summary>
|
|
internal abstract EdgeConnection Connection { get; }
|
|
|
|
internal EdgeData(EdgeId id, string? label = null)
|
|
{
|
|
this.Id = id;
|
|
this.Label = label;
|
|
}
|
|
|
|
internal EdgeId Id { get; }
|
|
|
|
/// <summary>
|
|
/// An optional label for the edge, allowing for arbitrary metadata to be associated with it.
|
|
/// </summary>
|
|
public string? Label { get; }
|
|
}
|