Avoided needless Semantic Search calls when no data source can be searched (#1108)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-25 19:38:52 +01:00
1 parent 8d9b15bd5f
commit d26139936a
8 files changed
+92 -33

No files matched your search

@@ -55,6 +55,19 @@ public sealed class SemanticSearchToolUnreachableTests
Assert.That(offered.IsEmpty, Is.True, "A data source configured to return no matches is not offered when it answers, either.");
}
[Test]
public void OnlyUnreachableDataSourcesKeepTheToolOut()
{
var options = new DataSourceOptions { AutomaticDataSourceSelection = false, PreselectedDataSourceIds = [INTRANET.Id] };
var offered = SemanticSearchTool.SelectOffered(options, Checked([HANDBOOK], [], [INTRANET]));
Assert.Multiple(() =>
{
Assert.That(offered.IsSearchable, Is.False, "The model would search all the same, and every such call costs a round of the answer for nothing.");
Assert.That(offered.Unreachable, Is.EqualTo(new[] { INTRANET }), "The model still has to learn what is missing, then through the system prompt.");
});
}
[Test]
public void ASearchOfAllDataSourcesReportsTheUnreachableOnes()
{