diff --git a/BeWo/Services/BeWoWindowService.cs b/BeWo/Services/BeWoWindowService.cs
index fbabab803..39ae5d51f 100644
--- a/BeWo/Services/BeWoWindowService.cs
+++ b/BeWo/Services/BeWoWindowService.cs
@@ -237,8 +237,7 @@ namespace BeWo.Services
if (windowViewModel is DialogViewModel dialogViewModel)
{
- dialogViewModel.Closing += (s, e) => window.Close();
- window.Closed += (s, e) => dialogViewModel.CloseFinalCommand.Execute(null);
+ dialogViewModel.RequestCloseFinal += (s, e) => window.Close();
}
if (options.ShowAsDialog)
diff --git a/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml b/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml
index b145aae5b..deb694f71 100644
--- a/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml
+++ b/BeWo/Styles/ControlStyles/GroupBoxStyles.xaml
@@ -52,129 +52,4 @@
-
-
\ 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 644ff35e0..72ad7c438 100644
--- a/BeWo/View/Controls/AI/AiChatButton.xaml.cs
+++ b/BeWo/View/Controls/AI/AiChatButton.xaml.cs
@@ -67,13 +67,12 @@ namespace BeWo.View.Controls.AI
{
var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
viewmodel.ItemAccepted += ItemAccepted;
- viewmodel.Closed += (s, e) => viewmodel.ResetSelection();
+ viewmodel.RequestCloseFinal += (s, e) => viewmodel.ResetSelection();
ViewModel.AllPromptsViewModel = viewmodel;
var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true);
viewmodel2.ItemAccepted += ItemAccepted;
- popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.CloseFinalCommand.Execute(null);
- viewmodel2.Closed += (s, e) => viewmodel2.ResetSelection();
+ popup_promptbaustein_favoriten.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 38b8b42c1..e2ab79dab 100644
--- a/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml
+++ b/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml
@@ -186,8 +186,8 @@
-
-
+
+
@@ -238,26 +238,25 @@
Background="Transparent"
ContextMenuOpening="ListBox_ContextMenuOpening"
PreviewMouseDown="Grid_PreviewMouseDown_2">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -416,16 +414,22 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+ Text="{Binding Oid}" />
diff --git a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
index f6bdf7844..c3fd6ea87 100644
--- a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
+++ b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
@@ -230,19 +230,24 @@ namespace BeWo.View.Detail.Accounting
var dialog = new GkvAbrechnungDialogViewModel(vm);
- dialog.Closing += (s, ee) => Detail_Window_Closing(s, new CancelEventArgs());
+ dialog.RequestCloseFinal += (s, ee) => Detail_Window_Closing(s, new CancelEventArgs());
BeWoApp.MainControl.WindowService.ShowGkvAbrechnungDetailWindow(dialog);
}
private void Detail_Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
- var dialog = sender as GkvAbrechnungDialogViewModel;
- var vm = dialog.Abrechnung;
+ var bewo_window = sender as AnimatedBeWoWindow;
+ var detail_control = bewo_window.GroupBoxContent as GkvAbrechnungDetailControl;
+
+ var vm = detail_control.DataContext as GkvAbrechnungLightVM;
vm.CheckAllInvoiceBases();
- //vm.Notice = textbox_text;
+ var checkbox_checked = detail_control.Checkbox_Bezahlt.IsChecked;
+ var textbox_text = detail_control.txt_Notice.Text;
+
+ vm.Notice = textbox_text;
if (vm.IsDirty)
{
diff --git a/BeWo/View/Windows/AnimatedBeWoWindow.xaml b/BeWo/View/Windows/AnimatedBeWoWindow.xaml
index 3966aea47..7e50c5a03 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 PopUpWindowStyle2}">
+ Style="{DynamicResource PopUpWindowStyle}">
diff --git a/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs b/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs
index bb9b5a419..a0b15e24c 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 9fd3a4b53..8f2363deb 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 || Parent.Parent is null) ? FontWeights.SemiBold : FontWeights.Medium;
+ public FontWeight FontWeight => !IsNew && Parent is null ? FontWeights.SemiBold : FontWeights.Medium;
public bool HasSubFolders => SubFolders is object && SubFolders.Count > 0;
public int TotalPromptCount
diff --git a/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs b/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs
index a182d933d..5f07d28bc 100644
--- a/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs
+++ b/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs
@@ -26,6 +26,8 @@ namespace BeWo.ViewModel.Light
public static string PropertyName_ErstelltAm = "ErstelltAm";
+ private long _Oid;
+ private long _Version;
private string _Notice;
private long _OrganisationOid;
@@ -116,11 +118,31 @@ namespace BeWo.ViewModel.Light
public DateTime ErstelltAmDate => ErstelltAm.Date;
public long Oid
{
- get => DataContract.Oid;
+ get { return this._Oid; }
+
+ set
+ {
+ if (this.AreDifferent(this._Oid, value))
+ {
+ this._Oid = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Oid, value), nameof(Oid));
+ this.FirePropertyChanged(nameof(Oid));
+ }
+ }
}
public long Version
{
- get => DataContract.Version;
+ get { return this._Version; }
+
+ set
+ {
+ if (this.AreDifferent(this._Version, value))
+ {
+ this._Version = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Version, value), nameof(Version));
+ this.FirePropertyChanged(nameof(Version));
+ }
+ }
}
public string Notice
{
@@ -330,7 +352,7 @@ namespace BeWo.ViewModel.Light
public override void UpdateByDataContract(GkvAbrechnungLightDC pDataContract)
{
- DataContract = pDataContract;
+ Version = pDataContract.Version;
Notice = pDataContract.Notice;
@@ -351,6 +373,9 @@ namespace BeWo.ViewModel.Light
_ErstelltAm = pDataContract.ErstelltAm;
+ _Oid = pDataContract.Oid;
+ _Version = pDataContract.Version;
+
_Notice = pDataContract.Notice;
_Betrag = pDataContract.Betrag;
@@ -377,6 +402,8 @@ namespace BeWo.ViewModel.Light
}
protected override GkvAbrechnungLightDC MapToDataContract(GkvAbrechnungLightDC pDataContract, bool doCommit)
{
+ pDataContract.Version = _Version;
+
pDataContract.Notice = _Notice;
pDataContract.Betrag = _Betrag;
pDataContract.Bezahlt = _Bezahlt;
@@ -394,6 +421,7 @@ namespace BeWo.ViewModel.Light
return;
}
+ Version = dc.Version;
Protokolle = dc.Protokolle.ToList();
IsReady2Send = dc.IsReady2Send;
diff --git a/BeWo/ViewModel/VMFactory.cs b/BeWo/ViewModel/VMFactory.cs
index 4509e3c28..82e025693 100644
--- a/BeWo/ViewModel/VMFactory.cs
+++ b/BeWo/ViewModel/VMFactory.cs
@@ -970,13 +970,11 @@ namespace BeWo.ViewModel
Oid = -5,
Title = "Favoriten",
Description = "Eigene Favoriten",
- SubPrompts = new List(),
- SubRoutines = new List()
+ SubPrompts = new List()
};
var fav_vm = new AiPromptbausteinFolderVM(favoriten);
fav_vm.SubPrompts.VMList.Clear();
- fav_vm.SubRoutines.VMList.Clear();
folders.VMList.Insert(0, fav_vm);
diff --git a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs
index 07e15a504..01916ca69 100644
--- a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs
+++ b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs
@@ -74,8 +74,6 @@ namespace BeWo.ViewModel.View.AI
{
Folders = new AiPromptbausteinFolderListVM();
}
-
- //Closing += (s, e) => ResetSelection();
}
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType) : this()
{
@@ -86,7 +84,7 @@ namespace BeWo.ViewModel.View.AI
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel, bool isFavorite = false, bool canOpen = true) : this(aiActionType)
{
LoadedActionType = aiActionType;
- UpdateVMList(viewModel);
+ Folders = viewModel;
IsFavorite = isFavorite;
CanOpenContextMenu = canOpen;
}
@@ -156,9 +154,6 @@ namespace BeWo.ViewModel.View.AI
public AiPromptbausteinFolderListVM Folders { get; private set; }
public AiActionType LoadedActionType { get; set; }
- public AiPromptbausteinFolderVM FavoritenFolder => Folders.VMList[0];
- public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1];
-
public bool HasFavoriten
{
get
@@ -168,7 +163,7 @@ namespace BeWo.ViewModel.View.AI
return true;
#endif
- return Folders.Count > 1 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0);
+ return Folders.Count > 3 && (Folders.VMList[0].Prompts.Count > 0 || Folders.VMList[0].Routines.Count > 0);
}
}
@@ -180,8 +175,10 @@ namespace BeWo.ViewModel.View.AI
SelectedFolder = null;
- // Favoriten-Popup:
- var target = IsFavorite ? FavoritenFolder : RootFolders;
+ // 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);
if (target != null)
{
@@ -214,7 +211,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)
@@ -223,23 +220,17 @@ namespace BeWo.ViewModel.View.AI
FirePropertyChanged(nameof(Folders));
- 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)
+ if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5)
{
- Favoriten = Folders.VMList[0].SubFolders.VMList[0];
+ Favoriten = Folders.VMList[0];
if (IsFavorite)
SelectedFolder = Favoriten;
}
- 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;
+ // "Eigene" (VMList[1]) im normalen Modus vorauswählen.
+ if (!IsFavorite && Folders.VMList.Count > 1)
+ Folders.VMList[1].IsSelected = true;
FirePropertyChanged(nameof(HasFavoriten));
}
diff --git a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs
index 8926281ad..b9fa0643d 100644
--- a/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs
+++ b/BeWo/ViewModel/View/Administration/AiPromptbausteinComplexTreeViewModel.cs
@@ -29,8 +29,7 @@ namespace BeWo.ViewModel.View.Administration
private AiActionType AiActionType { get; set; }
public AiPromptbausteinFolderListVM Folders { get; set; }
- public AiPromptbausteinFolderVM Favoriten => Folders.VMList[0];
- public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1];
+ public AiPromptbausteinFolderVM Favoriten { get; set; }
public AiPromptbausteinFolderVM CopiedFolder { get; set; }
public AiPromptbausteinPromptVM CopiedPrompt { get; set; }
@@ -82,8 +81,7 @@ namespace BeWo.ViewModel.View.Administration
public AbstractBaseVM SelectedItem
{
get => _SelectedItem;
- set
- {
+ set {
var success = SetProperty(ref _SelectedItem, value, nameof(SelectedItem));
if (!success)
@@ -171,7 +169,7 @@ namespace BeWo.ViewModel.View.Administration
OpenAddRoutineDialogCommand.RaiseCanExecuteChanged();
OpenEditRoutineDialogCommand.RaiseCanExecuteChanged();
DeleteRoutineCommand.RaiseCanExecuteChanged();
- ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged();
+ ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged();
}
public void UpdateItemCommands()
{
@@ -187,12 +185,14 @@ namespace BeWo.ViewModel.View.Administration
listvm =>
{
Folders = listvm;
-
- if (RootFolders.SubFolders.VMList[0].DataContract.Oid == -1)
+ if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5)
{
- RootFolders.SubFolders.VMList[0].IsSelected = true;
+ Favoriten = Folders.VMList[0];
}
+ if (Folders.VMList.Count > 1)
+ Folders.VMList[1].IsSelected = true;
+
FirePropertyChanged(nameof(Folders));
});
}
diff --git a/BeWo/ViewModel/View/DialogViewModel.cs b/BeWo/ViewModel/View/DialogViewModel.cs
index c926c6d59..72736e271 100644
--- a/BeWo/ViewModel/View/DialogViewModel.cs
+++ b/BeWo/ViewModel/View/DialogViewModel.cs
@@ -1,35 +1,25 @@
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
{
public class DialogViewModel : WindowViewModel
{
- public event EventHandler Closing;
- public event EventHandler Closed;
+ public event EventHandler RequestCloseFinal;
- public DelegateCommand CloseCommand { get; set; }
- public DelegateCommand CloseFinalCommand { get; set; }
-
- protected DialogViewModel() : base()
+ public DialogViewModel() : base()
{
- CloseCommand = new DelegateCommand(Close, canClose, false);
- CloseFinalCommand = new DelegateCommand(CloseFinal, canClose, false);
+
}
protected virtual void Close()
{
- Closing?.Invoke(this, EventArgs.Empty);
- }
-
- protected virtual void CloseFinal()
- {
- Closed?.Invoke(this, EventArgs.Empty);
- }
-
- protected virtual bool canClose()
- {
- return true;
+ RequestCloseFinal?.Invoke(this, EventArgs.Empty);
}
}
}
diff --git a/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt b/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt
index 772818b6d..b8e9cea0b 100644
--- a/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt
+++ b/Host/Config/ai/systemPrompts/customPreSystemPrompt.txt
@@ -7,16 +7,3 @@ 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 a6d1948fa..99585ad6b 100644
--- a/Server/Components/AICore/AICore.csproj
+++ b/Server/Components/AICore/AICore.csproj
@@ -125,7 +125,6 @@
-
diff --git a/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs b/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs
index e56613881..afd91dde5 100644
--- a/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs
+++ b/Server/Components/AICore/Prompt/AiSystemPromptFactory.cs
@@ -1,7 +1,6 @@
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;
@@ -14,27 +13,25 @@ namespace AICore.Prompt
{
public class AiSystemPromptFactory
{
- public static string BuildContext(AiActionType actionType, string prompt_path, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType context_type)
+ public static string BuildContext(AiActionType actionType, string prompt_path, 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:
- return BuildGenericContext(actionType, prompt_path, view_context, context, context_type);
+ var factory2 = new AiFunctionSystemPromptBuilder(prompt_path);
+ var prompt2 = factory2.CreateServiceRecordDocumentationSystemPrompt(context);
+ return prompt2;
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 6674a3d2a..a21fb8682 100644
--- a/Server/Components/AICore/Prompt/SystemPrompts/AiConversationSystemPromptBuilder.cs
+++ b/Server/Components/AICore/Prompt/SystemPrompts/AiConversationSystemPromptBuilder.cs
@@ -2,7 +2,6 @@
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;
@@ -15,74 +14,66 @@ 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, 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.";
+ public string CreateSystemPrompt(AiActionType actionType, BaseContextSummary context, AiDataContextType aiDataContextType)
+ {
+ var sb = new StringBuilder();
- // var 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($"- Es ist kein Filter gesetzt.");
+ sb.AppendLine();
+ sb.AppendLine("### **Daten**");
- // var sb = new StringBuilder();
+ if (context?.Context is null)
+ {
+ sb.AppendLine("Dir wurden keine Daten bereitgestellt.");
+ }
+ else
+ {
+ sb.AppendLine("Du erhälst folgende 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 \"{Translations[actionType]}\" meiner Anwendung.");
-
- // sb.AppendLine();
- // sb.AppendLine("### **Daten**");
+ var parser = GetParser(aiDataContextType);
+ var parsed = parser.Parse(actionType, context);
- // if (context?.Context is null)
- // {
- // sb.AppendLine("Dir wurden keine Daten bereitgestellt.");
- // }
- // else
- // {
- // sb.AppendLine("Du erhälst folgende Daten:");
+ sb.AppendLine(parsed);
+ }
- // var parser = GetParser(aiDataContextType);
- // var parsed = parser.Parse(actionType, context);
+ return sb.ToString();
+ }
- // sb.AppendLine(parsed);
- // }
+ 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;
+ }
- // 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);
- // }
- //}
+ 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 5b1c7dbec..6ffb6a3c9 100644
--- a/Server/Components/AICore/Prompt/SystemPrompts/AiFunctionSystemPromptBuilder.cs
+++ b/Server/Components/AICore/Prompt/SystemPrompts/AiFunctionSystemPromptBuilder.cs
@@ -3,7 +3,6 @@ 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;
@@ -14,53 +13,46 @@ 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(AiViewContextDC view_context, BaseContextSummary context)
- // {
- // var sb = new StringBuilder();
+ public string CreateServiceRecordDocumentationSystemPrompt(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.");
- // 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**");
+ 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**");
- // 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
deleted file mode 100644
index 33d88f498..000000000
--- a/Server/Components/AICore/Prompt/SystemPrompts/AiGenericSystemPromptBuilder.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-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 9768fcf70..759459afe 100644
--- a/Server/Components/AICore/Prompt/SystemPrompts/BaseSystemPromptBuilder.cs
+++ b/Server/Components/AICore/Prompt/SystemPrompts/BaseSystemPromptBuilder.cs
@@ -1,8 +1,4 @@
-using AICore.Context.Summary;
-using AICore.Context.SummaryParser;
-using BS.Shared;
-using BS.Shared.DataContracts.Feature.AI;
-using BS.Shared.Exceptions;
+using BS.Shared;
using System;
using System.Collections.Generic;
using System.IO;
@@ -28,45 +24,7 @@ namespace AICore.Prompt.SystemPrompts
Path = path;
}
- 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()
+ protected string getCustomSystemPrompt()
{
var path = Path;
return File.ReadAllText(path);
diff --git a/Service/Plugins/AiPromptbausteineService.cs b/Service/Plugins/AiPromptbausteineService.cs
index 2e63a867d..de4cc5e66 100644
--- a/Service/Plugins/AiPromptbausteineService.cs
+++ b/Service/Plugins/AiPromptbausteineService.cs
@@ -29,27 +29,17 @@ 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);
- bib.SubFolders.Add(own_bib);
- bib.SubFolders.Add(public_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
+ own_bib, public_bib
};
+ if(ownsoft_bib is object)
+ result.Add(ownsoft_bib);
+
return result;
}
@@ -72,8 +62,6 @@ namespace BeWo.Service.Plugins
initOwnFolder(own_bib);
- own_bib.CanEdit = false;
-
return own_bib;
}
diff --git a/Service/Plugins/AiService2.cs b/Service/Plugins/AiService2.cs
index c0fa9e329..facb4ecd1 100644
--- a/Service/Plugins/AiService2.cs
+++ b/Service/Plugins/AiService2.cs
@@ -397,7 +397,7 @@ namespace BeWo.Service.Plugins
var context_loaded = AiContextLoader.LoadContext(actionType, view_context, sampleCount);
var configPath = getPromptPath(actionType);
- var system_prompt = AiSystemPromptFactory.BuildContext(actionType, configPath, view_context, context_loaded, context_Type);
+ var system_prompt = AiSystemPromptFactory.BuildContext(actionType, configPath, context_loaded, context_Type);
var msg = new AiConversationMessage();
msg.Message = system_prompt;
diff --git a/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs b/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs
index b673467cb..9fd31b498 100644
--- a/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs
+++ b/Shared/DataContracts/Feature/AI/AiPromptbausteinFolderDC.cs
@@ -50,72 +50,112 @@ namespace BS.Shared.DataContracts.Feature.AI
};
}
- public static AiPromptbausteinFolderDC CreateRootBibNode(AiActionType aiActionType)
- {
- var title = AiPromptbausteineTexts.RootBibNodeTitle;
- var description = AiPromptbausteineTexts.RootBibNodeDescription;
-
- var node = CreateNode(aiActionType, -51, title, description, null);
-
- return node;
- }
-
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;
+ 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,
+ };
}
+ //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 CreatePublicBibNode(AiActionType aiActionType)
{
- var title = AiPromptbausteineTexts.PublicBibNodeTitle;
- var description = AiPromptbausteineTexts.PublicBibNodeDescription;
-
- var node = CreateNode(aiActionType, -3, title, description, null);
-
- return node;
+ 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
+ };
}
public static AiPromptbausteinFolderDC CreatePublicSharedBibNode(AiActionType aiActionType, string display)
{
- 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;
+ 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
+ };
}
public static AiPromptbausteinFolderDC CreateOwnsoftBibNode(AiActionType aiActionType)
{
- var title = AiPromptbausteineTexts.OwnsoftBibNodeTitle;
- var description = AiPromptbausteineTexts.OwnsoftBibNodeDescription;
-
- var node = CreateNode(aiActionType, -4, title, description, null);
-
- return node;
+ 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
+ };
}
public static AiPromptbausteinFolderDC CreateExampleNode(AiActionType aiActionType)
{
- var node = CreateNode(aiActionType, -100, "Beispiel Ordner", "Beispielbeschreibung", null);
-
- node.CanAddFolder = true;
- node.CanAddPrompt = true;
- node.CanAddRoutine = true;
- node.CanEdit = true;
-
- return node;
+ 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
+ };
}
public static AiPromptbausteinPromptDC CreateExamplePrompt(AiActionType aiActionType)
@@ -130,26 +170,5 @@ 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/DataContracts/Feature/AI/AiViewContextDC.cs b/Shared/DataContracts/Feature/AI/AiViewContextDC.cs
index 70b5e18f3..f5a23237e 100644
--- a/Shared/DataContracts/Feature/AI/AiViewContextDC.cs
+++ b/Shared/DataContracts/Feature/AI/AiViewContextDC.cs
@@ -16,9 +16,6 @@ namespace BS.Shared.DataContracts.Feature.AI
[DataMember]
public object Secondary { get; set; }
- [DataMember]
- public object Filter { get; set; }
-
[DataMember]
public Dictionary References { get; set; }
}
diff --git a/Shared/Text/AiPromptbausteineTexts.cs b/Shared/Text/AiPromptbausteineTexts.cs
index bd0f73ecd..d68e170a9 100644
--- a/Shared/Text/AiPromptbausteineTexts.cs
+++ b/Shared/Text/AiPromptbausteineTexts.cs
@@ -8,8 +8,6 @@ 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";