@inherits MSGComponentBase
@T("Tool Selection") @T("Tools allow the LLM to perform targeted additional actions such as web searches or reading web pages.") @if (!this.SupportsTools) { @this.UnsupportedToolsMessage } else if (this.Disabled) { @T("Tool changes are locked while a response is running. Your current selection is shown below and applies again from the next message once the run is finished.") } else if (this.catalog.Count == 0) { @T("No tools are available in this context.") } @if (this.SupportsTools && this.catalog.Count > 0) { @foreach (var item in this.catalog) { var isSelected = this.SelectedToolIds.Contains(item.Definition.Id); var isConfigured = item.ConfigurationState.IsConfigured; var providerConfidenceHint = this.GetProviderConfidenceHint(item); @* Everything but the settings button switches the tool, so aiming for the small switch is optional. The button spans that part of the row, which keeps the settings button outside of it without any event plumbing. *@ @* The switch only shows the state; the surrounding button does the switching. It therefore takes no pointer events at all: its label reaches past the visible switch and would otherwise swallow the clicks landing in that strip. *@ @if (!item.IsActive) { } @item.Implementation.GetDisplayName() @if (!isConfigured) { @(string.IsNullOrWhiteSpace(item.ConfigurationState.Message) ? T("Required settings are missing. Configure this tool before enabling it.") : item.ConfigurationState.Message) } @if (!item.IsActive) { @T("This tool has been disabled by your organization.") } @if (!string.IsNullOrWhiteSpace(providerConfidenceHint)) { @providerConfidenceHint } } } @T("Close")