mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* Rename WorkflowOutputEvent.SourceId to ExecutorId for Python consistency - Rename SourceId property to ExecutorId in WorkflowOutputEvent - Add [Obsolete] SourceId property for backward compatibility - Update all test usages to use ExecutorId Resolves part of #2938 * Unify AgentResponse events with WorkflowOutputEvent (#2938) - Change AgentResponseEvent and AgentResponseUpdateEvent to inherit from WorkflowOutputEvent instead of ExecutorEvent - Update AIAgentHostExecutor and HandoffAgentExecutor to use YieldOutputAsync() instead of AddEventAsync() for agent outputs - Add special-casing in InProcessRunnerContext.YieldOutputAsync() to create specific event types for AgentResponse and AgentResponseUpdate, bypassing OutputFilter for backwards compatibility - Update TestRunContext and TestWorkflowContext with same special-casing - Add regression tests in AgentEventsTests * refactor: Seal AgentResponse events
27 lines
848 B
C#
27 lines
848 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using Microsoft.Shared.Diagnostics;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows;
|
|
|
|
/// <summary>
|
|
/// Represents an event triggered when an agent produces a response.
|
|
/// </summary>
|
|
public sealed class AgentResponseEvent : WorkflowOutputEvent
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="AgentResponseEvent"/> class.
|
|
/// </summary>
|
|
/// <param name="executorId">The identifier of the executor that generated this event.</param>
|
|
/// <param name="response">The agent response.</param>
|
|
public AgentResponseEvent(string executorId, AgentResponse response) : base(response, executorId)
|
|
{
|
|
this.Response = Throw.IfNull(response);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the agent response.
|
|
/// </summary>
|
|
public AgentResponse Response { get; }
|
|
}
|