mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 05:27:21 +00:00
Moved all extension methods into extension blocks (#1155)
This commit is contained in:
1 parent
acc7d09fa2
commit
c0a75f39ac
138 files changed
+5884
-4954
No files matched your search
@@ -2,17 +2,20 @@ namespace AIStudio.Chat;
|
||||
|
||||
public static class ListFileAttachmentExtensions
|
||||
{
|
||||
public static bool ContainsImages(this List<FileAttachment> attachments) => attachments.Any(attachment => attachment.IsImage);
|
||||
|
||||
/// <summary>
|
||||
/// Whether preparing the message for the AI may read a document through the runtime.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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.
|
||||
/// </remarks>
|
||||
/// <param name="attachments">The attachments of the message.</param>
|
||||
/// <returns>True when a document may be read.</returns>
|
||||
public static bool MayContainDocuments(this List<FileAttachment> attachments) => attachments.Any(attachment => !attachment.IsImage);
|
||||
extension(List<FileAttachment> attachments)
|
||||
{
|
||||
public bool ContainsImages() => attachments.Any(attachment => attachment.IsImage);
|
||||
|
||||
/// <summary>
|
||||
/// Whether preparing the message for the AI may read a document through the runtime.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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.
|
||||
/// </remarks>
|
||||
/// <returns>True when a document may be read.</returns>
|
||||
public bool MayContainDocuments() => attachments.Any(attachment => !attachment.IsImage);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user