Endpunkt Erweiterung

This commit is contained in:
2026-02-11 11:48:13 +01:00
parent 64af74e711
commit eb16a396ac
3 changed files with 66 additions and 14 deletions

View File

@@ -8,6 +8,8 @@ using System.Text;
using System.Threading.Tasks;
using BS.Shared;
using BS.Shared.Interface;
using System.ComponentModel.Design;
using System.Runtime.Remoting.Messaging;
namespace AICore.Facade
{
@@ -24,7 +26,7 @@ namespace AICore.Facade
_ErrorExtractor = new DefaultErrorExtractor();
}
public IEnumerable<AiPromptbausteinPromptDC> GetAiPrompts()
public IEnumerable<AiPromptbausteinPromptDC> GetAiPrompts(AiActionType aiActionType)
{
var prompts = new List<AiPromptbausteinPromptDC>();
@@ -35,7 +37,9 @@ namespace AICore.Facade
promptid = "",
title = "",
prompt = "",
description = ""
description = "",
helpurl = "",
aiactiontype = ""
}
};
@@ -46,15 +50,28 @@ namespace AICore.Facade
return null;
}
var data = response.Data.Select(x => new AiPromptbausteinPromptDC()
var data = response.Data.Select(x => new AiPromptbausteinPromptDC()
{
PromptId = x.promptid,
Title = x.title,
Description = x.description,
Prompt = x.prompt,
OwnsoftRefLink = x.helpurl,
IsOwnsoftPrompt = true,
ActionType = GetAiActionType(x.aiactiontype, aiActionType)
});
return data;
return data.Where(x => x.ActionType == aiActionType); ;
}
private AiActionType GetAiActionType(string aiactiontype, AiActionType aiActionType)
{
if(Enum.TryParse<AiActionType>(aiactiontype, out var result))
{
return result;
}
return aiActionType;
}
}
}