feat: Introduce Summary and Professional skills, replacing the old style mode and text structuring configuration options.
This commit is contained in:
@@ -30,6 +30,9 @@ public static class PromptBuilder
|
||||
if (config.ModulePunctuation)
|
||||
{
|
||||
sb.AppendLine("- Apply standard punctuation, grammar, and capitalization rules.");
|
||||
sb.AppendLine("- Preserve the exact original tone, rhythm, and word choice of the speaker.");
|
||||
sb.AppendLine("- ONLY fix obvious grammatical errors, spelling mistakes, and bad punctuation.");
|
||||
sb.AppendLine("- Do not attempt to formalize the language or alter the speaker's personal voice and cadence.");
|
||||
}
|
||||
|
||||
if (config.ModuleTechnicalSanitization)
|
||||
@@ -37,29 +40,6 @@ public static class PromptBuilder
|
||||
sb.AppendLine("- Ensure technical terms are properly formatted (e.g., 'C#' instead of 'c sharp', 'HANA' instead of 'hana', 'SAP' instead of 'sap', 'API', 'SQL').");
|
||||
}
|
||||
|
||||
switch (config.StyleMode.ToLowerInvariant())
|
||||
{
|
||||
case "professional":
|
||||
sb.AppendLine("- Rewrite the text into formal prose suitable for emails or professional documents.");
|
||||
break;
|
||||
case "concise":
|
||||
sb.AppendLine("- Summarize the text, removing fluff and filler for quick notes.");
|
||||
break;
|
||||
case "casual":
|
||||
sb.AppendLine("- Maintain the original rhythm and tone but fix spelling and grammar.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (config.StructureBulletPoints)
|
||||
{
|
||||
sb.AppendLine("- Format the output as a bulleted list where appropriate.");
|
||||
}
|
||||
|
||||
if (config.StructureSmartParagraphing)
|
||||
{
|
||||
sb.AppendLine("- Break the text logically into paragraphs based on context.");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
26
Core/Skills/ProfessionalSkill.cs
Normal file
26
Core/Skills/ProfessionalSkill.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace Toak.Core.Skills;
|
||||
|
||||
public class ProfessionalSkill : ISkill
|
||||
{
|
||||
public string Name => "Professional";
|
||||
public string Description => "Rewrites the spoken text to sound highly professional and articulate.";
|
||||
public string[] Hotwords => new[] { "System professional", "System rewrite professionally", "System formalize" };
|
||||
|
||||
public bool HandlesExecution => false;
|
||||
|
||||
public string GetSystemPrompt(string rawTranscript)
|
||||
{
|
||||
return @"You are an expert formal editor and corporate communicator.
|
||||
The user wants to rewrite the following text professionally. The transcript might start with a hotword like 'System professional'.
|
||||
- Enhance the text from the speaker to sound highly professional and articulate.
|
||||
- Maintain the exact meaning and key information of the original transcription.
|
||||
- Ensure paragraph breaks are added logically to prevent walls of text, improving readability.
|
||||
- Avoid filler words, hesitations (umm, uh), or conversational redundancies.
|
||||
- Output ONLY the final polished text. Do not include markdown, explanations, or quotes.";
|
||||
}
|
||||
|
||||
public void Execute(string llmResult)
|
||||
{
|
||||
// Not used since HandlesExecution is false
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,9 @@ public static class SkillRegistry
|
||||
public static readonly ISkill[] AllSkills = new ISkill[]
|
||||
{
|
||||
new TerminalSkill(),
|
||||
new TranslateSkill()
|
||||
new TranslateSkill(),
|
||||
new ProfessionalSkill(),
|
||||
new SummarySkill()
|
||||
};
|
||||
|
||||
public static ISkill? DetectSkill(string transcript, IEnumerable<string> activeSkillNames)
|
||||
|
||||
25
Core/Skills/SummarySkill.cs
Normal file
25
Core/Skills/SummarySkill.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace Toak.Core.Skills;
|
||||
|
||||
public class SummarySkill : ISkill
|
||||
{
|
||||
public string Name => "Summary";
|
||||
public string Description => "Summarizes the spoken text securely and concisely, removing fluff.";
|
||||
public string[] Hotwords => new[] { "System summary", "System summarize", "System concise" };
|
||||
|
||||
public bool HandlesExecution => false;
|
||||
|
||||
public string GetSystemPrompt(string rawTranscript)
|
||||
{
|
||||
return @"You are an expert editor who strips all fluff and makes text as concise as possible.
|
||||
The user wants to summarize the following text. The transcript might start with a hotword like 'System summary'.
|
||||
- Strip all fluff, filler, and unnecessary conversational words.
|
||||
- Make the output as direct and brief as possible without losing the core information.
|
||||
- Use clear, crisp phrasing. If the text lists items or instructions, format them logically.
|
||||
- Output ONLY the final summarized text. Do not include markdown, explanations, or quotes.";
|
||||
}
|
||||
|
||||
public void Execute(string llmResult)
|
||||
{
|
||||
// Not used since HandlesExecution is false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user