// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Agents.AI.Workflows;
///
/// Represents an event triggered when an agent run produces an update.
///
public class AgentResponseUpdateEvent : ExecutorEvent
{
///
/// Initializes a new instance of the class.
///
/// The identifier of the executor that generated this event.
/// The agent run response update.
public AgentResponseUpdateEvent(string executorId, AgentResponseUpdate update) : base(executorId, data: update)
{
this.Update = Throw.IfNull(update);
}
///
/// Gets the agent run response update.
///
public AgentResponseUpdate Update { get; }
///
/// Converts this event to an containing just this update.
///
///
public AgentResponse AsResponse()
{
IEnumerable updates = [this.Update];
return updates.ToAgentResponse();
}
}