optik
This commit is contained in:
@@ -50,7 +50,8 @@ namespace BeWo.ViewModel.Controls.AI
|
||||
public AiChatButtonState ButtonState
|
||||
{
|
||||
get => buttonState;
|
||||
set {
|
||||
set
|
||||
{
|
||||
if (!SetProperty(ref buttonState, value, nameof(ButtonState)))
|
||||
return;
|
||||
|
||||
@@ -87,20 +88,20 @@ namespace BeWo.ViewModel.Controls.AI
|
||||
OpenConversationPopupCommand = new DelegateCommand(OpenConversationPopup, () => CanOpenConversation);
|
||||
OpenAllPromptsPopupCommand = new DelegateCommand(OpenAllPromptsPopup, () => CanSendNewMessage);
|
||||
OpenFavoritePromptsPopupCommand = new DelegateCommand(OpenFavoritePromptsPopup, () => CanSendNewMessage);
|
||||
|
||||
ButtonState = AiChatButtonState.Loading;
|
||||
}
|
||||
|
||||
public void CheckContextSize()
|
||||
{
|
||||
if (!IsEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ButtonState = AiChatButtonState.Loading;
|
||||
var context = GetAiVisualContext();
|
||||
if (context != null)
|
||||
{
|
||||
if(context.Primary is null)
|
||||
if (context.Primary is null)
|
||||
{
|
||||
IsVisible = false;
|
||||
ButtonState = AiChatButtonState.Disabled;
|
||||
@@ -121,6 +122,42 @@ namespace BeWo.ViewModel.Controls.AI
|
||||
}
|
||||
}
|
||||
|
||||
public void ReloadData(bool value, Action<AiActionType, List<AiPromptbausteinFolderDC>> initPromptbausteine)
|
||||
{
|
||||
if (!IsEnabled)
|
||||
return;
|
||||
|
||||
var actionType = ActionType;
|
||||
|
||||
ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiPromptbausteinFolder(actionType), folders => initPromptbausteine(actionType, folders),
|
||||
null,
|
||||
true);
|
||||
}
|
||||
|
||||
public void ItemAccepted(AbstractBaseVM e)
|
||||
{
|
||||
if (e is AiPromptbausteinPromptVM prompt)
|
||||
{
|
||||
var vm = GetConversationViewModel();
|
||||
vm.SendAfterLoaded = true;
|
||||
vm.PromptInput = prompt;
|
||||
vm.MessageInput = prompt.Prompt;
|
||||
BeWoApp.MainControl.WindowService.Show(vm);
|
||||
return;
|
||||
}
|
||||
else if (e is AiPromptbausteinRoutineVM routine)
|
||||
{
|
||||
var vm = GetConversationViewModel();
|
||||
vm.SendAfterLoaded = true;
|
||||
vm.RoutineInput = routine;
|
||||
vm.MessageInput = routine.Steps.VMList[0].PromptReference.Prompt;
|
||||
BeWoApp.MainControl.WindowService.Show(vm);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private protected AiConversationChatViewModel GetConversationViewModel()
|
||||
{
|
||||
var context = GetAiVisualContext();
|
||||
@@ -162,30 +199,6 @@ namespace BeWo.ViewModel.Controls.AI
|
||||
|
||||
throw new InvalidOperationException($"UserRightType '{ActionType}' not implemented");
|
||||
}
|
||||
|
||||
public void ItemAccepted(AbstractBaseVM e)
|
||||
{
|
||||
if(e is AiPromptbausteinPromptVM prompt)
|
||||
{
|
||||
var vm = GetConversationViewModel();
|
||||
vm.SendAfterLoaded = true;
|
||||
vm.PromptInput = prompt;
|
||||
vm.MessageInput = prompt.Prompt;
|
||||
BeWoApp.MainControl.WindowService.Show(vm);
|
||||
return;
|
||||
}
|
||||
else if(e is AiPromptbausteinRoutineVM routine)
|
||||
{
|
||||
var vm = GetConversationViewModel();
|
||||
vm.SendAfterLoaded = true;
|
||||
vm.RoutineInput = routine;
|
||||
vm.MessageInput = routine.Steps.VMList[0].PromptReference.Prompt;
|
||||
BeWoApp.MainControl.WindowService.Show(vm);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class AiMenuItemTemplate
|
||||
|
||||
Reference in New Issue
Block a user