// Copyright (c) Microsoft. All rights reserved.
using System.Diagnostics;
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Extensions.AI;
///
/// Represents a file that is hosted by the AI service.
///
///
/// Unlike which contains the data for a file or blob, this class represents a file that is hosted
/// by the AI service and referenced by an identifier. Such identifiers are specific to the provider.
///
[DebuggerDisplay("FileId = {FileId}")]
public sealed class HostedFileContent : AIContent
{
private string _fileId;
///
/// Initializes a new instance of the class.
///
/// The ID of the hosted file.
/// is .
/// is empty or composed entirely of whitespace.
public HostedFileContent(string fileId)
{
_fileId = Throw.IfNullOrWhitespace(fileId);
}
///
/// Gets or sets the ID of the hosted file.
///
/// is .
/// is empty or composed entirely of whitespace.
public string FileId
{
get => _fileId;
set => _fileId = Throw.IfNullOrWhitespace(value);
}
}