public HoloAiScenario(GetPromptViewModel prompt) { Title = prompt.Title; Content = prompt.PromptContent.Split(new[] { "\n", "\r\n" }, StringSplitOptions.None).Select(e => new HoloAiContent(e)).ToList(); Memory = prompt.Memory; AuthorsNote = prompt.AuthorsNote; WorldInfo = prompt.WorldInfos.Select(wi => new HoloAiWorldInfo(wi)).ToList(); Tags = prompt.PromptTags.Select(e => e.Name).ToList(); }
public NovelAiScenario(GetPromptViewModel prompt) { Title = prompt.Title; Description = prompt.Description ?? string.Empty; Prompt = prompt.PromptContent; Tags = prompt.PromptTags.Select(e => e.Name).ToList(); Context = new List <NovelAiContext> { new() { Text = prompt.Memory?.Trim() ?? string.Empty, Config = new NovelAiContextConfig { Prefix = string.Empty, Suffix = "\n", TokenBudget = 2048, ReservedTokens = 0, BudgetPriority = 800, TrimDirection = "trimBottom", InsertionType = "token", InsertionPosition = 0 } }, new() { Text = prompt.AuthorsNote?.Trim() ?? string.Empty, Config = new NovelAiContextConfig { Prefix = string.Empty, Suffix = "\n", TokenBudget = 2048, ReservedTokens = 2048, BudgetPriority = -400, TrimDirection = "trimBottom", InsertionType = "newline", InsertionPosition = -4 } } }; Lorebook = new NovelAiLorebook { LorebookEntries = prompt.WorldInfos.Select( wi => { var split = wi.KeysList.ToList(); return(new NovelAiLorebookEntry { Keys = split.ConvertAll(key => key.Trim()), Text = wi.Entry, DisplayName = split.FirstOrDefault()?.Trim() ?? string.Empty }); }).ToList() }; }