Merge branch 'feature_rene_18_ai'
# Conflicts: # BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs # Service/ServiceImplementations/Enhanced/StatusServiceImp.cs
This commit is contained in:
@@ -1417,13 +1417,6 @@ namespace BS.Shared
|
||||
tsv2,
|
||||
}
|
||||
|
||||
public enum AiPromptbausteinType
|
||||
{
|
||||
Prompt,
|
||||
Ordner,
|
||||
Kette
|
||||
}
|
||||
|
||||
public enum AiActionType
|
||||
{
|
||||
ServiceRecord,
|
||||
@@ -1431,40 +1424,6 @@ namespace BS.Shared
|
||||
ServiceRecordDocumentation
|
||||
}
|
||||
|
||||
public enum AiContextType
|
||||
{
|
||||
SupportConceptNavigation = 0,
|
||||
CustomerNavigation = 1,
|
||||
PersonNavigation = 2,
|
||||
EmployeeNavigation = 3,
|
||||
OrganisationNavigation = 4,
|
||||
//Team = 5,
|
||||
//Dokumente = 6,
|
||||
//User = 7,
|
||||
//UserGroup = 8,
|
||||
//Report = 9,
|
||||
//Scheduler = 10,
|
||||
//Wohnheim = 11,
|
||||
//Vertretungen = 12,
|
||||
//CustomerTeam = 13,
|
||||
//Scheduling = 14,
|
||||
//Finance = 15,
|
||||
//Administration = 16,
|
||||
//AiConversation = 17,
|
||||
//AiConversationPopup = 18,
|
||||
ServiceRecord = 19,
|
||||
CustomerDetail = 20,
|
||||
PersonDetail = 21,
|
||||
EmployeeDetail = 22,
|
||||
OrganisationDetail = 23,
|
||||
SupportConceptDetail = 24,
|
||||
}
|
||||
|
||||
public enum AiFunctionType
|
||||
{
|
||||
ServiceRecordDocumentation
|
||||
}
|
||||
|
||||
public enum AiModelSource
|
||||
{
|
||||
openwebui,
|
||||
@@ -1472,6 +1431,12 @@ namespace BS.Shared
|
||||
ollama2
|
||||
}
|
||||
|
||||
public enum AiRoutineType
|
||||
{
|
||||
Chain,
|
||||
Stack
|
||||
}
|
||||
|
||||
public enum BeWoClientReleaseStage
|
||||
{
|
||||
ProofOfConcept,
|
||||
|
||||
@@ -37,8 +37,6 @@ namespace BS.Shared.Core
|
||||
public static Dictionary<Enum, string> Gkv2Translation;
|
||||
public static Dictionary<Enum, string> VgaType2Translation;
|
||||
|
||||
public static Dictionary<Enum, string> Ai2Translation;
|
||||
|
||||
public static Dictionary<ValueListEntryType, String> ValueListEntryType2Header;
|
||||
|
||||
public static Dictionary<ValueListEntryType, String> ValueListEntryTypeTranslations;
|
||||
@@ -72,7 +70,6 @@ namespace BS.Shared.Core
|
||||
TempTranslations = new List<Dictionary<Enum, string>>()
|
||||
{
|
||||
(Gkv2Translation = GetGkvTranslation()),
|
||||
(Ai2Translation = GetAiTranslations()),
|
||||
(VgaType2Translation = GetVgaTypeTranslation())
|
||||
};
|
||||
|
||||
@@ -1177,19 +1174,6 @@ namespace BS.Shared.Core
|
||||
{ GkvVerfahrensstufe.Echt, "Echt" }
|
||||
};
|
||||
|
||||
private static Dictionary<Enum, string> GetAiTranslations() => new Dictionary<Enum, string>
|
||||
{
|
||||
{ AiContextType.SupportConceptNavigation, "Hilfeplan Navigation" },
|
||||
{ AiContextType.CustomerNavigation, "Klienten Navigation" },
|
||||
{ AiContextType.PersonNavigation, "Personen Navigation" },
|
||||
{ AiContextType.EmployeeNavigation, "Mitarbeiter Navigation" },
|
||||
{ AiContextType.OrganisationNavigation, "Organisationen Navigation" },
|
||||
{ AiContextType.ServiceRecord, "Zeiterfassung" },
|
||||
{ AiContextType.CustomerDetail, "Klienten Ansicht" },
|
||||
{ AiContextType.EmployeeDetail, "Personen Ansicht" },
|
||||
{ AiContextType.PersonDetail, "Mitarbeiter Ansicht" }
|
||||
};
|
||||
|
||||
private static Dictionary<Enum, string> GetVgaTypeTranslation() => new Dictionary<Enum, string>
|
||||
{
|
||||
{ VgaTypeEnum.Vga, Translator.Translate("VgA") },
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
[DataMember] public AiModelDC Modell { get; set; }
|
||||
[DataMember] public string Context { get; set; }
|
||||
[DataMember] public Dictionary<TableID, long[]> ContextBeWoObjects { get; set; } = new Dictionary<TableID, long[]>();
|
||||
[DataMember] public AiContextType UIContext { get; set; }
|
||||
[DataMember] public AiActionType ActionType { get; set; }
|
||||
[DataMember] public AiDataContextType ContextType { get; set; }
|
||||
[DataMember] public List<AiConversationMessageDC> Messages { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using BS.Shared.Interface.Feature.AICore;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -9,7 +10,7 @@ using System.Threading.Tasks;
|
||||
namespace BS.Shared.DataContracts.Feature.AI
|
||||
{
|
||||
[DataContract]
|
||||
public class AiModelDC : BeWoDataContract, IComparable<AiModelDC>
|
||||
public class AiModelDC : BeWoDataContract, IComparable<AiModelDC>, IAiModel
|
||||
{
|
||||
public AiModelDC()
|
||||
{
|
||||
|
||||
@@ -19,9 +19,11 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
[DataMember] public AiActionType ActionType { get; set; }
|
||||
[DataMember] public List<AiPromptbausteinFolderDC> SubFolders { get; set; }
|
||||
[DataMember] public List<AiPromptbausteinPromptDC> SubPrompts { get; set; }
|
||||
[DataMember] public List<AiPromptbausteinRoutineDC> SubRoutines { get; set; }
|
||||
|
||||
[DataMember] public bool CanAddFolder { get; set; }
|
||||
[DataMember] public bool CanAddPrompt { get; set; }
|
||||
[DataMember] public bool CanAddRoutine { get; set; }
|
||||
[DataMember] public bool CanEdit { get; set; }
|
||||
[DataMember] public bool IsNewFeature { get; set; }
|
||||
}
|
||||
@@ -58,10 +60,12 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
ParentFolderOid = null,
|
||||
SubFolders = new List<AiPromptbausteinFolderDC>(),
|
||||
SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
||||
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
|
||||
Title = AiPromptbausteineTexts.OwnBibNodeTitle,
|
||||
Version = 1,
|
||||
CanAddFolder = true,
|
||||
CanAddPrompt = true,
|
||||
CanAddRoutine = true,
|
||||
IsExpanded = true,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
[DataMember] public int Position { get; set; }
|
||||
[DataMember] public bool IsFavorite { get; set; }
|
||||
[DataMember] public AiActionType ActionType { get; set; }
|
||||
[DataMember] public AiRoutineType RoutineType { get; set; }
|
||||
|
||||
[DataMember] public bool CanEdit { get; set; }
|
||||
[DataMember] public List<AiPromptbausteinRoutineStepDC> Steps { get; set; } = new List<AiPromptbausteinRoutineStepDC> { };
|
||||
|
||||
@@ -13,9 +13,10 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
public class AiPromptbausteinRoutineStepDC : BeWoDataContract, IAiPromptbausteinRoutineStep
|
||||
{
|
||||
[DataMember] public int Position { get; set; }
|
||||
[DataMember] public AiPromptbausteinPromptDC PromptReference { get; set; }
|
||||
[DataMember] public AiPromptbausteinPromptDC ReferencePrompt { get; set; }
|
||||
[DataMember] public long ReferenceVersion { get; set; }
|
||||
[DataMember] public bool IsValid { get; set; }
|
||||
|
||||
public IAiPromptbausteinPrompt Reference => PromptReference;
|
||||
public IAiPromptbausteinPrompt Reference => ReferencePrompt;
|
||||
}
|
||||
}
|
||||
|
||||
22
Shared/DataContracts/Feature/AI/AiViewContextDC.cs
Normal file
22
Shared/DataContracts/Feature/AI/AiViewContextDC.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.DataContracts.Feature.AI
|
||||
{
|
||||
[DataContract]
|
||||
public class AiViewContextDC : IDataContract
|
||||
{
|
||||
[DataMember]
|
||||
public long? Primary { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public object Secondary { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public Dictionary<TableID, long[]> References { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace BS.Shared.DataContracts
|
||||
public string Version { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool DatabaseOk { get; set; }
|
||||
public ServiceStatusDC DatabaseOk { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public List<ServiceStatusDC> Services { get; set; }
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
using BS.Shared.Interface.Feature.AICore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.Extensions
|
||||
{
|
||||
public static class AiPromptbausteinRoutineExtensions
|
||||
{
|
||||
public static bool CanExecuteRoutine(this IAiPromptbausteinRoutine routine)
|
||||
{
|
||||
if (routine?.Steps is null || !routine.Steps.Any())
|
||||
return false;
|
||||
|
||||
foreach (var step in routine.Steps)
|
||||
{
|
||||
// Delete
|
||||
if (step.Reference is null)
|
||||
return false;
|
||||
|
||||
// Update
|
||||
if (step.Reference.Version != step.ReferenceVersion)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
using BS.Shared.Interface;
|
||||
using DevExpress.DataAccess.DataFederation;
|
||||
using DevExpress.Xpf.Bars.Native;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.Extensions.CustomInterfaces
|
||||
{
|
||||
public static class IAiPromptbausteinTreeExtension
|
||||
{
|
||||
public static bool IsExecutable(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.IsPrompt() || aiPromptbaustein.IsKette();
|
||||
|
||||
|
||||
public static bool IsOrdner(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.hasPrompttype(AiPromptbausteinType.Ordner);
|
||||
|
||||
public static bool IsKette(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.hasPrompttype(AiPromptbausteinType.Kette);
|
||||
|
||||
public static bool IsPrompt(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.hasPrompttype(AiPromptbausteinType.Prompt);
|
||||
|
||||
|
||||
public static bool IsPredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.isObject() && aiPromptbaustein.Oid is long oid && oid < 0;
|
||||
|
||||
public static bool IsNoPredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.isObject() && (aiPromptbaustein.Oid is null || aiPromptbaustein.Oid >= 0);
|
||||
|
||||
public static bool IsAddablePredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.IsPredefinedNode() && !aiPromptbaustein.IsNoAddablePredefinedNode();
|
||||
|
||||
public static bool IsNoAddablePredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein.IsPredefinedNode() && aiPromptbaustein.AiActionType == AiActionType.ServiceRecord;
|
||||
|
||||
|
||||
private static bool hasPrompttype(this IAiPromptbaustein aiPromptbaustein, AiPromptbausteinType aiPromptbausteinType)
|
||||
=> aiPromptbaustein.isObject() && aiPromptbaustein.PromptbausteinType == aiPromptbausteinType;
|
||||
|
||||
private static bool isObject(this IAiPromptbaustein aiPromptbaustein)
|
||||
=> aiPromptbaustein != null;
|
||||
|
||||
}
|
||||
}
|
||||
16
Shared/Interface/Feature/AICore/IAiModel.cs
Normal file
16
Shared/Interface/Feature/AICore/IAiModel.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.Interface.Feature.AICore
|
||||
{
|
||||
public interface IAiModel
|
||||
{
|
||||
AiModelSource ModelSource { get; }
|
||||
string ModelName { get; }
|
||||
int Value { get; }
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ namespace BS.Shared.Interface
|
||||
public interface IAiPromptbaustein
|
||||
{
|
||||
long? Oid { get; }
|
||||
AiPromptbausteinType PromptbausteinType { get; }
|
||||
AiActionType AiActionType { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
14
Shared/Interface/ITextProvider.cs
Normal file
14
Shared/Interface/ITextProvider.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.Interface
|
||||
{
|
||||
public interface ITextProvider
|
||||
{
|
||||
string GetText(string key);
|
||||
void SetText(string key, string value);
|
||||
}
|
||||
}
|
||||
@@ -194,6 +194,7 @@
|
||||
<Compile Include="DataContracts\AdminService\AdminServiceSumResponseDetailDC.cs" />
|
||||
<Compile Include="DataContracts\AdminService\IAdminServiceDC.cs" />
|
||||
<Compile Include="DataContracts\AdminService\AdminServiceSumReqDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\AI\AiViewContextDC.cs" />
|
||||
<Compile Include="DataContracts\TeamFolderRightDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\AI\AiPromptbausteinRoutineDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\AI\AiPromptbausteinRoutineStepDC.cs" />
|
||||
@@ -423,11 +424,9 @@
|
||||
<Compile Include="Exceptions\BeWoNotImplementedException.cs" />
|
||||
<Compile Include="Exceptions\BeWoInvalidOperationException.cs" />
|
||||
<Compile Include="Exceptions\GkvException.cs" />
|
||||
<Compile Include="Extensions\AiPromptbausteinRoutineExtensions.cs" />
|
||||
<Compile Include="Extensions\ApiResponseExtension.cs" />
|
||||
<Compile Include="Extensions\BoolExtensions.cs" />
|
||||
<Compile Include="Extensions\ContactExtensions.cs" />
|
||||
<Compile Include="Extensions\CustomInterfaces\IAiPromptbausteinTreeExtension.cs" />
|
||||
<Compile Include="Extensions\EnumExtensions.cs" />
|
||||
<Compile Include="Extensions\GkvAbrechnungExtensions.cs" />
|
||||
<Compile Include="Extensions\GridExtensions.cs" />
|
||||
@@ -438,10 +437,12 @@
|
||||
<Compile Include="Extensions\TimeIntervalExtensions.cs" />
|
||||
<Compile Include="Interface\Abstract\IAddressable.cs" />
|
||||
<Compile Include="Interface\Feature\AICore\IAiConversationMessage.cs" />
|
||||
<Compile Include="Interface\Feature\AICore\IAiModel.cs" />
|
||||
<Compile Include="Interface\Feature\AICore\IAiPromptbaustein.cs" />
|
||||
<Compile Include="Interface\Feature\AICore\IAiPromptbausteinPrompt.cs" />
|
||||
<Compile Include="Interface\Feature\AICore\IAiPromptbausteinRoutine.cs" />
|
||||
<Compile Include="Interface\Feature\AICore\IAiPromptbausteinRoutineStep.cs" />
|
||||
<Compile Include="Interface\ITextProvider.cs" />
|
||||
<Compile Include="Interface\IApiErrorExtractor.cs" />
|
||||
<Compile Include="Interface\IContact.cs" />
|
||||
<Compile Include="Interface\IFileStorageDAO.cs" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory />
|
||||
@@ -9,6 +9,6 @@
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>de-DE</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user