mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 01:27:21 +00:00
Allowed moving local data sources without embedding them again (#1091)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
f6e48e95f3
commit
5d6e48ef93
49 files changed
+2280
-297
No files matched your search
@@ -112,7 +112,7 @@ public sealed class OutdatedRunTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ASingleFileHasNoSelection()
|
||||
public void RelocatingASingleFileStopsTheOldRunWithoutInvalidatingItsEmbeddings()
|
||||
{
|
||||
var dataSource = new DataSourceLocalFile
|
||||
{
|
||||
@@ -125,7 +125,26 @@ public sealed class OutdatedRunTests
|
||||
FilePath = "/tmp/test-data/report.pdf",
|
||||
};
|
||||
|
||||
Assert.That(DataSourceEmbeddingService.GetRunSignature(dataSource, TestEmbeddingProvider(), ConfidenceLevel.MEDIUM).SelectionSignature, Is.Empty, "The file is the one document of its data source, so there is nothing to choose among.");
|
||||
var before = DataSourceEmbeddingService.GetRunSignature(dataSource, TestEmbeddingProvider(), ConfidenceLevel.MEDIUM);
|
||||
var after = DataSourceEmbeddingService.GetRunSignature(dataSource with { FilePath = "/tmp/moved/report.pdf" }, TestEmbeddingProvider(), ConfidenceLevel.MEDIUM);
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(DataSourceEmbeddingService.IsRunOutdated(before, after), Is.True);
|
||||
Assert.That(after.EmbeddingSignature, Is.EqualTo(before.EmbeddingSignature));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RelocatingAFolderStopsTheOldRunWithoutInvalidatingItsEmbeddings()
|
||||
{
|
||||
var dataSource = DataSource(ConfidenceLevel.LOW);
|
||||
var before = DataSourceEmbeddingService.GetRunSignature(dataSource, TestEmbeddingProvider(), ConfidenceLevel.MEDIUM);
|
||||
var after = DataSourceEmbeddingService.GetRunSignature(dataSource with { Path = "/tmp/moved" }, TestEmbeddingProvider(), ConfidenceLevel.MEDIUM);
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(DataSourceEmbeddingService.IsRunOutdated(before, after), Is.True);
|
||||
Assert.That(after.EmbeddingSignature, Is.EqualTo(before.EmbeddingSignature));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in new issue
Block a user