UIContextType -> AiActionType

This commit is contained in:
2026-05-26 12:30:29 +02:00
parent 709937eee3
commit 9c10386b87
46 changed files with 396 additions and 625 deletions

View File

@@ -11,6 +11,6 @@ namespace AICore.Context.SummaryParser
{
internal abstract class BaseContextSummaryParser
{
public abstract string Parse(AiContextType uicontext, BaseContextSummary context);
public abstract string Parse(AiActionType actionType, BaseContextSummary context);
}
}

View File

@@ -26,7 +26,7 @@ namespace AICore.Context.SummaryParser
_StrictEscapeCsvField = strictEscapeCsvField;
}
public override string Parse(AiContextType uicontext, BaseContextSummary context)
public override string Parse(AiActionType actionType, BaseContextSummary context)
{
if (context is null || context.Context is null)
return string.Empty;
@@ -92,7 +92,7 @@ namespace AICore.Context.SummaryParser
return sb.ToString();
}
throw BeWoNotImplementedException.CreateFromEnum(uicontext);
throw BeWoNotImplementedException.CreateFromEnum(actionType);
}
public string ToCsvString(BaseContextEntry entry, bool includeHeaders = true)

View File

@@ -11,7 +11,7 @@ namespace AICore.Context.SummaryParser
{
internal class JsonContextSummaryParser : BaseContextSummaryParser
{
public override string Parse(AiContextType uicontext, BaseContextSummary context)
public override string Parse(AiActionType actionType, BaseContextSummary context)
{
var options = new JsonSerializerOptions { IncludeFields = true };

View File

@@ -20,7 +20,7 @@ namespace AICore.Prompt.SystemPrompts
}
public string CreateSystemPrompt(AiContextType uicontext, BaseContextSummary context, AiDataContextType aiDataContextType)
public string CreateSystemPrompt(AiActionType actionType, BaseContextSummary context, AiDataContextType aiDataContextType)
{
var sb = new StringBuilder();
@@ -33,7 +33,7 @@ namespace AICore.Prompt.SystemPrompts
sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
sb.AppendLine();
sb.AppendLine("### **Ansicht**");
sb.AppendLine($"- Ich befinde mich aktuell in der \"{EnumTranslations.Ai2Translation[uicontext]}\" meiner Anwendung.");
sb.AppendLine($"- Ich befinde mich aktuell in der \"{Translations[actionType]}\" meiner Anwendung.");
sb.AppendLine($"- Es ist kein Filter gesetzt.");
sb.AppendLine();
sb.AppendLine("### **Daten**");
@@ -47,7 +47,7 @@ namespace AICore.Prompt.SystemPrompts
sb.AppendLine("Du erhälst folgende Daten:");
var parser = GetParser(aiDataContextType);
var parsed = parser.Parse(uicontext, context);
var parsed = parser.Parse(actionType, context);
sb.AppendLine(parsed);
}

View File

@@ -33,7 +33,7 @@ namespace AICore.Prompt.SystemPrompts
sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
sb.AppendLine();
sb.AppendLine("### **Ansicht**");
sb.AppendLine($"- Ich befinde mich aktuell in der \"{EnumTranslations.Ai2Translation[AiContextType.ServiceRecord]}\" meiner Anwendung.");
sb.AppendLine($"- Ich befinde mich aktuell in der \"Zeiterfassung\" meiner Anwendung.");
sb.AppendLine($"- Es ist kein Filter gesetzt.");
sb.AppendLine();
sb.AppendLine("### **Daten**");
@@ -47,7 +47,7 @@ namespace AICore.Prompt.SystemPrompts
sb.AppendLine("Du erhälst folgende Daten:");
var parser = new CsvContextSummaryParser();
var parsed = parser.Parse(AiContextType.ServiceRecord, context);
var parsed = parser.Parse(AiActionType.ServiceRecordDocumentation, context);
sb.AppendLine(parsed);
}

View File

@@ -1,4 +1,5 @@
using System;
using BS.Shared;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -9,6 +10,13 @@ namespace AICore.Prompt.SystemPrompts
{
public class BaseSystemPromptBuilder
{
public readonly static Dictionary<AiActionType, string> Translations = new Dictionary<AiActionType, string>
{
{AiActionType.ServiceRecord, "Zeiterfassung" },
{AiActionType.ServiceRecordConversation, "Zeiterfassung" },
{AiActionType.ServiceRecordDocumentation, "Zeiterfassung" },
};
public string Path { get; set; }
public BaseSystemPromptBuilder(string path)