mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 22:13:47 +00:00
Read Web Page is now opened automatically when the confluence tool is selected
This commit is contained in:
1 parent
5c867a9b23
commit
243dc34a34
8 files changed
+35
-6
No files matched your search
@@ -348,12 +348,12 @@ public sealed class AssistantAuditAgent(ILogger<AssistantAuditAgent> logger, ILo
|
||||
/// </remarks>
|
||||
private string FormatRequestedTools(PluginAssistants plugin)
|
||||
{
|
||||
var toolIds = plugin.AssistantToolIds ?? plugin.ChatLaunchConfiguration?.ToolIds ?? [];
|
||||
var toolIds = ToolSelectionRules.NormalizeSelection(plugin.AssistantToolIds ?? plugin.ChatLaunchConfiguration?.ToolIds ?? []);
|
||||
if (toolIds.Count == 0)
|
||||
return "None. This plugin does not request any tools.";
|
||||
|
||||
var builder = new StringBuilder();
|
||||
foreach (var toolId in toolIds)
|
||||
foreach (var toolId in toolIds.OrderBy(x => x, StringComparer.Ordinal))
|
||||
{
|
||||
var definition = toolRegistry.GetDefinition(toolId);
|
||||
if (definition is null)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Globalization;
|
||||
using AIStudio.Dialogs;
|
||||
using AIStudio.Tools.PluginSystem.Assistants;
|
||||
using AIStudio.Tools.ToolCallingSystem;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
||||
|
||||
@@ -30,7 +31,9 @@ public partial class AssistantPluginSecurityCard : MSGComponentBase
|
||||
/// should see that beforehand, which is why the count sits in the header next to the audit
|
||||
/// level and the tools themselves are named in the details.
|
||||
/// </remarks>
|
||||
private IReadOnlyList<string> PluginToolIds => this.Plugin?.AssistantToolIds ?? this.Plugin?.ChatLaunchConfiguration?.ToolIds ?? [];
|
||||
private IReadOnlyList<string> PluginToolIds => ToolSelectionRules.NormalizeSelection(this.Plugin?.AssistantToolIds ?? this.Plugin?.ChatLaunchConfiguration?.ToolIds ?? [])
|
||||
.OrderBy(x => x, StringComparer.Ordinal)
|
||||
.ToList();
|
||||
|
||||
private CultureInfo currentCultureInfo = CultureInfo.InvariantCulture;
|
||||
private bool showSecurityCard;
|
||||
|
||||
@@ -49,6 +49,12 @@ public partial class ToolSelectionField : MSGComponentBase
|
||||
|
||||
private List<ConfigurationSelectData<string>> availableTools = [];
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
this.SelectedToolIds = ToolSelectionRules.NormalizeSelection(this.SelectedToolIds);
|
||||
base.OnParametersSet();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
this.availableTools = (await this.ToolRegistry.GetCatalogAsync(this.Component))
|
||||
@@ -80,4 +86,4 @@ public partial class ToolSelectionField : MSGComponentBase
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1071,6 +1071,7 @@ CONFIG["CHAT_TEMPLATES"] = {}
|
||||
-- -- organization switched off. A tool has to meet the confidence requirements of the
|
||||
-- -- provider in use, so it may stay unavailable even though this template names it.
|
||||
-- -- Tool IDs include: web_search, read_web_page, search_confluence
|
||||
-- -- Selecting search_confluence also selects read_web_page.
|
||||
-- ["ToolIds"] = {
|
||||
-- "read_web_page",
|
||||
-- },
|
||||
@@ -1176,6 +1177,7 @@ CONFIG["DOCUMENT_ANALYSIS_POLICIES"] = {}
|
||||
-- -- A listed tool must still meet the confidence requirements of the provider in
|
||||
-- -- use, so a tool may stay unavailable even though this policy permits it.
|
||||
-- -- Tool IDs include: web_search, read_web_page, search_confluence
|
||||
-- -- Allowing search_confluence also allows read_web_page.
|
||||
-- ["AllowedToolIds"] = { "web_search" },
|
||||
--
|
||||
-- -- Optional: preselect a provider or profile by ID.
|
||||
|
||||
+6
@@ -12564,6 +12564,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS:
|
||||
-- The setting '{0}' must not exceed {1}.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T3109652601"] = "Die Einstellung „{0}“ darf den Wert {1} nicht überschreiten."
|
||||
|
||||
-- Confluence asked for a sign-in instead of showing search results. Your operating system's sign-in was not accepted by the wiki; open it in your browser to check your access.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T3122873647"] = "Confluence hat eine Anmeldung angefordert, statt Suchergebnisse anzuzeigen. Ihre Betriebssystemanmeldung wurde vom Wiki nicht akzeptiert; öffnen Sie es in Ihrem Browser, um Ihren Zugriff zu überprüfen."
|
||||
|
||||
-- Confluence Base URL
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T3278636117"] = "Confluence-Basis-URL"
|
||||
|
||||
@@ -12585,6 +12588,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS:
|
||||
-- Search Confluence
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T665149329"] = "Confluence durchsuchen"
|
||||
|
||||
-- Confluence search for “{0}”
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T718586991"] = "Confluence-Suche nach „{0}“"
|
||||
|
||||
-- The HTTPS address of your Confluence site, including its path if present, such as https://wiki.example.org/confluence/. AI Studio searches through the same page reader used by Read Web Page.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T859229067"] = "Die HTTPS-Adresse Ihrer Confluence-Site, einschließlich des Pfads, falls vorhanden, wie https://wiki.example.org/confluence/. AI Studio verwendet zum Durchsuchen denselben Seitenleser wie „Webseite lesen“."
|
||||
|
||||
|
||||
+6
@@ -12564,6 +12564,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS:
|
||||
-- The setting '{0}' must not exceed {1}.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T3109652601"] = "The setting '{0}' must not exceed {1}."
|
||||
|
||||
-- Confluence asked for a sign-in instead of showing search results. Your operating system's sign-in was not accepted by the wiki; open it in your browser to check your access.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T3122873647"] = "Confluence asked for a sign-in instead of showing search results. Your operating system's sign-in was not accepted by the wiki; open it in your browser to check your access."
|
||||
|
||||
-- Confluence Base URL
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T3278636117"] = "Confluence Base URL"
|
||||
|
||||
@@ -12585,6 +12588,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS:
|
||||
-- Search Confluence
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T665149329"] = "Search Confluence"
|
||||
|
||||
-- Confluence search for “{0}”
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T718586991"] = "Confluence search for “{0}”"
|
||||
|
||||
-- The HTTPS address of your Confluence site, including its path if present, such as https://wiki.example.org/confluence/. AI Studio searches through the same page reader used by Read Web Page.
|
||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::TOOLCALLINGSYSTEM::TOOLCALLINGIMPLEMENTATIONS::CONFLUENCESEARCHTOOL::T859229067"] = "The HTTPS address of your Confluence site, including its path if present, such as https://wiki.example.org/confluence/. AI Studio searches through the same page reader used by Read Web Page."
|
||||
|
||||
|
||||
@@ -11,7 +11,13 @@ public static class ToolSelectionRules
|
||||
public const string SEARCH_CONFLUENCE_TOOL_ID = "search_confluence";
|
||||
|
||||
public static HashSet<string> NormalizeSelection(IEnumerable<string> selectedToolIds)
|
||||
=> selectedToolIds.ToHashSet(StringComparer.Ordinal);
|
||||
{
|
||||
var normalized = selectedToolIds.ToHashSet(StringComparer.Ordinal);
|
||||
if (normalized.Contains(SEARCH_CONFLUENCE_TOOL_ID))
|
||||
normalized.Add(READ_WEB_PAGE_TOOL_ID);
|
||||
|
||||
return normalized;
|
||||
}
|
||||
|
||||
public static string GetMaxToolCallsFinalResponseInstruction() => $"The maximum of {MAX_TOOL_CALLS} tool calls has been reached. No more tools are available. Provide the best possible final answer to the user based on the tool results already available.";
|
||||
|
||||
|
||||
Reference in new issue
Block a user