mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
c73bd87503
* [BREAKING] refactor: Decouple Checkpointing and Execution APIs With this change, Checkpointing becomes an property of an IWorkflowExecutionEnvironment. This lets environments that are tightly-coupled to their CheckpointManager avoid needing to present APIs that would not work (e.g. taking in an InMemory CheckpointManager for Durable Tasks, for example) * refactor: Normalize IsCheckpointingEnabled naming
29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Checkpointing;
|
|
|
|
internal interface ICheckpointingHandle
|
|
{
|
|
/// <summary>
|
|
/// Gets a value indicating whether checkpointing is enabled for the current operation or process.
|
|
/// </summary>
|
|
bool IsCheckpointingEnabled { get; }
|
|
|
|
/// <summary>
|
|
/// Gets a read-only list of checkpoint information associated with the current context.
|
|
/// </summary>
|
|
IReadOnlyList<CheckpointInfo> Checkpoints { get; }
|
|
|
|
/// <summary>
|
|
/// Restores the system state from the specified checkpoint asynchronously.
|
|
/// </summary>
|
|
/// <param name="checkpointInfo">The checkpoint information that identifies the state to restore. Cannot be null.</param>
|
|
/// <param name="cancellationToken">A cancellation token that can be used to cancel the restore operation.</param>
|
|
/// <returns>A <see cref="ValueTask"/> that represents the asynchronous restore operation.</returns>
|
|
ValueTask RestoreCheckpointAsync(CheckpointInfo checkpointInfo, CancellationToken cancellationToken = default);
|
|
}
|