Files
BeWoPlaner/Server/Components/AICore/Prompt/SystemInstruction/AiFunctionSystemInstructionBuilder.cs
2025-11-28 14:54:24 +01:00

55 lines
1.5 KiB
C#

using AICore.Context.Summary;
using AICore.Context.Summary.Function;
using AICore.Context.SummaryParser;
using BS.Shared;
using BS.Shared.Core;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AICore.Prompt.SystemInstruction
{
public class AiFunctionSystemInstructionBuilder : BaseSystemInstructionBuilder
{
public AiFunctionSystemInstructionBuilder(string prompt_path) : base(prompt_path)
{
}
public string CreateServiceRecordDocumentationSystemInstructions(BaseContextSummary context)
{
var sb = new StringBuilder();
sb.AppendLine(getCustomSystemPrompt("customFunctionSystemInstruction.txt"));
sb.AppendLine("### **Allgemein**");
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($"- 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:");
var parser = new CsvContextSummaryParser();
var parsed = parser.Parse(AiContextType.ServiceRecord, context);
sb.AppendLine(parsed);
}
return sb.ToString();
}
}
}