// Copyright (c) Microsoft. All rights reserved. using System.Text.Json.Serialization; namespace Microsoft.Extensions.AI.Agents.Runtime; /// /// Base class for all actor write operations that can modify actor state or messaging. /// /// /// 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. /// [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 { /// Prevent external derivations. private protected ActorWriteOperation() { } /// /// Gets the type of the write operation. /// [JsonIgnore] public abstract ActorWriteOperationType Type { get; } }