Endpunkt Erweiterung
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user