// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json.Serialization;
using Microsoft.Extensions.AI;
namespace Microsoft.Agents.AI.DurableTask.State;
///
/// Represents URI content for a durable agent state message.
///
internal sealed class DurableAgentStateUriContent : DurableAgentStateContent
{
///
/// Gets the URI of the content.
///
[JsonPropertyName("uri")]
public required Uri Uri { get; init; }
///
/// Gets the media type of the content.
///
[JsonPropertyName("mediaType")]
public required string MediaType { get; init; }
///
/// Creates a from a .
///
/// The to convert.
/// A representing the original content.
public static DurableAgentStateUriContent FromUriContent(UriContent uriContent)
{
return new DurableAgentStateUriContent()
{
MediaType = uriContent.MediaType,
Uri = uriContent.Uri
};
}
///
public override AIContent ToAIContent()
{
return new UriContent(this.Uri, this.MediaType);
}
}