Let tool results restrict a chat to self-hosted providers

This commit is contained in:
Thorsten Sommer committed 2026-09-24 15:07:39 +02:00
1 parent e9460a9cde
commit 4617aa5230
9 files changed
+209 -52

No files matched your search

+20
View File
@@ -106,6 +106,26 @@ public sealed record ChatThread
this.RequiredProviderConfidence = minimumProviderConfidence;
}
/// <summary>
/// Tightens the data security of this chat to what the data brought in demands, and never
/// loosens it.
/// </summary>
/// <remarks>
/// Data which may only be used with self-hosted providers keeps the chat restricted to them,
/// no matter what comes in later: the data was seen by this chat. Data which may be used with
/// any provider marks the chat as one which holds data of a data source, while a restriction set
/// earlier stays. NOT_SPECIFIED demands nothing and changes nothing.<br/><br/>
/// Shared by the RAG process and by tools which search the data sources, so both tighten a chat
/// the same way.
/// </remarks>
/// <param name="dataSecurity">What the data brought in demands.</param>
public void RequireDataSecurity(DataSourceSecurity dataSecurity) => this.DataSecurity = (this.DataSecurity, dataSecurity) switch
{
(DataSourceSecurity.SELF_HOSTED, _) or (_, DataSourceSecurity.SELF_HOSTED) => DataSourceSecurity.SELF_HOSTED,
(_, DataSourceSecurity.ALLOW_ANY) => DataSourceSecurity.ALLOW_ANY,
_ => this.DataSecurity,
};
/// <summary>
/// The name of the chat thread. Usually generated by an AI model or manually edited by the user.
/// </summary>