SystemInstruction -> SystemPrompt
This commit is contained in:
@@ -108,21 +108,21 @@
|
||||
<Compile Include="Facade\LLM\BaseLLMApiClient.cs" />
|
||||
<Compile Include="Facade\LLM\OllamaApiClient.cs" />
|
||||
<Compile Include="Facade\LLM\OpenWebApiClient.cs" />
|
||||
<Compile Include="Prompt\SystemInstruction\AiFunctionSystemInstructionBuilder.cs" />
|
||||
<Compile Include="Prompt\SystemPrompts\AiFunctionSystemPromptBuilder.cs" />
|
||||
<Compile Include="Prompt\Core\AiUtils.cs" />
|
||||
<Compile Include="Prompt\SystemInstruction\AiConversationSystemInstructionBuilder.cs" />
|
||||
<Compile Include="Prompt\SystemPrompts\AiConversationSystemPromptBuilder.cs" />
|
||||
<Compile Include="Prompt\Models\AiConversationContext.cs" />
|
||||
<Compile Include="Prompt\SystemInstruction\BaseSystemInstructionBuilder.cs" />
|
||||
<Compile Include="Prompt\SystemPrompts\BaseSystemPromptBuilder.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Prompt\SystemPrompts\system_prompt1.txt" />
|
||||
<EmbeddedResource Include="Prompt\SystemPrompts\Examples\system_prompt1.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Prompt\SystemPrompts\system_prompt2.txt" />
|
||||
<EmbeddedResource Include="Prompt\SystemPrompts\Examples\system_prompt2.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Prompt\SystemPrompts\system_prompt3.txt" />
|
||||
<EmbeddedResource Include="Prompt\SystemPrompts\Examples\system_prompt3.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Prompt\Factories\" />
|
||||
|
||||
@@ -12,19 +12,19 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace AICore.Prompt.SystemInstruction
|
||||
namespace AICore.Prompt.SystemPrompts
|
||||
{
|
||||
public class AiConversationSystemInstructionBuilder : BaseSystemInstructionBuilder
|
||||
public class AiConversationSystemPromptBuilder : BaseSystemPromptBuilder
|
||||
{
|
||||
public AiConversationSystemInstructionBuilder(string prompt_path) : base(prompt_path) {
|
||||
public AiConversationSystemPromptBuilder(string prompt_path) : base(prompt_path) {
|
||||
|
||||
}
|
||||
|
||||
public string CreateSystemInstructions(AiContextType uicontext, BaseContextSummary context, AiDataContextType aiDataContextType)
|
||||
public string CreateSystemPrompt(AiContextType uicontext, BaseContextSummary context, AiDataContextType aiDataContextType)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine(getCustomSystemPrompt("customSystemInstruction.txt"));
|
||||
sb.AppendLine(getCustomSystemPrompt("customPreSystemPrompt.txt"));
|
||||
|
||||
sb.AppendLine("### **Allgemein**");
|
||||
sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
|
||||
@@ -11,20 +11,20 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AICore.Prompt.SystemInstruction
|
||||
namespace AICore.Prompt.SystemPrompts
|
||||
{
|
||||
public class AiFunctionSystemInstructionBuilder : BaseSystemInstructionBuilder
|
||||
public class AiFunctionSystemPromptBuilder : BaseSystemPromptBuilder
|
||||
{
|
||||
public AiFunctionSystemInstructionBuilder(string prompt_path) : base(prompt_path)
|
||||
public AiFunctionSystemPromptBuilder(string prompt_path) : base(prompt_path)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string CreateServiceRecordDocumentationSystemInstructions(BaseContextSummary context)
|
||||
public string CreateServiceRecordDocumentationSystemPrompt(BaseContextSummary context)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine(getCustomSystemPrompt("customFunctionSystemInstruction.txt"));
|
||||
sb.AppendLine(getCustomSystemPrompt("customFunctionPreSystemPrompt.txt"));
|
||||
|
||||
sb.AppendLine("### **Allgemein**");
|
||||
sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
|
||||
@@ -5,13 +5,13 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AICore.Prompt.SystemInstruction
|
||||
namespace AICore.Prompt.SystemPrompts
|
||||
{
|
||||
public class BaseSystemInstructionBuilder
|
||||
public class BaseSystemPromptBuilder
|
||||
{
|
||||
public string SystemPromptFolderPath { get; set; }
|
||||
|
||||
public BaseSystemInstructionBuilder(string systemPromptFolderPath)
|
||||
public BaseSystemPromptBuilder(string systemPromptFolderPath)
|
||||
{
|
||||
SystemPromptFolderPath = systemPromptFolderPath;
|
||||
}
|
||||
@@ -11,10 +11,10 @@ namespace BeWo.Service.Core
|
||||
public static class PathHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Holt den Ordner, wo sich die systemInstructions befinden
|
||||
/// Holt den Ordner, wo sich die systemPrompts befinden
|
||||
/// </summary>
|
||||
public static string GetAiSystemInstructionPath()
|
||||
=> Path.Combine(getRoot(), "AI", "systemInstructions");
|
||||
public static string GetAiSystemPromptPath()
|
||||
=> Path.Combine(getRoot(), "AI", "systemPrompts");
|
||||
|
||||
|
||||
public static string GetUniqueRequestLogFile()
|
||||
|
||||
@@ -14,7 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AICore.Prompt.SystemInstruction;
|
||||
using AICore.Prompt.SystemPrompts;
|
||||
using BeWo.Service.Core;
|
||||
|
||||
namespace BeWo.Service.Plugins
|
||||
@@ -32,9 +32,9 @@ namespace BeWo.Service.Plugins
|
||||
// Anfrage zusammensetzen
|
||||
var context = AiFunctionContextLoader.LoadServiceRecordDocumentationContext(request);
|
||||
|
||||
var systemInstructionsFolderPath = PathHelper.GetAiSystemInstructionPath();
|
||||
var factory = new AiFunctionSystemInstructionBuilder(systemInstructionsFolderPath);
|
||||
var system_prompt = factory.CreateServiceRecordDocumentationSystemInstructions(context);
|
||||
var systemPromptFolderPath = PathHelper.GetAiSystemPromptPath();
|
||||
var factory = new AiFunctionSystemPromptBuilder(systemPromptFolderPath);
|
||||
var system_prompt = factory.CreateServiceRecordDocumentationSystemPrompt(context);
|
||||
|
||||
var user_prompt = request.AiPromptbaustein;
|
||||
var user_prompt_oid = user_prompt.Oid;
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Web.Hosting;
|
||||
using AICore.Prompt.Core;
|
||||
using AICore.Prompt.SystemInstruction;
|
||||
using AICore.Prompt.SystemPrompts;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Data.Security;
|
||||
@@ -272,11 +272,11 @@ namespace BeWo.Service.Plugins
|
||||
{
|
||||
var current_user = UserRightHelper.GetLoggedInUserWithOid();
|
||||
|
||||
var systemInstructionsFolderPath = PathHelper.GetAiSystemInstructionPath();
|
||||
var factory = new AiConversationSystemInstructionBuilder(systemInstructionsFolderPath);
|
||||
var systemPromptFolderPath = PathHelper.GetAiSystemPromptPath();
|
||||
var factory = new AiConversationSystemPromptBuilder(systemPromptFolderPath);
|
||||
|
||||
var context_loaded = AiContextLoader.LoadContext(uicontext, context_reference);
|
||||
var system_prompt = factory.CreateSystemInstructions(uicontext, context_loaded, context_Type);
|
||||
var system_prompt = factory.CreateSystemPrompt(uicontext, context_loaded, context_Type);
|
||||
|
||||
var conv = new AiConversation();
|
||||
conv.Created = DateTime.Now;
|
||||
|
||||
Reference in New Issue
Block a user