Enable local Codex translation without API keys#1124
Open
XiaKaiYang wants to merge 1 commit into
Open
Conversation
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.
What changed
This PR adds a local Codex-based translation path for PDFMathTranslate, so users can translate PDFs through the local Codex CLI without wiring up any external translation API key.
Key changes:
codextranslator that uses the local Codex CLI1for the local CLI path instead of following the generic thread fanoutWhy this changed
The main goal is to make Codex usable as a local translation backend out of the box.
Before this change, users who wanted a Codex-style workflow still had to rely on external translation APIs or on a fragile short-text-only prototype. This PR makes the local CLI path practical for end-to-end PDF translation while keeping the integration surface simple.
User impact
Users can now translate with:
Notable behavior:
pdf2zh file.pdf -s codexis supportedCodex1for this translator pathValidation
Automated:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 /opt/anaconda3/bin/python3.12 -m pytest test/test_translator.py test/test_converter.py test/test_kernel.py -q/opt/anaconda3/bin/python3.12 -m compileall pdf2zh testLive checks:
MPC 跟踪控制.pdf