pass keywords to transcription adapters for spelling hints
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/sashabaranov/go-openai"
|
||||
@@ -46,6 +47,11 @@ func (a *GroqTranscriptionAdapter) Transcribe(ctx context.Context, audioData []b
|
||||
Language: a.config.Language,
|
||||
}
|
||||
|
||||
// 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.CreateTranscription(ctx, req)
|
||||
duration := time.Since(start)
|
||||
|
||||
Reference in New Issue
Block a user