mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
41d441420e
* Initial draft of actor runtime abstractions
24 lines
879 B
C#
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);
|
|
}
|