// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.AI;
namespace Microsoft.Agents.AI.Workflows;
///
/// Request for human review of a proposed plan.
///
/// The proposed plan.
/// The current progress ledger, if available. During the initial plan review,
/// this will be . In subsequent reviews after replanning (due to stalls), this will
/// contain the latest progress ledger that determined that no progress has been made or the workflow was in
/// a loop.
/// Whether the workflow is currently stalled.
public record MagenticPlanReviewRequest(ChatMessage Plan, MagenticProgressLedger? CurrentProgress, bool IsStalled)
{
///
/// Create an approving .
///
///
public MagenticPlanReviewResponse Approve() => new([]);
///
/// Create a with revisions.
///
///
public MagenticPlanReviewResponse Revise(string message) => new([new(ChatRole.User, message)]);
///
/// Create a with revisions.
///
///
public MagenticPlanReviewResponse Revise(ChatMessage message) => new([message]);
///
/// Create a with revisions.
///
///
public MagenticPlanReviewResponse Revise(IEnumerable messages)
=> new(messages is List messageList ? messageList : messages.ToList());
}