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

33 lines
1.1 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json.Serialization;
namespace Microsoft.Extensions.AI.Agents.Runtime;
/// <summary>
/// Base class for all actor write operations that can modify actor state or messaging.
/// </summary>
/// <remarks>
/// This abstract class serves as the foundation for all actor write operation types.
/// Each concrete implementation represents a specific type of write operation,
/// such as modifying actor state or sending messages.
/// </remarks>
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(SetValueOperation), "set_value")]
[JsonDerivedType(typeof(RemoveKeyOperation), "remove_key")]
[JsonDerivedType(typeof(UpdateRequestOperation), "update_request")]
[JsonDerivedType(typeof(SendRequestOperation), "send_request")]
public abstract class ActorWriteOperation
{
/// <summary>Prevent external derivations.</summary>
private protected ActorWriteOperation()
{
}
/// <summary>
/// Gets the type of the write operation.
/// </summary>
[JsonIgnore]
public abstract ActorWriteOperationType Type { get; }
}