pass keywords to transcription adapters for spelling hints

This commit is contained in:
leonardotrapani
2026-01-31 20:46:36 +01:00
parent e175f4f6f2
commit 38cac375ad
7 changed files with 36 additions and 1 deletions
@@ -5,6 +5,7 @@ import (
"context"
"fmt"
"log"
"strings"
"time"
"github.com/sashabaranov/go-openai"
@@ -49,6 +50,11 @@ func (a *GroqTranslationAdapter) Transcribe(ctx context.Context, audioData []byt
Language: a.config.Language, // Source language hint
}
// Add keywords as prompt to help with spelling hints
if len(a.config.Keywords) > 0 {
req.Prompt = strings.Join(a.config.Keywords, ", ")
}
start := time.Now()
resp, err := a.client.CreateTranslation(ctx, req)
duration := time.Since(start)