Fix #263: 使用阿里的ocr服务,是否需要在配置里面加入OCR_ACCESS_KEY_ID和OCR_ACCESS_KEY_SECRET#277
Closed
JiwaniZakir wants to merge 1 commit intoX-PLUG:mainfrom
Closed
Fix #263: 使用阿里的ocr服务,是否需要在配置里面加入OCR_ACCESS_KEY_ID和OCR_ACCESS_KEY_SECRET#277JiwaniZakir wants to merge 1 commit intoX-PLUG:mainfrom
JiwaniZakir wants to merge 1 commit intoX-PLUG:mainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Closing this PR as it hasn't received maintainer review. Happy to resubmit if there's interest. |
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.
Closes #263
Adds
OCR_ACCESS_KEY_IDandOCR_ACCESS_KEY_SECRETas explicit fields inPC-Agent/config.json, and replaces direct dict access inrun.py(lines ~122-123) withtoken_data.get(...)calls that raise a descriptiveValueErrorwhen either key is missing or empty, rather than silently producing aKeyErroror passing empty strings to the Alibaba Cloud OCR client. This prevents the confusing timeout/connection error users encountered when the credentials were absent.PC-Agent/config.json: addedOCR_ACCESS_KEY_IDandOCR_ACCESS_KEY_SECRETplaceholder fieldsPC-Agent/run.py: replacedtoken_data['OCR_ACCESS_KEY_ID']/token_data['OCR_ACCESS_KEY_SECRET']with.get()calls and an explicit validation guard in theargs.ocr_api == 1branchVerified by running with a missing
OCR_ACCESS_KEY_IDinconfig.jsonto confirm theValueErroris raised immediately with a clear message, and by running with valid credentials to confirm the OCR path proceeds without regression.