Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/Checkpointing/PortableMessageEnvelope.cs
T
Ben ThomasandGitHub 647db9635a .NET: Rename workflows projects (#975)
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows

* Removing local settings.

* Removing remining old files from merge.
2025-09-29 18:30:45 +00:00

36 lines
1.1 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json.Serialization;
using Microsoft.Agents.AI.Workflows.Execution;
namespace Microsoft.Agents.AI.Workflows.Checkpointing;
internal sealed class PortableMessageEnvelope
{
public TypeId MessageType { get; }
public PortableValue Message { get; }
public ExecutorIdentity Source { get; }
public string? TargetId { get; }
[JsonConstructor]
internal PortableMessageEnvelope(TypeId messageType, ExecutorIdentity source, PortableValue message, string? targetId)
{
this.MessageType = messageType;
this.Message = message;
this.Source = source;
this.TargetId = targetId;
}
public PortableMessageEnvelope(MessageEnvelope envelope)
{
this.MessageType = envelope.MessageType;
this.Message = new PortableValue(envelope.Message);
this.TargetId = envelope.TargetId;
}
public MessageEnvelope ToMessageEnvelope()
{
return new MessageEnvelope(this.Message, this.Source, this.MessageType, this.TargetId);
}
}