From cf6eb20b00c206578078e342f77a4ee3de380e67 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 3 Apr 2026 10:45:19 +0300 Subject: fix: increase phonetic MaxOutputTokens from 50 to 200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/phonetic/fetcher.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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." ) -- cgit v1.2.3