feat(translate): add text-mode Kagi Translate support#8
Merged
Conversation
Add a new kagi translate command that bootstraps translate.kagi.com from the existing session token, then calls detect, translate, alternatives, alignments, suggestions, and word insights over direct HTTP. Document the new command, update auth and coverage references, and note the current runtime dependency on python3 plus curl_cffi for bootstrap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kagi translatefor Kagi Translate text modetranslate_sessionfrom the existingKAGI_SESSION_TOKEN--from auto --to enbehaviorImplementation
https://translate.kagi.com/with reqwest and extractingtranslate_sessionfromSet-Cookietranslation.source_languageandtranslation.target_languagekagi translate --to autorequests with a config error before hitting the backendwarningswhile keeping the core translation resultKAGI_SESSION_TOKENscripts/demo-translate.shand ship generated GIF assets for docs previewsasciinema rec -c ./scripts/demo-*.shflowpython3 + curl_cffiruntime dependency and revert the extra Tokio process featureVerification
cargo testcargo test live_translate -- --ignored --nocapturecargo build./target/debug/kagi translate "Bonjour tout le monde"./target/debug/kagi translate "Bonjour tout le monde" --no-alternatives --no-word-insights --no-suggestions --no-alignments./target/debug/kagi translate "Bonjour tout le monde" --to auto./scripts/demo-translate.shasciinema rec --overwrite -c ./scripts/demo-translate.sh -q -i 0.2 --cols 92 --rows 22 /tmp/kagi-demos/translate.castagg --theme asciinema --font-size 14 --idle-time-limit 2 --last-frame-duration 4 /tmp/kagi-demos/translate.cast docs/demo-assets/translate.gifNotes