// Copyright (c) Microsoft Corporation. All rights reserved. // MessageContext.cs namespace Microsoft.AutoGen.Contracts.Python; /// /// Represents the context of a message being sent within the agent runtime. /// This includes metadata such as the sender, topic, RPC status, and cancellation handling. /// public class MessageContext(string messageId, CancellationToken cancellationToken) { /// /// Gets or sets the unique identifier for this message. /// public string MessageId { get; set; } = messageId; /// /// Gets or sets the cancellation token associated with this message. /// This can be used to cancel the operation if necessary. /// public CancellationToken CancellationToken { get; set; } = cancellationToken; /// /// Gets or sets the sender of the message. /// If null, the sender is unspecified. /// public AgentId? Sender { get; set; } /// /// Gets or sets the topic associated with the message. /// If null, the message is not tied to a specific topic. /// public TopicId? Topic { get; set; } /// /// Gets or sets a value indicating whether this message is part of an RPC (Remote Procedure Call). /// public bool IsRpc { get; set; } }