mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-12 03:02:57 +00:00
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Co-authored-by: Thorsten Sommer <mail@tsommer.org> Co-authored-by: Thorsten Sommer <thorsten.sommer@dlr.de>
56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
using AIStudio.Chat;
|
|
using AIStudio.Dialogs.Settings;
|
|
using AIStudio.Settings;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
|
|
|
namespace AIStudio.Components;
|
|
|
|
public partial class ChatTemplateSelection : MSGComponentBase
|
|
{
|
|
[Parameter]
|
|
public ChatTemplate CurrentChatTemplate { get; set; } = ChatTemplate.NO_CHAT_TEMPLATE;
|
|
|
|
[Parameter]
|
|
public bool CanChatThreadBeUsedForTemplate { get; set; }
|
|
|
|
[Parameter]
|
|
public ChatThread? CurrentChatThread { get; set; }
|
|
|
|
[Parameter]
|
|
public EventCallback<ChatTemplate> CurrentChatTemplateChanged { get; set; }
|
|
|
|
[Parameter]
|
|
public string MarginLeft { get; set; } = "ml-1";
|
|
|
|
[Parameter]
|
|
public string MarginRight { get; set; } = string.Empty;
|
|
|
|
[Inject]
|
|
private IDialogService DialogService { get; init; } = null!;
|
|
|
|
private string MarginClass => $"{this.MarginLeft} {this.MarginRight}";
|
|
|
|
private async Task SelectionChanged(ChatTemplate chatTemplate)
|
|
{
|
|
this.CurrentChatTemplate = chatTemplate;
|
|
await this.CurrentChatTemplateChanged.InvokeAsync(chatTemplate);
|
|
}
|
|
|
|
private async Task OpenSettingsDialog()
|
|
{
|
|
var dialogParameters = new DialogParameters();
|
|
await this.DialogService.ShowAsync<SettingsDialogChatTemplate>(T("Open Chat Template Options"), dialogParameters, DialogOptions.FULLSCREEN);
|
|
}
|
|
|
|
private async Task CreateNewChatTemplateFromChat()
|
|
{
|
|
var dialogParameters = new DialogParameters<SettingsDialogChatTemplate>
|
|
{
|
|
{ x => x.CreateTemplateFromExistingChatThread, true },
|
|
{ x => x.ExistingChatThread, this.CurrentChatThread }
|
|
};
|
|
await this.DialogService.ShowAsync<SettingsDialogChatTemplate>(T("Open Chat Template Options"), dialogParameters, DialogOptions.FULLSCREEN);
|
|
}
|
|
} |