mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-29 16:23:38 +00:00
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
51 lines
2.5 KiB
C#
51 lines
2.5 KiB
C#
using AIStudio.Settings.DataModel;
|
|
using AIStudio.Tools.Services;
|
|
|
|
namespace AIStudio.Tests.Tools;
|
|
|
|
/// <summary>
|
|
/// Checks which agents count as seeing the data of the data sources.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Every provider which sees the data must be trusted enough for every data source it sees. That
|
|
/// cuts both ways: leaving out an agent which does run would send data to a provider trusted too
|
|
/// little, while counting an agent which does not run holds back data sources for no reason. The
|
|
/// classic RAG process runs its agents; Semantic Search runs none, since the chat model picks the
|
|
/// data sources and judges the passages itself.
|
|
/// </remarks>
|
|
[TestFixture]
|
|
public sealed class DataSourceParticipatingAgentsTests
|
|
{
|
|
[Test]
|
|
public void SemanticSearchRunsNoAgent()
|
|
{
|
|
var agents = DataSourceService.GetParticipatingAgents(Options(automaticSelection: true, automaticValidation: true), DataSourceRetrievalMode.SEMANTIC_SEARCH, retrievalContextValidationEnabled: true);
|
|
|
|
Assert.That(agents, Is.Empty, "The chat provider alone sees the data, so its trust alone decides which data sources it may search.");
|
|
}
|
|
|
|
[Test]
|
|
public void TheClassicRAGProcessCountsTheAgentsItRuns()
|
|
{
|
|
var agents = DataSourceService.GetParticipatingAgents(Options(automaticSelection: true, automaticValidation: true), DataSourceRetrievalMode.EVERY_MESSAGE, retrievalContextValidationEnabled: true);
|
|
|
|
Assert.That(agents.Select(agent => agent.Component), Is.EqualTo(new[] { AIStudio.Tools.Components.AGENT_DATA_SOURCE_SELECTION, AIStudio.Tools.Components.AGENT_RETRIEVAL_CONTEXT_VALIDATION }));
|
|
}
|
|
|
|
[Test]
|
|
public void TheClassicRAGProcessCountsNoAgentItDoesNotRun()
|
|
{
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(DataSourceService.GetParticipatingAgents(Options(automaticSelection: false, automaticValidation: false), DataSourceRetrievalMode.EVERY_MESSAGE, retrievalContextValidationEnabled: true), Is.Empty);
|
|
Assert.That(DataSourceService.GetParticipatingAgents(Options(automaticSelection: false, automaticValidation: true), DataSourceRetrievalMode.EVERY_MESSAGE, retrievalContextValidationEnabled: false), Is.Empty, "The validation of this chat is on, but the settings switch it off everywhere.");
|
|
});
|
|
}
|
|
|
|
private static DataSourceOptions Options(bool automaticSelection, bool automaticValidation) => new()
|
|
{
|
|
DisableDataSources = false,
|
|
AutomaticDataSourceSelection = automaticSelection,
|
|
AutomaticValidation = automaticValidation,
|
|
};
|
|
} |