summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-03 10:45:19 +0300
committerPaul Buetow <paul@buetow.org>2026-04-03 10:45:19 +0300
commitcf6eb20b00c206578078e342f77a4ee3de380e67 (patch)
tree6f5bf42e474f0523761867b3a54f1e26dd28dc35
parentd53b03d280363ecc6068ba93985adfc4defee956 (diff)
fix: increase phonetic MaxOutputTokens from 50 to 200
Gemini 2.5 Flash emits internal reasoning tokens before the IPA bracket pair. With the 50-token cap the output was silently truncated to just [ˈ, losing the rest of the transcription. 200 tokens is ample headroom for any Bulgarian word or short phrase while keeping the response focused. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--internal/phonetic/fetcher.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/phonetic/fetcher.go b/internal/phonetic/fetcher.go
index d10d6c1..04db171 100644
--- a/internal/phonetic/fetcher.go
+++ b/internal/phonetic/fetcher.go
@@ -27,7 +27,10 @@ const (
phoneticTimeout = 30 * time.Second
phoneticRetryCount = 3
phoneticTemperature = 0.3
- phoneticMaxTokens = 50
+ // 200 tokens gives ample room for IPA of multi-syllable Bulgarian phrases.
+ // 50 was too tight: Gemini 2.5 Flash can emit several thinking tokens before
+ // the IPA bracket pair, causing the output to be silently truncated mid-symbol.
+ phoneticMaxTokens = 200
phoneticSystemPrompt = "You are a Bulgarian language expert. Provide only the IPA (International Phonetic Alphabet) transcription for Bulgarian words. Return ONLY the IPA transcription in square brackets, nothing else. No explanations, no word labels, just the IPA."
)