From 33f3b02d4170a58a37a11bb21c71211135d598c4 Mon Sep 17 00:00:00 2001 From: Jacob Alber Date: Mon, 20 Apr 2026 12:25:15 -0400 Subject: [PATCH] refactor: remove ignore YieldsMessageAttribute - the correct one to use is YieldsOutputAttribute - fixes a comment that mistakenly refers to `.YieldsMessage()` which does not exist. --- .../Analysis/SemanticAnalyzer.cs | 2 +- .../Attributes/YieldsMessageAttribute.cs | 49 ------------------- 2 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 dotnet/src/Microsoft.Agents.AI.Workflows/Attributes/YieldsMessageAttribute.cs diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows.Generators/Analysis/SemanticAnalyzer.cs b/dotnet/src/Microsoft.Agents.AI.Workflows.Generators/Analysis/SemanticAnalyzer.cs index 66b67bffdf..7fcbdb18ca 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows.Generators/Analysis/SemanticAnalyzer.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows.Generators/Analysis/SemanticAnalyzer.cs @@ -254,7 +254,7 @@ internal static class SemanticAnalyzer /// /// Combines ClassProtocolInfo results into an AnalysisResult for classes that only have IO attributes - /// (no [MessageHandler] methods). This generates only .SendsMessage/.YieldsMessage calls in the protocol + /// (no [MessageHandler] methods). This generates only .SendsMessage/.YieldsOutput calls in the protocol /// configuration. /// /// diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/Attributes/YieldsMessageAttribute.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/Attributes/YieldsMessageAttribute.cs deleted file mode 100644 index 82ca9106b7..0000000000 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/Attributes/YieldsMessageAttribute.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -using System; -using Microsoft.Shared.Diagnostics; - -namespace Microsoft.Agents.AI.Workflows; - -/// -/// Declares that an executor may yield messages of the specified type as workflow outputs. -/// -/// -/// -/// Apply this attribute to an class to declare the types of messages -/// it may yield via . This information is used -/// for protocol validation and documentation. -/// -/// -/// This attribute can be applied multiple times to declare multiple output types. -/// It is inherited by derived classes, allowing base executors to declare common output types. -/// -/// -/// -/// -/// [YieldsMessage(typeof(FinalResult))] -/// [YieldsMessage(typeof(StreamChunk))] -/// public partial class MyExecutor : Executor -/// { -/// // ... -/// } -/// -/// -[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] -public sealed class YieldsMessageAttribute : Attribute -{ - /// - /// Gets the type of message that the executor may yield. - /// - public Type Type { get; } - - /// - /// Initializes a new instance of the class. - /// - /// The type of message that the executor may yield. - /// is . - public YieldsMessageAttribute(Type type) - { - this.Type = Throw.IfNull(type); - } -}