mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-06-27 17:16:28 +00:00
Adding allowed private hosts for read_web_page tool to managed settings. This enables a whitelist because all other private hosts will be blocked
This commit is contained in:
parent
f2c63ac4b5
commit
1f42c8ad4c
@ -222,6 +222,14 @@ CONFIG["SETTINGS"] = {}
|
|||||||
-- ["get_current_weather"] = "NONE"
|
-- ["get_current_weather"] = "NONE"
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
|
-- Configure private or VPN hosts that the Read Web Page tool may access.
|
||||||
|
-- Public web pages do not need to be listed here.
|
||||||
|
-- Private hosts listed here still require a provider with HIGH confidence before any page content is sent to the model.
|
||||||
|
-- Separate host patterns with commas. Wildcards only match subdomains, so add the root domain separately if needed.
|
||||||
|
-- Examples:
|
||||||
|
-- CONFIG["SETTINGS"]["DataTools.ReadWebPageAllowedPrivateHosts"] = "dlr.de, *.dlr.de"
|
||||||
|
-- CONFIG["SETTINGS"]["DataTools.ReadWebPageAllowedPrivateHosts.AllowUserOverride"] = false
|
||||||
|
|
||||||
-- Example chat templates for this configuration:
|
-- Example chat templates for this configuration:
|
||||||
CONFIG["CHAT_TEMPLATES"] = {}
|
CONFIG["CHAT_TEMPLATES"] = {}
|
||||||
|
|
||||||
|
|||||||
@ -20,4 +20,9 @@ public sealed class DataTools(Expression<Func<Data, DataTools>>? configSelection
|
|||||||
configSelection,
|
configSelection,
|
||||||
x => x.MinimumProviderConfidenceByToolId,
|
x => x.MinimumProviderConfidenceByToolId,
|
||||||
new Dictionary<string, string>(StringComparer.Ordinal));
|
new Dictionary<string, string>(StringComparer.Ordinal));
|
||||||
|
|
||||||
|
public string ReadWebPageAllowedPrivateHosts { get; set; } = ManagedConfiguration.Register<DataTools>(
|
||||||
|
configSelection,
|
||||||
|
x => x.ReadWebPageAllowedPrivateHosts,
|
||||||
|
string.Empty);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,6 +136,9 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
|||||||
// Config: minimum provider confidence per tool
|
// Config: minimum provider confidence per tool
|
||||||
ManagedConfiguration.TryProcessConfiguration(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, this.Id, settingsTable, dryRun);
|
ManagedConfiguration.TryProcessConfiguration(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, this.Id, settingsTable, dryRun);
|
||||||
|
|
||||||
|
// Config: private hosts allowed for the read web page tool
|
||||||
|
ManagedConfiguration.TryProcessConfiguration(x => x.Tools, x => x.ReadWebPageAllowedPrivateHosts, this.Id, settingsTable, dryRun);
|
||||||
|
|
||||||
// Handle configured LLM providers:
|
// Handle configured LLM providers:
|
||||||
PluginConfigurationObject.TryParse(PluginConfigurationObjectType.LLM_PROVIDER, x => x.Providers, x => x.NextProviderNum, mainTable, this.Id, ref this.configObjects, dryRun);
|
PluginConfigurationObject.TryParse(PluginConfigurationObjectType.LLM_PROVIDER, x => x.Providers, x => x.NextProviderNum, mainTable, this.Id, ref this.configObjects, dryRun);
|
||||||
|
|
||||||
|
|||||||
@ -242,6 +242,10 @@ public static partial class PluginFactory
|
|||||||
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, AVAILABLE_PLUGINS))
|
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, AVAILABLE_PLUGINS))
|
||||||
wasConfigurationChanged = true;
|
wasConfigurationChanged = true;
|
||||||
|
|
||||||
|
// Check for private hosts allowed for the read web page tool:
|
||||||
|
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.Tools, x => x.ReadWebPageAllowedPrivateHosts, AVAILABLE_PLUGINS))
|
||||||
|
wasConfigurationChanged = true;
|
||||||
|
|
||||||
if (wasConfigurationChanged)
|
if (wasConfigurationChanged)
|
||||||
{
|
{
|
||||||
await SETTINGS_MANAGER.StoreSettings();
|
await SETTINGS_MANAGER.StoreSettings();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user