Files
agent-framework/dotnet/src/Microsoft.Extensions.AI.Agents.Runtime.Abstractions/IActor.cs
T
Reuben Bond 41d441420e Initial draft of actor runtime abstractions (#197)
* Initial draft of actor runtime abstractions
2025-07-22 16:05:58 -04:00

24 lines
879 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Extensions.AI.Agents.Runtime;
// Implemented by the Agent Framework (eg, Agent, Orchestration, Process, etc)
/// <summary>
/// Represents an actor in the actor system that can process messages and maintain state.
/// </summary>
public interface IActor : IAsyncDisposable
{
/// <summary>
/// Runs the actor.
/// When the value returned from this method completes, the actor is considered stopped.
/// IActor is expected to call IActorContext.WatchMessagesAsync() to receive messages.
/// </summary>
/// <param name="cancellationToken">A token to cancel the start operation.</param>
/// <returns>A task representing the start operation.</returns>
ValueTask RunAsync(CancellationToken cancellationToken);
}