summaryrefslogtreecommitdiff
path: root/internal/phonetic/fetcher.go
AgeCommit message (Collapse)Author
2026-04-08feat(httpctx): add timeouts for OpenAI, Gemini, and HTTP downloadsPaul Buetow
Introduce internal/httpctx with non-zero http.Client timeouts for go-openai and google.golang.org/genai, shared image download client, and WithTimeoutUnlessSet for operation-level deadlines when callers use Background. Wire NewOpenAIClient/NewGenAIClient everywhere clients are constructed. Apply Search timeouts for DALL-E and Nano Banana, provider audio timeouts, model-list timeouts, Veo operation timeouts, story page download context, and single-word CLI processing cap. Made-with: Cursor
2026-04-06refactor: decompose Processor god object into focused files (SRP)Paul Buetow
Extract audio coordination (voice selection, config assembly, attribution writing) into audio_coordinator.go, card directory management into card_store.go, and image downloading/searcher construction into image_downloader.go. processor.go shrinks from ~1119 to ~575 lines, each file now has a single clear responsibility. Also apply go fmt to all touched files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03fix: disable Gemini thinking for phonetic IPA lookupPaul Buetow
Gemini 2.5 Flash runs internal reasoning by default. Those thinking tokens count against MaxOutputTokens, leaving almost no budget for the actual IPA output — hence the truncated [ˈɡlɛdɐm with no closing bracket. Set ThinkingBudget=0 in ThinkingConfig so all 200 output tokens are reserved for the IPA transcription itself. A simple dictionary-style lookup needs no chain-of-thought reasoning. Also included: audio_player layout fix (NewBorder center + TextWrapWord) so long IPA strings are not clipped in the GUI bar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03fix: increase phonetic MaxOutputTokens from 50 to 200Paul Buetow
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>
2026-04-02task 009/00i: remove internal translation from image clients; consolidate ↵Paul Buetow
provider normalization - task 009: remove translateBulgarianToEnglish from OpenAIClient and NanoBananaClient. Image clients no longer make internal translation API calls; callers must supply SearchOptions.Translation (processor and GUI already do). When translation is absent, opts.Query (the Bulgarian word) is used as fallback subject so image generation still proceeds. Update tests to pass translation via SearchOptions rather than relying on the removed fallback. - task 00i: consolidate duplicate ProviderGemini/ProviderOpenAI constants and normalizeProvider() functions from internal/translation and internal/phonetic into a shared config.NormalizeProvider(string) string in internal/config/provider.go. Both packages now delegate to the shared function so the normalization rule (lowercase, trim, default "gemini") has one authoritative home. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02Release v0.9.0v0.9.0Paul Buetow
2026-04-02Fix verification gate lint and test issuesPaul Buetow
2026-04-01zu: switch GUI phonetics to shared fetcherPaul Buetow
2026-04-01zs: preserve OpenAI default for phoneticsPaul Buetow
2026-04-01zs: add Gemini-backed phonetic fetchingPaul Buetow
2025-07-21feat: improve consistency between CLI and GUI modesPaul Buetow
- Fix batch mode to store cards in ~/.local/state/totalrecall/cards/ matching GUI behavior - Add --no-auto-play flag to disable automatic audio playback (enabled by default) - Simplify phonetic fetching in CLI to match GUI (IPA only, no detailed explanations) - Remove redundant --gui flag as GUI is already the default mode - Align image generation settings: both modes now use DALL-E 2 with 512x512 resolution 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-20Refactor main.go into focused packagesPaul Buetow
- Reduced main.go from 961 lines to 89 lines (91% reduction) - Created new packages for better separation of concerns: - cli: Command-line interface setup and configuration - processor: Core word processing logic and orchestration - batch: Batch file processing functionality - translation: Bulgarian to English translation services - models: OpenAI model listing functionality - phonetic: Phonetic information fetching - Each package has clear documentation in doc.go files - Improved testability and maintainability - All existing functionality preserved - All tests passing and build successful