Künstlicher Baum

This commit is contained in:
2025-12-12 14:57:26 +01:00
parent 12163e6bce
commit 70f3df905e
7 changed files with 117 additions and 104 deletions

View File

@@ -16,6 +16,7 @@ using System.Text;
using System.Threading.Tasks;
using AICore.Prompt.SystemPrompts;
using BeWo.Service.Core;
using BS.Shared.Extensions.CustomInterfaces;
namespace BeWo.Service.Plugins
{
@@ -36,16 +37,24 @@ namespace BeWo.Service.Plugins
var factory = new AiFunctionSystemPromptBuilder(systemPromptFolderPath);
var system_prompt = factory.CreateServiceRecordDocumentationSystemPrompt(context);
var user_prompt = request.AiPromptbaustein;
var user_prompt_oid = user_prompt.Oid;
var user_prompt_ver = user_prompt.Version;
var prompt_baustein_ref = request.AiPromptbaustein;
var prompt_baustein_ref_oid = prompt_baustein_ref.Oid;
var prompt_baustein_ref_ver = prompt_baustein_ref.Version;
var predefined = new PredefinedAiPromptbausteine();
var prompts = predefined.GetAllPromptbausteine();
var prompt = prompts.First(x => x.Oid == user_prompt_oid).Content;
var prompt_baustein = DAOFactory.GenericDAO.LoadByID<AiPromptbausteinTree>(prompt_baustein_ref_oid);
ServiceLogic.ConcurrencyCheck(prompt_baustein_ref_ver, prompt_baustein);
if (prompt_baustein.IsOrdner())
throw new Exception("prompt is folder");
if (prompt_baustein.IsKette())
throw new NotImplementedException();
if (prompt_baustein.Oid < 0)
throw new NotImplementedException();
// Anfrage abschicken
var result = getResult(system_prompt, prompt);
var result = getResult(system_prompt, prompt_baustein.Content);
// Response auswerten