Outbound data restrictions after searching data sources (#1106)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-23 09:27:22 +02:00
1 parent 7ba5f01388
commit 8c5cfa78b6
61 files changed
+1389 -143

No files matched your search

@@ -1,3 +1,5 @@
using System.Text.Json;
using AIStudio.Settings;
using AIStudio.Settings.DataModel;
using AIStudio.Tools.ToolCallingSystem.ToolCallingImplementations.Mailboxes;
@@ -48,6 +50,16 @@ public sealed class MailboxOutboundDataRestrictionTests
Assert.That(outboundData.Restriction, Is.EqualTo(OutboundDataRestriction.ONLY_CONFIGURED_SERVICES));
}
[Test]
public void ANumberWhichNamesNoLevelRestrictsTheChatToTheConfiguredServices()
{
var mailbox = JsonSerializer.Deserialize<DataSourceMailbox>("""{"Id": "3c7e1a9f-5d2b-4f8c-a6e3-9b1d4f7a2c56", "OutboundDataRestriction": "5"}""", SettingsManager.JSON_OPTIONS);
var (_, outboundData) = MailToolResults.GetRequirements([mailbox], OutboundDataRestriction.UNRESTRICTED);
Assert.That(outboundData, Is.EqualTo(new OutboundDataRequirement(OutboundDataRestriction.ONLY_CONFIGURED_SERVICES, OutboundDataOrigin.MAILBOX, mailbox.Id)), "The settings read the number as it is, and compared as it is, it would rank above UNRESTRICTED.");
}
[Test]
public void TheDialogOffersOnlyTheLevelsAllowed()
{