mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
27324a8013
* fix: Mark Magentic Orchestration Experimental * Apply [Experimental] to all public Magentic types and suppress MAAIW001 in project Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/957a07c1-a805-40eb-989d-bd3425d4c0af Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com>
47 lines
1.9 KiB
C#
47 lines
1.9 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Linq;
|
|
using Microsoft.Extensions.AI;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows;
|
|
|
|
/// <summary>
|
|
/// Request for human review of a proposed plan.
|
|
/// </summary>
|
|
/// <param name="Plan">The proposed plan.</param>
|
|
/// <param name="CurrentProgress">The current progress ledger, if available. During the initial plan review,
|
|
/// this will be <see langword="null"/>. 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.</param>
|
|
/// <param name="IsStalled">Whether the workflow is currently stalled.</param>
|
|
[Experimental(DiagnosticConstants.ExperimentalFeatureDiagnostic)]
|
|
public record MagenticPlanReviewRequest(ChatMessage Plan, MagenticProgressLedger? CurrentProgress, bool IsStalled)
|
|
{
|
|
/// <summary>
|
|
/// Create an approving <see cref="MagenticPlanReviewResponse"/>.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MagenticPlanReviewResponse Approve() => new([]);
|
|
|
|
/// <summary>
|
|
/// Create a <see cref="MagenticPlanReviewResponse"/> with revisions.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MagenticPlanReviewResponse Revise(string message) => new([new(ChatRole.User, message)]);
|
|
|
|
/// <summary>
|
|
/// Create a <see cref="MagenticPlanReviewResponse"/> with revisions.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MagenticPlanReviewResponse Revise(ChatMessage message) => new([message]);
|
|
|
|
/// <summary>
|
|
/// Create a <see cref="MagenticPlanReviewResponse"/> with revisions.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public MagenticPlanReviewResponse Revise(IEnumerable<ChatMessage> messages)
|
|
=> new(messages is List<ChatMessage> messageList ? messageList : messages.ToList());
|
|
}
|