namespace AIStudio.Chat;
public static class ListFileAttachmentExtensions
{
/// The attachments of the message.
extension(List attachments)
{
public bool ContainsImages() => attachments.Any(attachment => attachment.IsImage);
///
/// Whether preparing the message for the AI may read a document through the runtime.
///
///
/// Every attachment but a picture counts: its type is checked again with the latest rules
/// before it is read, cf. FileAttachment.Normalize, and may turn out to be a document then.
/// Checking that here would touch every file twice, which takes long on a network drive.
///
/// True when a document may be read.
public bool MayContainDocuments() => attachments.Any(attachment => !attachment.IsImage);
}
}