feat: Implement a modular skill system with hotword detection, streaming text output, and enhanced logging.
This commit is contained in:
23
Core/Skills/TranslateSkill.cs
Normal file
23
Core/Skills/TranslateSkill.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace Toak.Core.Skills;
|
||||
|
||||
public class TranslateSkill : ISkill
|
||||
{
|
||||
public string Name => "Translate";
|
||||
public string Description => "Translates the spoken text into another language on the fly.";
|
||||
public string[] Hotwords => new[] { "System translate to", "System translate into" };
|
||||
|
||||
public bool HandlesExecution => false;
|
||||
|
||||
public string GetSystemPrompt(string rawTranscript)
|
||||
{
|
||||
return @"You are an expert translator. The user wants to translate the following text.
|
||||
The first few words identify the target language (e.g. 'Translate to Spanish:', 'Translate into Hungarian:').
|
||||
Translate the REST of the transcript into that target language.
|
||||
Output ONLY the final translated 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