mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 15:53:48 +00:00
Let tool results restrict a chat to self-hosted providers
This commit is contained in:
9 files changed
+209
-52
No files matched your search
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user