mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 02:47:21 +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
@@ -28,6 +28,42 @@ public sealed class EmbeddingSignatureTests
|
||||
Assert.That(Signature(high), Is.EqualTo(Signature(low)), "The confidence level changes no vector, so the stored index stays valid and nothing is embedded again.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChangingDirectoryFilePatternsKeepsTheStoredEmbeddingsOfRetainedFiles()
|
||||
{
|
||||
var allFiles = DataSource(ConfidenceLevel.LOW);
|
||||
var textFiles = allFiles with { FilePatterns = "*.txt" };
|
||||
|
||||
Assert.That(
|
||||
Signature(textFiles),
|
||||
Is.EqualTo(Signature(allFiles)),
|
||||
"Patterns change which files belong to the source, not how retained files are embedded; the indexing run removes and adds only the affected files.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChangingDirectoryRecursionKeepsTheStoredEmbeddingsOfRetainedFiles()
|
||||
{
|
||||
var recursive = DataSource(ConfidenceLevel.LOW);
|
||||
var topDirectoryOnly = recursive with { IncludeSubdirectories = false };
|
||||
|
||||
Assert.That(
|
||||
Signature(topDirectoryOnly),
|
||||
Is.EqualTo(Signature(recursive)),
|
||||
"The subfolder choice changes which files belong to the source, not how retained files are embedded; the indexing run removes and adds only the affected files.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChangingHiddenDirectoryInclusionKeepsTheStoredEmbeddingsOfRetainedFiles()
|
||||
{
|
||||
var visibleDirectoriesOnly = DataSource(ConfidenceLevel.LOW);
|
||||
var includingHiddenDirectories = visibleDirectoriesOnly with { IncludeHiddenFilesAndFolders = true };
|
||||
|
||||
Assert.That(
|
||||
Signature(includingHiddenDirectories),
|
||||
Is.EqualTo(Signature(visibleDirectoriesOnly)),
|
||||
"The hidden-folder choice changes which files belong to the source, not how retained files are embedded; the indexing run removes and adds only the affected files.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChangingTheChunkSizeDropsTheStoredEmbeddings()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user