diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-01 13:00:40 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-01 13:00:40 +0300 |
| commit | b006582e4c7323821eb836080a9bc9ec24243a47 (patch) | |
| tree | a8e96ecdc74cd2a5bb19148d8a6a7cf90f6cbbb4 /internal/processor/processor.go | |
| parent | a574e5290261f9ea2cc39fd0a9a2ba756fc1f67a (diff) | |
zr: add Gemini-backed translation provider
Diffstat (limited to 'internal/processor/processor.go')
| -rw-r--r-- | internal/processor/processor.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/processor/processor.go b/internal/processor/processor.go index d52ca53..94b0448 100644 --- a/internal/processor/processor.go +++ b/internal/processor/processor.go @@ -32,12 +32,13 @@ type Processor struct { // NewProcessor creates a new word processor func NewProcessor(flags *cli.Flags) *Processor { - apiKey := cli.GetOpenAIKey() + openAIKey := cli.GetOpenAIKey() + translationProvider := translation.Provider(viper.GetString("translation.provider")) return &Processor{ flags: flags, - translator: translation.NewTranslator(apiKey), + translator: translation.NewTranslator(&translation.Config{Provider: translationProvider, OpenAIKey: openAIKey, GoogleAPIKey: cli.GetGoogleAPIKey()}), translationCache: translation.NewTranslationCache(), - phoneticFetcher: phonetic.NewFetcher(apiKey), + phoneticFetcher: phonetic.NewFetcher(openAIKey), } } |
