mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 01:53:36 +00:00
Show only On and Off for Brave Mode
This commit is contained in:
parent
672abb4082
commit
465497592b
@ -12571,6 +12571,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGAVAILABILITYEXTE
|
||||
-- Allowed private hosts must be host names only, without scheme or path.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T2196457612"] = "Allowed private hosts must be host names only, without scheme or path."
|
||||
|
||||
-- Off: the model is instructed to read only URLs supplied in the system prompt, your message (including loaded documents and retrieved data), or tool results. On: the model may choose a URL itself. This instruction guides the model; it does not technically block URL requests.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T2219424031"] = "Off: the model is instructed to read only URLs supplied in the system prompt, your message (including loaded documents and retrieved data), or tool results. On: the model may choose a URL itself. This instruction guides the model; it does not technically block URL requests."
|
||||
|
||||
-- The web page was not loaded because private or VPN web pages require a High-confidence provider or a provider trusted by your organization's configuration.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T2563437007"] = "The web page was not loaded because private or VPN web pages require a High-confidence provider or a provider trusted by your organization's configuration."
|
||||
|
||||
@ -12595,12 +12598,18 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS:
|
||||
-- (Optional) Host allowlist for private or VPN web pages. For security reasons, private or VPN web pages aren't allowed to be read by default. Separate host patterns with commas, such as example.de, *.example.de. Allowed private hosts require a High-confidence provider or a provider trusted by your organization's configuration. For allowed HTTPS internal hosts, AI Studio also tries the operating system's default sign-in automatically when the server responds with integrated authentication.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T3802894016"] = "(Optional) Host allowlist for private or VPN web pages. For security reasons, private or VPN web pages aren't allowed to be read by default. Separate host patterns with commas, such as example.de, *.example.de. Allowed private hosts require a High-confidence provider or a provider trusted by your organization's configuration. For allowed HTTPS internal hosts, AI Studio also tries the operating system's default sign-in automatically when the server responds with integrated authentication."
|
||||
|
||||
-- Brave Mode must be Off or On.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T4125722529"] = "Brave Mode must be Off or On."
|
||||
|
||||
-- (Optional) HTTP timeout for loading a web page in seconds.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T4126164830"] = "(Optional) HTTP timeout for loading a web page in seconds."
|
||||
|
||||
-- The setting '{0}' must be a positive integer.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T4199432074"] = "The setting '{0}' must be a positive integer."
|
||||
|
||||
-- Brave Mode
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T767509756"] = "Brave Mode"
|
||||
|
||||
-- (Optional) Global truncation limit for extracted characters returned to the model.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::READWEBPAGETOOL::T900659180"] = "(Optional) Global truncation limit for extracted characters returned to the model."
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
if (fieldOptions.Count > 0)
|
||||
{
|
||||
<MudSelect T="string" Label="@this.GetFieldLabel(fieldName, field)" Value="@this.GetValue(fieldName)" ValueChanged="@(value => this.UpdateValue(fieldName, value))" Variant="Variant.Outlined" Margin="Margin.Dense" HelperText="@this.GetFieldDescription(fieldName, field)" Placeholder="@this.GetFieldPlaceholder(fieldName, field)" Class="mb-3" Disabled="@this.IsFieldDisabled(fieldName)">
|
||||
@if (!this.toolDefinition.SettingsSchema.Required.Contains(fieldName))
|
||||
@if (!this.toolDefinition.SettingsSchema.Required.Contains(fieldName) && string.IsNullOrEmpty(field.DefaultValue))
|
||||
{
|
||||
<MudSelectItem T="string" Value="@string.Empty">@T("Not set")</MudSelectItem>
|
||||
}
|
||||
|
||||
@ -29,6 +29,11 @@ public partial class ToolSettingsDialog : SettingsDialogBase
|
||||
{
|
||||
this.implementation = this.ToolRegistry.GetImplementation(this.toolDefinition.ImplementationKey);
|
||||
this.values = await this.ToolSettingsService.GetSettingsAsync(this.toolDefinition);
|
||||
foreach (var (fieldName, field) in this.toolDefinition.SettingsSchema.Properties)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(field.DefaultValue) && string.IsNullOrEmpty(this.GetValue(fieldName)))
|
||||
this.values[fieldName] = field.DefaultValue;
|
||||
}
|
||||
this.fieldGroups = BuildFieldGroups(this.toolDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ public sealed class ReadWebPageTool(WebPageRetrievalService webPageRetrievalServ
|
||||
.Optional(TIMEOUT_SECONDS_SETTING)
|
||||
.Optional(MAX_CONTENT_CHARACTERS_SETTING)
|
||||
.Optional(ALLOWED_PRIVATE_HOSTS_SETTING)
|
||||
.OptionalEnum(BRAVE_MODE_SETTING, BRAVE_MODE_OFF, BRAVE_MODE_ON)
|
||||
.OptionalEnumWithDefault(BRAVE_MODE_SETTING, BRAVE_MODE_OFF, BRAVE_MODE_OFF, BRAVE_MODE_ON)
|
||||
.Build(),
|
||||
|
||||
SystemPromptInstructions = BuildSystemPromptInstructions(BRAVE_MODE_OFF),
|
||||
|
||||
@ -13,6 +13,12 @@ public sealed class ToolSettingsFieldDefinition
|
||||
[JsonPropertyName("enum")]
|
||||
public List<string> EnumValues { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Value shown and saved for an optional choice when no value has been stored yet.
|
||||
/// A choice with a default does not offer a separate "Not set" option.
|
||||
/// </summary>
|
||||
public string DefaultValue { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Name of a list of options the app maintains, as an alternative to spelling them out in
|
||||
/// the enum field. See the tool settings option sources for the available names.
|
||||
@ -44,4 +50,4 @@ public sealed class ToolSettingsFieldDefinition
|
||||
public IReadOnlyList<ToolSettingsOption> GetOptions() => string.IsNullOrWhiteSpace(this.OptionSource)
|
||||
? this.EnumValues.Select(value => new ToolSettingsOption(value, value)).ToList()
|
||||
: ToolSettingsOptionSources.Resolve(this.OptionSource);
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +61,9 @@ public sealed class ToolSettingsSchemaBuilder
|
||||
/// </remarks>
|
||||
public ToolSettingsSchemaBuilder OptionalEnum(string name, params string[] values) => this.Add(name, isRequired: false, enumValues: values);
|
||||
|
||||
public ToolSettingsSchemaBuilder OptionalEnumWithDefault(string name, string defaultValue, params string[] values) =>
|
||||
this.Add(name, isRequired: false, enumValues: values, defaultValue: defaultValue);
|
||||
|
||||
/// <summary>
|
||||
/// A field kept in the operating system's keyring rather than in the settings file.
|
||||
/// </summary>
|
||||
@ -74,12 +77,13 @@ public sealed class ToolSettingsSchemaBuilder
|
||||
Required = [..this.requiredNames],
|
||||
};
|
||||
|
||||
private ToolSettingsSchemaBuilder Add(string name, bool isRequired, string optionSource = "", bool isSecret = false, IReadOnlyList<string>? enumValues = null)
|
||||
private ToolSettingsSchemaBuilder Add(string name, bool isRequired, string optionSource = "", bool isSecret = false, IReadOnlyList<string>? enumValues = null, string defaultValue = "")
|
||||
{
|
||||
this.properties[name] = new ToolSettingsFieldDefinition
|
||||
{
|
||||
OptionSource = optionSource,
|
||||
EnumValues = enumValues?.ToList() ?? [],
|
||||
DefaultValue = defaultValue,
|
||||
Secret = isSecret,
|
||||
Group = this.currentGroup,
|
||||
};
|
||||
@ -89,4 +93,4 @@ public sealed class ToolSettingsSchemaBuilder
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user