mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-20 16:52:14 +00:00
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using AIStudio.Dialogs.Settings;
|
|
using AIStudio.Tools;
|
|
using AIStudio.Tools.ToolCallingSystem;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AIStudio.Components.Settings;
|
|
|
|
public partial class SettingsPanelTools : SettingsPanelBase
|
|
{
|
|
[Inject]
|
|
private ToolRegistry ToolRegistry { get; init; } = null!;
|
|
|
|
private IReadOnlyList<ToolCatalogItem> items = [];
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await base.OnInitializedAsync();
|
|
this.items = await this.ToolRegistry.GetCatalogAsync(this.ToolRegistry.GetAllDefinitions());
|
|
}
|
|
|
|
private async Task OpenSettings(string toolId)
|
|
{
|
|
var parameters = new DialogParameters<ToolSettingsDialog>
|
|
{
|
|
{ x => x.ToolId, toolId },
|
|
};
|
|
|
|
var dialog = await this.DialogService.ShowAsync<ToolSettingsDialog>(null, parameters, Dialogs.DialogOptions.FULLSCREEN);
|
|
await dialog.Result;
|
|
this.items = await this.ToolRegistry.GetCatalogAsync(this.ToolRegistry.GetAllDefinitions());
|
|
this.StateHasChanged();
|
|
}
|
|
}
|