Conversation
BabelDOC 0.6.x only exposes --openai, so Google jobs run through a local OpenAI-compatible shim that calls Cloud Translation API (optional key) or the public Google Translate web endpoint. Hub LLM settings stay in place for abstract_zh, paper review, and HF daily trend. Co-authored-by: Daniel <znsoft@163.com>
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.
Hub admins can now pick Google Translate for paper PDF translation in Settings (
/settings, papers translate section). The choice persists in$PAPERS_DIR/translate-config.jsonand applies to new BabelDOC jobs without a redeploy.Why a shim (not
--google)Current BabelDOC (0.6.x on the papers stack) only exposes
--openai. Older BabelDOC/pdf2zhbuilds had--google; this one does not. Inventing a fake engine that still called Hub would not meet the goal.This PR keeps BabelDOC on
--openaiand points it at a local OpenAI-compatible shim that actually calls Google:google_api_keyis savedtranslate.googleapis.com/translate_a/single, fallbacktranslate.google.com/m) — the same family pdf2zh-next usesThe Python worker (
agent-papers/google_translate.py+translate_worker.py) is the primary path. The Go BabelDOC fallback starts the same kind of shim.What stays on Hub LLM
engineis PDF-only. Abstract ZH, paper review, and Hugging Face daily trend still use the existing Hub / OpenAI-compatible snapshot (base_url/api_key/model). Those need chat completions; Google is a machine-translation path, not a chat model.Settings / credentials
google_api_key); empty does not wipe;clear_google_api_keydeletestranslate-config.jsonremains gitignored)Tests
Input:payload onlyOps notes
--openai+ translate-config behavior unchanged