mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 20:47:22 +00:00
Added file patterns and exclusions to folder data sources (#1057)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
249fc778a2
commit
031874cebf
75 files changed
+4808
-589
No files matched your search
@@ -96,8 +96,8 @@ public record FileAttachment(FileAttachmentType Type, string FileName, [property
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines the file attachment type based on the file extension.
|
||||
/// Uses centrally defined file type filters from <see cref="FileTypes"/>.
|
||||
/// Determines the file attachment type based on the file extension or, for readable text, on
|
||||
/// the content. Uses the centrally defined file type filters from FileTypes.
|
||||
/// </summary>
|
||||
/// <param name="filePath">The file path to analyze.</param>
|
||||
/// <returns>The corresponding FileAttachmentType.</returns>
|
||||
@@ -115,7 +115,11 @@ public record FileAttachment(FileAttachmentType Type, string FileName, [property
|
||||
if (FileTypes.IsAllowedPath(filePath, FileTypes.AUDIO))
|
||||
return FileAttachmentType.AUDIO;
|
||||
|
||||
// Check if it's an allowed document file (PDF, Text, LaTeX, or Office):
|
||||
//
|
||||
// Check if it's an allowed document file (PDF, Text, LaTeX, or Office). Text includes
|
||||
// READABLE_TEXT, so any readable text file is accepted, whatever its name, e.g., main.tf.
|
||||
// For a file of an unknown type, this reads up to the first 8 KB:
|
||||
//
|
||||
if (FileTypes.IsAllowedPath(filePath, FileTypes.DOCUMENT))
|
||||
return FileAttachmentType.DOCUMENT;
|
||||
|
||||
|
||||
Reference in new issue
Block a user