mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
refactor: remove ignore YieldsMessageAttribute
- the correct one to use is YieldsOutputAttribute - fixes a comment that mistakenly refers to `.YieldsMessage()` which does not exist.
This commit is contained in:
@@ -254,7 +254,7 @@ internal static class SemanticAnalyzer
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using Microsoft.Shared.Diagnostics;
|
||||
|
||||
namespace Microsoft.Agents.AI.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Declares that an executor may yield messages of the specified type as workflow outputs.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Apply this attribute to an <see cref="Executor"/> class to declare the types of messages
|
||||
/// it may yield via <see cref="IWorkflowContext.YieldOutputAsync"/>. This information is used
|
||||
/// for protocol validation and documentation.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// 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.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// [YieldsMessage(typeof(FinalResult))]
|
||||
/// [YieldsMessage(typeof(StreamChunk))]
|
||||
/// public partial class MyExecutor : Executor
|
||||
/// {
|
||||
/// // ...
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public sealed class YieldsMessageAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the type of message that the executor may yield.
|
||||
/// </summary>
|
||||
public Type Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="YieldsMessageAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="type">The type of message that the executor may yield.</param>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="type"/> is <see langword="null"/>.</exception>
|
||||
public YieldsMessageAttribute(Type type)
|
||||
{
|
||||
this.Type = Throw.IfNull(type);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user