From 7d488886d0daf108a35842b5d2758280f561cfb5 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 23 Jun 2026 15:12:45 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Achtung.=20=C3=9Cberarbeitung=20Closing=20A?= =?UTF-8?q?nimatedBeWoWindow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/ViewModel/VMFactory.cs | 2 +- .../AiPromptbausteinComplexTreeViewModel.cs | 19 ++- Service/Plugins/AiPromptbausteineService.cs | 20 ++- .../Feature/AI/AiPromptbausteinFolderDC.cs | 157 ++++++++---------- Shared/Text/AiPromptbausteineTexts.cs | 2 + 5 files changed, 100 insertions(+), 100 deletions(-) diff --git a/BeWo/ViewModel/VMFactory.cs b/BeWo/ViewModel/VMFactory.cs index 82e025693..3ef1d26ce 100644 --- a/BeWo/ViewModel/VMFactory.cs +++ b/BeWo/ViewModel/VMFactory.cs @@ -976,7 +976,7 @@ namespace BeWo.ViewModel fav_vm.SubPrompts.VMList.Clear(); - folders.VMList.Insert(0, fav_vm); + folders.VMList[0].SubFolders.VMList.Insert(0, fav_vm); findFavoriten(folders, fav_vm); } diff --git a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs index b9fa0643d..698ba7baa 100644 --- a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs +++ b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs @@ -81,7 +81,8 @@ namespace BeWo.ViewModel.View.Administration public AbstractBaseVM SelectedItem { get => _SelectedItem; - set { + set + { var success = SetProperty(ref _SelectedItem, value, nameof(SelectedItem)); if (!success) @@ -169,7 +170,7 @@ namespace BeWo.ViewModel.View.Administration OpenAddRoutineDialogCommand.RaiseCanExecuteChanged(); OpenEditRoutineDialogCommand.RaiseCanExecuteChanged(); DeleteRoutineCommand.RaiseCanExecuteChanged(); - ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged(); + ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged(); } public void UpdateItemCommands() { @@ -185,13 +186,19 @@ namespace BeWo.ViewModel.View.Administration listvm => { Folders = listvm; - if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5) + if (Folders.VMList.Count > 0 + && Folders.VMList[0].DataContract.Oid == -51 + && Folders.VMList[0].SubFolders.Count > 0 + && Folders.VMList[0].SubFolders.VMList[0].DataContract.Oid == -5) { - Favoriten = Folders.VMList[0]; + Favoriten = Folders.VMList[0].SubFolders.VMList[0]; } - if (Folders.VMList.Count > 1) - Folders.VMList[1].IsSelected = true; + if (Folders.VMList.Count > 0 + && Folders.VMList[0].DataContract.Oid == -51 + && Folders.VMList[0].SubFolders.Count > 1 + && Folders.VMList[0].SubFolders.VMList[1].DataContract.Oid == -1) + Folders.VMList[0].SubFolders.VMList[1].IsSelected = true; FirePropertyChanged(nameof(Folders)); }); diff --git a/Service/Plugins/AiPromptbausteineService.cs b/Service/Plugins/AiPromptbausteineService.cs index de4cc5e66..2e8f4ae83 100644 --- a/Service/Plugins/AiPromptbausteineService.cs +++ b/Service/Plugins/AiPromptbausteineService.cs @@ -29,16 +29,26 @@ namespace BeWo.Service.Plugins public IEnumerable GetAiPromptbausteinFolder(AiActionType aiActionType) { + var bib = PredefinedAiPromptbausteinFolders.CreateRootBibNode(aiActionType); + var own_bib = getOwnFolder(aiActionType); var public_bib = getPublicFolders(aiActionType); var ownsoft_bib = getOwnsoftFolder(aiActionType); - var result = new List() { - own_bib, public_bib - }; + bib.SubFolders.Add(own_bib); + bib.SubFolders.Add(public_bib); - if(ownsoft_bib is object) - result.Add(ownsoft_bib); + if (ownsoft_bib is object) + bib.SubFolders.Add(ownsoft_bib); + + foreach(var folder in bib.SubFolders) + { + folder.ParentFolderOid = bib.ParentFolderOid; + } + + var result = new List() { + bib + }; return result; } diff --git a/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs b/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs index 9fd31b498..b673467cb 100644 --- a/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs +++ b/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs @@ -50,112 +50,72 @@ namespace BS.Shared.DataContracts.Feature.AI }; } - public static AiPromptbausteinFolderDC CreateOwnBibNode(AiActionType aiActionType) + public static AiPromptbausteinFolderDC CreateRootBibNode(AiActionType aiActionType) { - return new AiPromptbausteinFolderDC() - { - ActionType = aiActionType, - Description = AiPromptbausteineTexts.OwnBibNodeDescription, - Oid = -1, - ParentFolderOid = null, - SubFolders = new List(), - SubPrompts = new List(), - SubRoutines = new List(), - Title = AiPromptbausteineTexts.OwnBibNodeTitle, - Version = 1, - CanAddFolder = true, - CanAddPrompt = true, - CanAddRoutine = true, - IsExpanded = true, - }; + var title = AiPromptbausteineTexts.RootBibNodeTitle; + var description = AiPromptbausteineTexts.RootBibNodeDescription; + + var node = CreateNode(aiActionType, -51, title, description, null); + + return node; } - //public static AiPromptbausteinFolderDC CreateSharedBibNode(AiActionType aiActionType) - //{ - // return new AiPromptbausteinFolderDC() - // { - // ActionType = aiActionType, - // Description = AiPromptbausteineTexts.SharedBibNodeDescription, - // Oid = -2, - // ParentFolderOid = null, - // SubFolders = new List(), - // SubPrompts = new List(), - // Title = AiPromptbausteineTexts.SharedBibNodeTitle, - // Version = 1, - // IsExpanded = true, - // IsNewFeature = true - // }; - //} + public static AiPromptbausteinFolderDC CreateOwnBibNode(AiActionType aiActionType) + { + var title = AiPromptbausteineTexts.OwnBibNodeTitle; + var description = AiPromptbausteineTexts.OwnBibNodeDescription; + + var node = CreateNode(aiActionType, -1, title, description, null); + + node.CanAddFolder = true; + node.CanAddPrompt = true; + node.CanAddRoutine = true; + + return node; + } public static AiPromptbausteinFolderDC CreatePublicBibNode(AiActionType aiActionType) { - return new AiPromptbausteinFolderDC() - { - ActionType = aiActionType, - Description = AiPromptbausteineTexts.PublicBibNodeDescription, - Oid = -3, - ParentFolderOid = null, - SubFolders = new List(), - SubPrompts = new List(), - SubRoutines = new List(), - Title = AiPromptbausteineTexts.PublicBibNodeTitle, - Version = 1, - IsExpanded = true - }; + var title = AiPromptbausteineTexts.PublicBibNodeTitle; + var description = AiPromptbausteineTexts.PublicBibNodeDescription; + + var node = CreateNode(aiActionType, -3, title, description, null); + + return node; } public static AiPromptbausteinFolderDC CreatePublicSharedBibNode(AiActionType aiActionType, string display) { - return new AiPromptbausteinFolderDC() - { - ActionType = aiActionType, - Description = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeDescription, display), - Oid = -31, - ParentFolderOid = null, - SubFolders = new List(), - SubPrompts = new List(), - SubRoutines = new List(), - Title = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeTitle, display), - Version = 1, - IsExpanded = false - }; + var title = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeTitle, display); + var description = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeDescription, display); + + var node = CreateNode(aiActionType, -31, title, description, null); + + node.IsExpanded = false; + + return node; } public static AiPromptbausteinFolderDC CreateOwnsoftBibNode(AiActionType aiActionType) { - return new AiPromptbausteinFolderDC() - { - ActionType = aiActionType, - Description = AiPromptbausteineTexts.OwnsoftBibNodeDescription, - Oid = -4, - ParentFolderOid = null, - SubFolders = new List(), - SubPrompts = new List(), - SubRoutines = new List(), - Title = AiPromptbausteineTexts.OwnsoftBibNodeTitle, - Version = 1, - IsExpanded = true, - IsNewFeature = false - }; + var title = AiPromptbausteineTexts.OwnsoftBibNodeTitle; + var description = AiPromptbausteineTexts.OwnsoftBibNodeDescription; + + var node = CreateNode(aiActionType, -4, title, description, null); + + return node; } public static AiPromptbausteinFolderDC CreateExampleNode(AiActionType aiActionType) { - return new AiPromptbausteinFolderDC() - { - ActionType = aiActionType, - Description = "Beispielbeschreibung", - Oid = -100, - ParentFolderOid = null, - SubFolders = new List(), - SubPrompts = new List(), - SubRoutines = new List(), - Title = "Beispiel Ordner", - Version = 1, - CanAddFolder = true, - CanAddPrompt = true, - CanEdit = true - }; + var node = CreateNode(aiActionType, -100, "Beispiel Ordner", "Beispielbeschreibung", null); + + node.CanAddFolder = true; + node.CanAddPrompt = true; + node.CanAddRoutine = true; + node.CanEdit = true; + + return node; } public static AiPromptbausteinPromptDC CreateExamplePrompt(AiActionType aiActionType) @@ -170,5 +130,26 @@ namespace BS.Shared.DataContracts.Feature.AI OwnsoftRefLink = "https://help.bewoplaner.de/" }; } + + public static AiPromptbausteinFolderDC CreateNode(AiActionType aiActionType, long oid, string title, string description, long? parent_folder_oid) + { + return new AiPromptbausteinFolderDC() + { + ActionType = aiActionType, + Description = description, + Oid = oid, + ParentFolderOid = parent_folder_oid, + SubFolders = new List(), + SubPrompts = new List(), + SubRoutines = new List(), + Title = title, + Version = 1, + CanAddFolder = false, + CanAddPrompt = false, + CanAddRoutine = false, + CanEdit = false, + IsExpanded = true, + }; + } } } diff --git a/Shared/Text/AiPromptbausteineTexts.cs b/Shared/Text/AiPromptbausteineTexts.cs index d68e170a9..bd0f73ecd 100644 --- a/Shared/Text/AiPromptbausteineTexts.cs +++ b/Shared/Text/AiPromptbausteineTexts.cs @@ -8,6 +8,8 @@ namespace BS.Shared.Text { public static class AiPromptbausteineTexts { + public static string RootBibNodeTitle => "Bibliothek"; + public static string RootBibNodeDescription => "Hier sehen Sie alle Prompts"; public static string OwnBibNodeTitle => "Eigene"; public static string OwnBibNodeDescription => "Hier können Sie Ihre eigenen Prompts verwalten"; public static string PublicBibNodeTitle => "Geteilt"; From 40108ac2dc42b3fcefe62c96d4e8878a0f8ef134 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 23 Jun 2026 16:42:40 +0200 Subject: [PATCH 2/5] =?UTF-8?q?Angesprochene=20=C3=9Cberarbeitung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/Services/BeWoWindowService.cs | 3 +- BeWo/Styles/ControlStyles/GroupBoxStyles.xaml | 125 ++++++++++++++++++ BeWo/View/Controls/AI/AiChatButton.xaml.cs | 5 +- .../AI/AiPromptbausteinLibraryControl.xaml | 101 +++++++------- .../Accounting/GkvAbrechnungOverview.xaml.cs | 2 +- BeWo/View/Windows/AnimatedBeWoWindow.xaml | 2 +- BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs | 4 +- BeWo/ViewModel/AiPromptbausteinFolderVM.cs | 2 +- ...PromptbausteinComplexSelectionViewModel.cs | 29 ++-- BeWo/ViewModel/View/DialogViewModel.cs | 23 +++- Service/Plugins/AiPromptbausteineService.cs | 2 + 11 files changed, 223 insertions(+), 75 deletions(-) diff --git a/BeWo/Services/BeWoWindowService.cs b/BeWo/Services/BeWoWindowService.cs index 39ae5d51f..fbabab803 100644 --- a/BeWo/Services/BeWoWindowService.cs +++ b/BeWo/Services/BeWoWindowService.cs @@ -237,7 +237,8 @@ namespace BeWo.Services if (windowViewModel is DialogViewModel dialogViewModel) { - dialogViewModel.RequestCloseFinal += (s, e) => window.Close(); + dialogViewModel.Closing += (s, e) => window.Close(); + window.Closed += (s, e) => dialogViewModel.CloseFinalCommand.Execute(null); } if (options.ShowAsDialog) diff --git a/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml b/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml index deb694f71..b145aae5b 100644 --- a/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml +++ b/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml @@ -52,4 +52,129 @@ + + \ No newline at end of file diff --git a/BeWo/View/Controls/AI/AiChatButton.xaml.cs b/BeWo/View/Controls/AI/AiChatButton.xaml.cs index 72ad7c438..644ff35e0 100644 --- a/BeWo/View/Controls/AI/AiChatButton.xaml.cs +++ b/BeWo/View/Controls/AI/AiChatButton.xaml.cs @@ -67,12 +67,13 @@ namespace BeWo.View.Controls.AI { var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm); viewmodel.ItemAccepted += ItemAccepted; - viewmodel.RequestCloseFinal += (s, e) => viewmodel.ResetSelection(); + viewmodel.Closed += (s, e) => viewmodel.ResetSelection(); ViewModel.AllPromptsViewModel = viewmodel; var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true); viewmodel2.ItemAccepted += ItemAccepted; - popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.ResetSelection(); + popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.CloseFinalCommand.Execute(null); + viewmodel2.Closed += (s, e) => viewmodel2.ResetSelection(); var view2 = new AiPromptbausteinComplexSelectionFavoritenView(viewmodel2); viewmodel2.SelectedFolder = viewmodel2.Folders.VMList[0]; view2.Padding = new Thickness(3); diff --git a/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml b/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml index e2ab79dab..fb9e9d2be 100644 --- a/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml +++ b/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml @@ -414,16 +414,10 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - + + + + - - - - - - - + - - - - - - - - + + + + + + + - + Detail_Window_Closing(s, new CancelEventArgs()); + dialog.Closing += (s, ee) => Detail_Window_Closing(s, new CancelEventArgs()); BeWoApp.MainControl.WindowService.ShowGkvAbrechnungDetailWindow(dialog); } diff --git a/BeWo/View/Windows/AnimatedBeWoWindow.xaml b/BeWo/View/Windows/AnimatedBeWoWindow.xaml index 7e50c5a03..3966aea47 100644 --- a/BeWo/View/Windows/AnimatedBeWoWindow.xaml +++ b/BeWo/View/Windows/AnimatedBeWoWindow.xaml @@ -41,7 +41,7 @@ x:FieldModifier="public" MouseDoubleClick="RootGroupBox_OnMouseDoubleClick" MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown" - Style="{DynamicResource PopUpWindowStyle}"> + Style="{DynamicResource PopUpWindowStyle2}"> diff --git a/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs b/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs index a0b15e24c..bb9b5a419 100644 --- a/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs +++ b/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs @@ -57,7 +57,7 @@ namespace BeWo.View.Windows { InitializeComponent(); - CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => Close())); + //CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => Close())); if(ServiceFacade.IsWaiting()) StartWaiting(); @@ -169,7 +169,7 @@ namespace BeWo.View.Windows public void Window_Closed(object sender, EventArgs e) { - + } public void StartWaiting() diff --git a/BeWo/ViewModel/AiPromptbausteinFolderVM.cs b/BeWo/ViewModel/AiPromptbausteinFolderVM.cs index 8f2363deb..9fd3a4b53 100644 --- a/BeWo/ViewModel/AiPromptbausteinFolderVM.cs +++ b/BeWo/ViewModel/AiPromptbausteinFolderVM.cs @@ -245,7 +245,7 @@ namespace BeWo.ViewModel public AiPromptbausteinFolderVM Parent { get; set; } - public FontWeight FontWeight => !IsNew && Parent is null ? FontWeights.SemiBold : FontWeights.Medium; + public FontWeight FontWeight => !IsNew && (Parent is null || Parent.Parent is null) ? FontWeights.SemiBold : FontWeights.Medium; public bool HasSubFolders => SubFolders is object && SubFolders.Count > 0; public int TotalPromptCount diff --git a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs index 01916ca69..2aee26675 100644 --- a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs +++ b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs @@ -74,6 +74,8 @@ namespace BeWo.ViewModel.View.AI { Folders = new AiPromptbausteinFolderListVM(); } + + //Closing += (s, e) => ResetSelection(); } public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType) : this() { @@ -84,7 +86,7 @@ namespace BeWo.ViewModel.View.AI public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel, bool isFavorite = false, bool canOpen = true) : this(aiActionType) { LoadedActionType = aiActionType; - Folders = viewModel; + UpdateVMList(viewModel); IsFavorite = isFavorite; CanOpenContextMenu = canOpen; } @@ -154,6 +156,9 @@ namespace BeWo.ViewModel.View.AI public AiPromptbausteinFolderListVM Folders { get; private set; } public AiActionType LoadedActionType { get; set; } + public AiPromptbausteinFolderVM RootFolders => Folders.VMList[0]; + public AiPromptbausteinFolderVM FavoritenFolder => RootFolders.SubFolders.VMList[0]; + public bool HasFavoriten { get @@ -163,7 +168,7 @@ namespace BeWo.ViewModel.View.AI return true; #endif - return Folders.Count > 3 && (Folders.VMList[0].Prompts.Count > 0 || Folders.VMList[0].Routines.Count > 0); + return RootFolders.SubFolders.Count > 3 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0); } } @@ -177,8 +182,8 @@ namespace BeWo.ViewModel.View.AI // Favoriten-Popup: Favoriten (VMList[0]), sonst "Eigene" (VMList[1]) vorauswählen. var target = IsFavorite - ? (Folders.VMList.Count > 0 ? Folders.VMList[0] : null) - : (Folders.VMList.Count > 1 ? Folders.VMList[1] : null); + ? (RootFolders.SubFolders.Count > 0 ? RootFolders.SubFolders.VMList[0] : null) + : (RootFolders.SubFolders.Count > 1 ? RootFolders.SubFolders.VMList[1] : null); if (target != null) { @@ -220,17 +225,23 @@ namespace BeWo.ViewModel.View.AI FirePropertyChanged(nameof(Folders)); - if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5) + if (Folders.VMList.Count > 0 + && Folders.VMList[0].DataContract.Oid == -51 + && Folders.VMList[0].SubFolders.Count > 0 + && Folders.VMList[0].SubFolders.VMList[0].DataContract.Oid == -5) { - Favoriten = Folders.VMList[0]; + Favoriten = Folders.VMList[0].SubFolders.VMList[0]; if (IsFavorite) SelectedFolder = Favoriten; } - // "Eigene" (VMList[1]) im normalen Modus vorauswählen. - if (!IsFavorite && Folders.VMList.Count > 1) - Folders.VMList[1].IsSelected = true; + if (!IsFavorite && + Folders.VMList.Count > 0 + && Folders.VMList[0].DataContract.Oid == -51 + && Folders.VMList[0].SubFolders.Count > 1 + && Folders.VMList[0].SubFolders.VMList[1].DataContract.Oid == -1) + Folders.VMList[0].SubFolders.VMList[1].IsSelected = true; FirePropertyChanged(nameof(HasFavoriten)); } diff --git a/BeWo/ViewModel/View/DialogViewModel.cs b/BeWo/ViewModel/View/DialogViewModel.cs index 72736e271..fdb33a9a2 100644 --- a/BeWo/ViewModel/View/DialogViewModel.cs +++ b/BeWo/ViewModel/View/DialogViewModel.cs @@ -10,16 +10,31 @@ namespace BeWo.ViewModel.View { public class DialogViewModel : WindowViewModel { - public event EventHandler RequestCloseFinal; + public event EventHandler Closing; + public event EventHandler Closed; - public DialogViewModel() : base() + public DelegateCommand CloseCommand { get; set; } + public DelegateCommand CloseFinalCommand { get; set; } + + protected DialogViewModel() : base() { - + CloseCommand = new DelegateCommand(Close, canClose, false); + CloseFinalCommand = new DelegateCommand(CloseFinal, canClose, false); } protected virtual void Close() { - RequestCloseFinal?.Invoke(this, EventArgs.Empty); + Closing?.Invoke(this, EventArgs.Empty); + } + + protected virtual void CloseFinal() + { + Closed?.Invoke(this, EventArgs.Empty); + } + + protected virtual bool canClose() + { + return true; } } } diff --git a/Service/Plugins/AiPromptbausteineService.cs b/Service/Plugins/AiPromptbausteineService.cs index 2e8f4ae83..2e63a867d 100644 --- a/Service/Plugins/AiPromptbausteineService.cs +++ b/Service/Plugins/AiPromptbausteineService.cs @@ -72,6 +72,8 @@ namespace BeWo.Service.Plugins initOwnFolder(own_bib); + own_bib.CanEdit = false; + return own_bib; } From 6e5fa50871f4ef6d3f509ff9c77cfac3bbe45504 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 23 Jun 2026 16:43:11 +0200 Subject: [PATCH 3/5] Favoriten Order + Routine.!IsValid bearbeitbar --- .../AI/AiPromptbausteinLibraryControl.xaml | 154 +++++++++--------- BeWo/ViewModel/VMFactory.cs | 6 +- ...PromptbausteinComplexSelectionViewModel.cs | 14 +- .../AiPromptbausteinComplexTreeViewModel.cs | 19 +-- 4 files changed, 94 insertions(+), 99 deletions(-) diff --git a/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml b/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml index fb9e9d2be..38b8b42c1 100644 --- a/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml +++ b/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml @@ -186,8 +186,8 @@ - - + + @@ -238,25 +238,26 @@ Background="Transparent" ContextMenuOpening="ListBox_ContextMenuOpening" PreviewMouseDown="Grid_PreviewMouseDown_2"> - - - - - - - - - - - - - + + + + + + + + + + + + + - - + - - - - - - + + + + - - - - + - - - - - - - - + + + + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + + + + @@ -417,13 +419,13 @@ () + SubPrompts = new List(), + SubRoutines = new List() }; var fav_vm = new AiPromptbausteinFolderVM(favoriten); fav_vm.SubPrompts.VMList.Clear(); + fav_vm.SubRoutines.VMList.Clear(); - folders.VMList[0].SubFolders.VMList.Insert(0, fav_vm); + folders.VMList.Insert(0, fav_vm); findFavoriten(folders, fav_vm); } diff --git a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs index 2aee26675..07e15a504 100644 --- a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs +++ b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs @@ -156,8 +156,8 @@ namespace BeWo.ViewModel.View.AI public AiPromptbausteinFolderListVM Folders { get; private set; } public AiActionType LoadedActionType { get; set; } - public AiPromptbausteinFolderVM RootFolders => Folders.VMList[0]; - public AiPromptbausteinFolderVM FavoritenFolder => RootFolders.SubFolders.VMList[0]; + public AiPromptbausteinFolderVM FavoritenFolder => Folders.VMList[0]; + public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1]; public bool HasFavoriten { @@ -168,7 +168,7 @@ namespace BeWo.ViewModel.View.AI return true; #endif - return RootFolders.SubFolders.Count > 3 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0); + return Folders.Count > 1 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0); } } @@ -180,10 +180,8 @@ namespace BeWo.ViewModel.View.AI SelectedFolder = null; - // Favoriten-Popup: Favoriten (VMList[0]), sonst "Eigene" (VMList[1]) vorauswählen. - var target = IsFavorite - ? (RootFolders.SubFolders.Count > 0 ? RootFolders.SubFolders.VMList[0] : null) - : (RootFolders.SubFolders.Count > 1 ? RootFolders.SubFolders.VMList[1] : null); + // Favoriten-Popup: + var target = IsFavorite ? FavoritenFolder : RootFolders; if (target != null) { @@ -216,7 +214,7 @@ namespace BeWo.ViewModel.View.AI { VMFactory.CreateAiPromptbausteinFolderListVMAsync(AiActionType, UpdateVMList); - if(notify) + if (notify) VMListReloaded?.Invoke(this, EventArgs.Empty); } private void UpdateVMList(AiPromptbausteinFolderListVM new_list) diff --git a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs index 698ba7baa..8926281ad 100644 --- a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs +++ b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs @@ -29,7 +29,8 @@ namespace BeWo.ViewModel.View.Administration private AiActionType AiActionType { get; set; } public AiPromptbausteinFolderListVM Folders { get; set; } - public AiPromptbausteinFolderVM Favoriten { get; set; } + public AiPromptbausteinFolderVM Favoriten => Folders.VMList[0]; + public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1]; public AiPromptbausteinFolderVM CopiedFolder { get; set; } public AiPromptbausteinPromptVM CopiedPrompt { get; set; } @@ -186,19 +187,11 @@ namespace BeWo.ViewModel.View.Administration listvm => { Folders = listvm; - if (Folders.VMList.Count > 0 - && Folders.VMList[0].DataContract.Oid == -51 - && Folders.VMList[0].SubFolders.Count > 0 - && Folders.VMList[0].SubFolders.VMList[0].DataContract.Oid == -5) - { - Favoriten = Folders.VMList[0].SubFolders.VMList[0]; - } - if (Folders.VMList.Count > 0 - && Folders.VMList[0].DataContract.Oid == -51 - && Folders.VMList[0].SubFolders.Count > 1 - && Folders.VMList[0].SubFolders.VMList[1].DataContract.Oid == -1) - Folders.VMList[0].SubFolders.VMList[1].IsSelected = true; + if (RootFolders.SubFolders.VMList[0].DataContract.Oid == -1) + { + RootFolders.SubFolders.VMList[0].IsSelected = true; + } FirePropertyChanged(nameof(Folders)); }); From 89154c0223d5505bc458910ad21126b5536dbc20 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Wed, 24 Jun 2026 10:47:29 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Generischer=20AiSystemPromptBuilder=20->=20?= =?UTF-8?q?Mehr=20=C3=BCber=20SystmePrompt=20File=20steuerbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/ViewModel/View/DialogViewModel.cs | 5 - .../customFunctionPreSystemPrompt.txt | 15 +++ .../systemPrompts/customPreSystemPrompt.txt | 13 ++ Server/Components/AICore/AICore.csproj | 1 + .../AICore/Prompt/AiSystemPromptFactory.cs | 17 +-- .../AiConversationSystemPromptBuilder.cs | 115 ++++++++++-------- .../AiFunctionSystemPromptBuilder.cs | 78 ++++++------ .../AiGenericSystemPromptBuilder.cs | 57 +++++++++ .../SystemPrompts/BaseSystemPromptBuilder.cs | 46 ++++++- Service/Plugins/AiService2.cs | 2 +- .../Feature/AI/AiViewContextDC.cs | 3 + 11 files changed, 249 insertions(+), 103 deletions(-) create mode 100644 Server/Components/AICore/Prompt/SystemPrompts/AiGenericSystemPromptBuilder.cs diff --git a/BeWo/ViewModel/View/DialogViewModel.cs b/BeWo/ViewModel/View/DialogViewModel.cs index fdb33a9a2..c926c6d59 100644 --- a/BeWo/ViewModel/View/DialogViewModel.cs +++ b/BeWo/ViewModel/View/DialogViewModel.cs @@ -1,10 +1,5 @@ using DevExpress.Mvvm; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; namespace BeWo.ViewModel.View { diff --git a/Host/Config/ai/systemPrompts/customFunctionPreSystemPrompt.txt b/Host/Config/ai/systemPrompts/customFunctionPreSystemPrompt.txt index 8690091be..fb8d1a772 100644 --- a/Host/Config/ai/systemPrompts/customFunctionPreSystemPrompt.txt +++ b/Host/Config/ai/systemPrompts/customFunctionPreSystemPrompt.txt @@ -9,3 +9,18 @@ Du bist ein hilfreicher Dokumentations-Assistent, der ausschließlich auf die be - Antworte nur basierend auf dem Kontext. Wenn die Antwort nicht im Kontext zu finden ist, sage 'Ich weiß es nicht'. - Antworte nur mit Fakten und Daten aus dem Kontext. Unterlasse Spekulationen, Meinungen oder persönliche Erfahrungen. - Übersetzungen sind erlaubt. + + +--- + +### **Allgemein** +- Aktuelle Zeit: {AktuelleZeit} + +### **Ansicht** +- Ich befinde mich aktuell in der "{AktuellesModule}" meiner Anwendung. +- {FilterEinstellungen} + +### **Daten** +{DatenBlock} + +abs diff --git a/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt b/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt index b8e9cea0b..772818b6d 100644 --- a/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt +++ b/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt @@ -7,3 +7,16 @@ WICHTIG: - Falls die Daten nicht die benötigte Information enthalten, gib an, dass die Daten fehlen, anstatt zu raten. - KEINE Erklärungen, KEIN Fließtext, KEINE zusätzlichen Notizen! - Deine Antwort soll eine direkte und verständliche Antwort für den Nutzer sein. + + +--- + +### **Allgemein** +- Aktuelle Zeit: {AktuelleZeit} + +### **Ansicht** +- Ich befinde mich aktuell in der "{AktuellesModule}" meiner Anwendung. +- {FilterEinstellungen} + +### **Daten** +{DatenBlock} \ No newline at end of file diff --git a/Server/Components/AICore/AICore.csproj b/Server/Components/AICore/AICore.csproj index 99585ad6b..a6d1948fa 100644 --- a/Server/Components/AICore/AICore.csproj +++ b/Server/Components/AICore/AICore.csproj @@ -125,6 +125,7 @@ + diff --git a/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs b/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs index afd91dde5..e56613881 100644 --- a/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs +++ b/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs @@ -1,6 +1,7 @@ using AICore.Context.Summary; using AICore.Prompt.SystemPrompts; using BS.Shared; +using BS.Shared.DataContracts.Feature.AI; using BS.Shared.Exceptions; using System; using System.Collections.Generic; @@ -13,25 +14,27 @@ namespace AICore.Prompt { public class AiSystemPromptFactory { - public static string BuildContext(AiActionType actionType, string prompt_path, BaseContextSummary context, AiDataContextType context_type) + public static string BuildContext(AiActionType actionType, string prompt_path, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType context_type) { switch (actionType) { case AiActionType.ServiceRecord: break; case AiActionType.ServiceRecordConversation: - var factory = new AiConversationSystemPromptBuilder(prompt_path); - var prompt = factory.CreateSystemPrompt(actionType, context, context_type); - return prompt; case AiActionType.ServiceRecordDocumentation: - var factory2 = new AiFunctionSystemPromptBuilder(prompt_path); - var prompt2 = factory2.CreateServiceRecordDocumentationSystemPrompt(context); - return prompt2; + return BuildGenericContext(actionType, prompt_path, view_context, context, context_type); default: break; } throw BeWoNotImplementedException.CreateFromEnum(actionType); } + + public static string BuildGenericContext(AiActionType actionType, string prompt_path, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType context_type) + { + var factory = new AiGenericSystemPromptBuilder(prompt_path); + + return factory.CreateSystemPrompt(actionType, view_context, context, context_type); + } } } diff --git a/Server/Components/AICore/Prompt/SystemPrompts/AiConversationSystemPromptBuilder.cs b/Server/Components/AICore/Prompt/SystemPrompts/AiConversationSystemPromptBuilder.cs index a21fb8682..6674a3d2a 100644 --- a/Server/Components/AICore/Prompt/SystemPrompts/AiConversationSystemPromptBuilder.cs +++ b/Server/Components/AICore/Prompt/SystemPrompts/AiConversationSystemPromptBuilder.cs @@ -2,6 +2,7 @@ using AICore.Context.SummaryParser; using BS.Shared; using BS.Shared.Core; +using BS.Shared.DataContracts.Feature.AI; using BS.Shared.Exceptions; using BS.Shared.Translation; using System; @@ -14,66 +15,74 @@ using System.Text.Json; namespace AICore.Prompt.SystemPrompts { - internal class AiConversationSystemPromptBuilder : BaseSystemPromptBuilder - { - public AiConversationSystemPromptBuilder(string prompt_path) : base(prompt_path) { + //internal class AiConversationSystemPromptBuilder : BaseSystemPromptBuilder + //{ + // public AiConversationSystemPromptBuilder(string prompt_path) : base(prompt_path) { - } + // } - public string CreateSystemPrompt(AiActionType actionType, BaseContextSummary context, AiDataContextType aiDataContextType) - { - var sb = new StringBuilder(); + // public string CreateSystemPrompt(AiActionType actionType, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType aiDataContextType) + // { + // var currentDateTime = DateTime.Now; + // var moduleName = Translations[actionType]; + // var filter = view_context.Filter is string filter_str + // ? $"Es ist folgender Filter gesetzt: {filter_str}" + // : "Es ist kein Filter gesetzt."; - sb.AppendLine(getCustomSystemPrompt()); - sb.AppendLine(); - sb.AppendLine(); - sb.AppendLine("---"); - sb.AppendLine(); - sb.AppendLine("### **Allgemein**"); - sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}"); - sb.AppendLine(); - sb.AppendLine("### **Ansicht**"); - sb.AppendLine($"- Ich befinde mich aktuell in der \"{Translations[actionType]}\" meiner Anwendung."); - sb.AppendLine($"- Es ist kein Filter gesetzt."); - sb.AppendLine(); - sb.AppendLine("### **Daten**"); + // var context = - if (context?.Context is null) - { - sb.AppendLine("Dir wurden keine Daten bereitgestellt."); - } - else - { - sb.AppendLine("Du erhälst folgende Daten:"); + // var sb = new StringBuilder(); - var parser = GetParser(aiDataContextType); - var parsed = parser.Parse(actionType, context); + // sb.AppendLine(getCustomSystemPrompt()); + // sb.AppendLine(); + // sb.AppendLine(); + // sb.AppendLine("---"); + // sb.AppendLine(); + // sb.AppendLine("### **Allgemein**"); + // sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}"); + // sb.AppendLine(); + // sb.AppendLine("### **Ansicht**"); + // sb.AppendLine($"- Ich befinde mich aktuell in der \"{Translations[actionType]}\" meiner Anwendung."); + + // sb.AppendLine(); + // sb.AppendLine("### **Daten**"); - sb.AppendLine(parsed); - } + // if (context?.Context is null) + // { + // sb.AppendLine("Dir wurden keine Daten bereitgestellt."); + // } + // else + // { + // sb.AppendLine("Du erhälst folgende Daten:"); - return sb.ToString(); - } + // var parser = GetParser(aiDataContextType); + // var parsed = parser.Parse(actionType, context); - private BaseContextSummaryParser GetParser(AiDataContextType aiDataContextType) - { - switch (aiDataContextType) - { - case AiDataContextType.json: - return new JsonContextSummaryParser(); - case AiDataContextType.csv: - return new CsvContextSummaryParser(); - case AiDataContextType.tsv: - return new CsvContextSummaryParser("\t"); - case AiDataContextType.csv2: - return new CsvContextSummaryParser(";", true); - case AiDataContextType.tsv2: - return new CsvContextSummaryParser("\t", true); - default: - break; - } + // sb.AppendLine(parsed); + // } - throw BeWoNotImplementedException.CreateFromEnum(aiDataContextType); - } - } + // return sb.ToString(); + // } + + // private BaseContextSummaryParser GetParser(AiDataContextType aiDataContextType) + // { + // switch (aiDataContextType) + // { + // case AiDataContextType.json: + // return new JsonContextSummaryParser(); + // case AiDataContextType.csv: + // return new CsvContextSummaryParser(); + // case AiDataContextType.tsv: + // return new CsvContextSummaryParser("\t"); + // case AiDataContextType.csv2: + // return new CsvContextSummaryParser(";", true); + // case AiDataContextType.tsv2: + // return new CsvContextSummaryParser("\t", true); + // default: + // break; + // } + + // throw BeWoNotImplementedException.CreateFromEnum(aiDataContextType); + // } + //} } \ No newline at end of file diff --git a/Server/Components/AICore/Prompt/SystemPrompts/AiFunctionSystemPromptBuilder.cs b/Server/Components/AICore/Prompt/SystemPrompts/AiFunctionSystemPromptBuilder.cs index 6ffb6a3c9..5b1c7dbec 100644 --- a/Server/Components/AICore/Prompt/SystemPrompts/AiFunctionSystemPromptBuilder.cs +++ b/Server/Components/AICore/Prompt/SystemPrompts/AiFunctionSystemPromptBuilder.cs @@ -3,6 +3,7 @@ using AICore.Context.Summary.Function; using AICore.Context.SummaryParser; using BS.Shared; using BS.Shared.Core; +using BS.Shared.DataContracts.Feature.AI; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -13,46 +14,53 @@ using System.Threading.Tasks; namespace AICore.Prompt.SystemPrompts { - internal class AiFunctionSystemPromptBuilder : BaseSystemPromptBuilder - { - public AiFunctionSystemPromptBuilder(string prompt_path) : base(prompt_path) - { + //internal class AiFunctionSystemPromptBuilder : BaseSystemPromptBuilder + //{ + // public AiFunctionSystemPromptBuilder(string prompt_path) : base(prompt_path) + // { - } + // } - public string CreateServiceRecordDocumentationSystemPrompt(BaseContextSummary context) - { - var sb = new StringBuilder(); + // public string CreateServiceRecordDocumentationSystemPrompt(AiViewContextDC view_context, BaseContextSummary context) + // { + // var sb = new StringBuilder(); - sb.AppendLine(getCustomSystemPrompt()); - sb.AppendLine(); - sb.AppendLine(); - sb.AppendLine("---"); - sb.AppendLine(); - sb.AppendLine("### **Allgemein**"); - sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}"); - sb.AppendLine(); - sb.AppendLine("### **Ansicht**"); - sb.AppendLine($"- Ich befinde mich aktuell in der \"Zeiterfassung\" meiner Anwendung."); - sb.AppendLine($"- Es ist kein Filter gesetzt."); - sb.AppendLine(); - sb.AppendLine("### **Daten**"); + // sb.AppendLine(getCustomSystemPrompt()); + // sb.AppendLine(); + // sb.AppendLine(); + // sb.AppendLine("---"); + // sb.AppendLine(); + // sb.AppendLine("### **Allgemein**"); + // sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}"); + // sb.AppendLine(); + // sb.AppendLine("### **Ansicht**"); + // sb.AppendLine($"- Ich befinde mich aktuell in der \"Zeiterfassung\" meiner Anwendung."); + // if(view_context.Filter is string filter_str) + // { + // sb.AppendLine($"- Es ist folgender Filter gesetzt: {filter_str}"); + // } + // else + // { + // sb.AppendLine($"- Es ist kein Filter gesetzt."); + // } + // sb.AppendLine(); + // sb.AppendLine("### **Daten**"); - if (context?.Context is null) - { - sb.AppendLine("Dir wurden keine Daten bereitgestellt."); - } - else - { - sb.AppendLine("Du erhälst folgende Daten:"); + // if (context?.Context is null) + // { + // sb.AppendLine("Dir wurden keine Daten bereitgestellt."); + // } + // else + // { + // sb.AppendLine("Du erhälst folgende Daten:"); - var parser = new CsvContextSummaryParser(); - var parsed = parser.Parse(AiActionType.ServiceRecordDocumentation, context); + // var parser = new CsvContextSummaryParser(); + // var parsed = parser.Parse(AiActionType.ServiceRecordDocumentation, context); - sb.AppendLine(parsed); - } + // sb.AppendLine(parsed); + // } - return sb.ToString(); - } - } + // return sb.ToString(); + // } + //} } \ No newline at end of file diff --git a/Server/Components/AICore/Prompt/SystemPrompts/AiGenericSystemPromptBuilder.cs b/Server/Components/AICore/Prompt/SystemPrompts/AiGenericSystemPromptBuilder.cs new file mode 100644 index 000000000..33d88f498 --- /dev/null +++ b/Server/Components/AICore/Prompt/SystemPrompts/AiGenericSystemPromptBuilder.cs @@ -0,0 +1,57 @@ +using AICore.Context.Summary; +using AICore.Context.SummaryParser; +using BS.Shared.DataContracts.Feature.AI; +using BS.Shared.Exceptions; +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Runtime.Remoting.Messaging; + +namespace AICore.Prompt.SystemPrompts +{ + internal class AiGenericSystemPromptBuilder : BaseSystemPromptBuilder + { + public AiGenericSystemPromptBuilder(string prompt_path) : base(prompt_path) + { + + } + + public string CreateSystemPrompt(AiActionType actionType, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType aiDataContextType) + { + var replace_dict = new Dictionary() + { + {"{AktuelleZeit}", DateTime.Now.ToString() }, + {"{AktuellesModule}", Translations[actionType]}, + {"{FilterEinstellungen}", getFilterString(view_context.Filter)}, + {"{DatenBlock}", getContextBlock(actionType, context, aiDataContextType)} + }; + + return createSystemPrompt(replace_dict); + } + + private string getFilterString(object filter) + { + if (filter is null) + return "Es ist kein Filter gesetzt."; + + return $"Es ist folgender Filter gesetzt: {filter}"; + } + + private string getContextBlock(AiActionType actionType, BaseContextSummary context, AiDataContextType aiDataContextType) + { + if (context is null) + { + return "Dir wurden keine Daten bereitgestellt."; + } + + var parser = getParser(aiDataContextType); + var parsed = parser.Parse(actionType, context); + + return $"Du erhälst folgende Daten: {Environment.NewLine}" + + parsed; + } + } +} diff --git a/Server/Components/AICore/Prompt/SystemPrompts/BaseSystemPromptBuilder.cs b/Server/Components/AICore/Prompt/SystemPrompts/BaseSystemPromptBuilder.cs index 759459afe..9768fcf70 100644 --- a/Server/Components/AICore/Prompt/SystemPrompts/BaseSystemPromptBuilder.cs +++ b/Server/Components/AICore/Prompt/SystemPrompts/BaseSystemPromptBuilder.cs @@ -1,4 +1,8 @@ -using BS.Shared; +using AICore.Context.Summary; +using AICore.Context.SummaryParser; +using BS.Shared; +using BS.Shared.DataContracts.Feature.AI; +using BS.Shared.Exceptions; using System; using System.Collections.Generic; using System.IO; @@ -24,7 +28,45 @@ namespace AICore.Prompt.SystemPrompts Path = path; } - protected string getCustomSystemPrompt() + protected string createSystemPrompt(Dictionary replace_dict) + { + var sb = new StringBuilder(); + + sb.AppendLine(getCustomSystemPrompt()); + + foreach (var kvp in replace_dict) + { + var key = kvp.Key; + var value = kvp.Value; + + sb.Replace(key, value); + } + + return sb.ToString(); + } + + protected BaseContextSummaryParser getParser(AiDataContextType aiDataContextType) + { + switch (aiDataContextType) + { + case AiDataContextType.json: + return new JsonContextSummaryParser(); + case AiDataContextType.csv: + return new CsvContextSummaryParser(); + case AiDataContextType.tsv: + return new CsvContextSummaryParser("\t"); + case AiDataContextType.csv2: + return new CsvContextSummaryParser(";", true); + case AiDataContextType.tsv2: + return new CsvContextSummaryParser("\t", true); + default: + break; + } + + throw BeWoNotImplementedException.CreateFromEnum(aiDataContextType); + } + + private string getCustomSystemPrompt() { var path = Path; return File.ReadAllText(path); diff --git a/Service/Plugins/AiService2.cs b/Service/Plugins/AiService2.cs index b79142018..316f4f77c 100644 --- a/Service/Plugins/AiService2.cs +++ b/Service/Plugins/AiService2.cs @@ -391,7 +391,7 @@ namespace BeWo.Service.Plugins var context_loaded = AiContextLoader.LoadContext(actionType, view_context, prompt?.SamplesCount); var configPath = getPromptPath(actionType); - var system_prompt = AiSystemPromptFactory.BuildContext(actionType, configPath, context_loaded, context_Type); + var system_prompt = AiSystemPromptFactory.BuildContext(actionType, configPath, view_context, context_loaded, context_Type); var msg = new AiConversationMessage(); msg.Message = system_prompt; diff --git a/Shared/DataContracts/Feature/AI/AiViewContextDC.cs b/Shared/DataContracts/Feature/AI/AiViewContextDC.cs index f5a23237e..70b5e18f3 100644 --- a/Shared/DataContracts/Feature/AI/AiViewContextDC.cs +++ b/Shared/DataContracts/Feature/AI/AiViewContextDC.cs @@ -16,6 +16,9 @@ namespace BS.Shared.DataContracts.Feature.AI [DataMember] public object Secondary { get; set; } + [DataMember] + public object Filter { get; set; } + [DataMember] public Dictionary References { get; set; } } From 052040720e1b80641089fc3aaa27c88fe6229cc3 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Wed, 24 Jun 2026 11:19:30 +0200 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20Fenster=20schlie=C3=9Ft=20nicht=20ri?= =?UTF-8?q?chtig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/GkvAbrechnungDetailControl.xaml | 4 +-- .../Accounting/GkvAbrechnungOverview.xaml.cs | 15 +++----- BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs | 34 ++----------------- 3 files changed, 10 insertions(+), 43 deletions(-) diff --git a/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml b/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml index 0f4efa564..40bf0e0af 100644 --- a/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml +++ b/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml @@ -58,7 +58,7 @@ Grid.Column="2" IsEnabled="False" Style="{StaticResource TextEditNumber}" - Text="{Binding Oid}" /> + Text="{Binding Oid, Mode=OneWay}" />