Routine bliblablubb
This commit is contained in:
@@ -121,6 +121,7 @@
|
||||
<Compile Include="Facade\LLM\BaseLLMApiClient.cs" />
|
||||
<Compile Include="Facade\LLM\OllamaApiClient.cs" />
|
||||
<Compile Include="Facade\LLM\OpenWebApiClient.cs" />
|
||||
<Compile Include="Prompt\AiSystemPromptFactory.cs" />
|
||||
<Compile Include="Prompt\SystemPrompts\AiFunctionSystemPromptBuilder.cs" />
|
||||
<Compile Include="Prompt\SystemPrompts\AiConversationSystemPromptBuilder.cs" />
|
||||
<Compile Include="Prompt\Models\AiConversationContext.cs" />
|
||||
@@ -138,7 +139,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Prompt\Core\" />
|
||||
<Folder Include="Prompt\Factories\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
|
||||
@@ -27,6 +27,18 @@ namespace AICore.Context.Core
|
||||
return new ServiceRecordNavigationCS(entries, customer_entry, costbearer_str, supportconcept_str);
|
||||
}
|
||||
|
||||
public static BaseContextSummary CreateServiceRecordDocumentationFunction(IEnumerable<ServiceRecordDC> serviceRecords,
|
||||
CompactCustomerDC customer, CompactCostBearerDC costBearer, CompactSupportConceptDC supportConcept, string doku)
|
||||
{
|
||||
var entries = ContextEntryMapperFactory.ServiceRecordMapper.MapToNewContexts(serviceRecords);
|
||||
var customer_entry = ContextEntryMapperFactory.ServiceRecordCustomerMapper.MapToNewContext(customer);
|
||||
|
||||
var costbearer_str = costBearer.OrganisationName;
|
||||
var supportconcept_str = $"{supportConcept.StartDate?.Date} - {supportConcept.EndDate?.Date}";
|
||||
|
||||
return new ServiceRecordDocumantationFCS(entries, customer_entry, costbearer_str, supportconcept_str, doku);
|
||||
}
|
||||
|
||||
public static BaseContextSummary CreateCustomerDetailContextSummary(CustomerDC customer)
|
||||
{
|
||||
var entry = ContextEntryMapperFactory.CustomerMapper.MapToNewContext(customer);
|
||||
@@ -96,17 +108,5 @@ namespace AICore.Context.Core
|
||||
|
||||
return new SupportConceptNavigationCS(entry);
|
||||
}
|
||||
|
||||
public static BaseContextSummary CreateServiceRecordDocumentationFunction(IEnumerable<ServiceRecordDC> serviceRecords,
|
||||
CompactCustomerDC customer, CompactCostBearerDC costBearer, CompactSupportConceptDC supportConcept, string doku)
|
||||
{
|
||||
var entries = ContextEntryMapperFactory.ServiceRecordMapper.MapToNewContexts(serviceRecords);
|
||||
var customer_entry = ContextEntryMapperFactory.ServiceRecordCustomerMapper.MapToNewContext(customer);
|
||||
|
||||
var costbearer_str = costBearer.OrganisationName;
|
||||
var supportconcept_str = $"{supportConcept.StartDate?.Date} - {supportConcept.EndDate?.Date}";
|
||||
|
||||
return new ServiceRecordDocumantationFCS(entries, customer_entry, costbearer_str, supportconcept_str, doku);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
37
Server/Components/AICore/Prompt/AiSystemPromptFactory.cs
Normal file
37
Server/Components/AICore/Prompt/AiSystemPromptFactory.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using AICore.Context.Summary;
|
||||
using AICore.Prompt.SystemPrompts;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AICore.Prompt
|
||||
{
|
||||
public class AiSystemPromptFactory
|
||||
{
|
||||
public static string BuildContext(AiActionType actionType, string prompt_path, BaseContextSummary context, AiDataContextType context_type)
|
||||
{
|
||||
switch (actionType)
|
||||
{
|
||||
case AiActionType.ServiceRecord:
|
||||
break;
|
||||
case AiActionType.ServiceRecordConversation:
|
||||
var factory = new AiConversationSystemPromptBuilder(prompt_path);
|
||||
var prompt = factory.CreateSystemPrompt(actionType, context, context_type);
|
||||
return prompt;
|
||||
case AiActionType.ServiceRecordDocumentation:
|
||||
var factory2 = new AiFunctionSystemPromptBuilder(prompt_path);
|
||||
var prompt2 = factory2.CreateServiceRecordDocumentationSystemPrompt(context);
|
||||
return prompt2;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
throw BeWoNotImplementedException.CreateFromEnum(actionType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ using System.Text.Json;
|
||||
|
||||
namespace AICore.Prompt.SystemPrompts
|
||||
{
|
||||
public class AiConversationSystemPromptBuilder : BaseSystemPromptBuilder
|
||||
internal class AiConversationSystemPromptBuilder : BaseSystemPromptBuilder
|
||||
{
|
||||
public AiConversationSystemPromptBuilder(string prompt_path) : base(prompt_path) {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace AICore.Prompt.SystemPrompts
|
||||
{
|
||||
public class AiFunctionSystemPromptBuilder : BaseSystemPromptBuilder
|
||||
internal class AiFunctionSystemPromptBuilder : BaseSystemPromptBuilder
|
||||
{
|
||||
public AiFunctionSystemPromptBuilder(string prompt_path) : base(prompt_path)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace AICore.Prompt.SystemPrompts
|
||||
{
|
||||
public class BaseSystemPromptBuilder
|
||||
internal class BaseSystemPromptBuilder
|
||||
{
|
||||
public readonly static Dictionary<AiActionType, string> Translations = new Dictionary<AiActionType, string>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user