Introduction¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When an agent workflow needs to process identity documents and extract structured information, the task usually involves cumbersome image processing and parsing logic. The xby-ocr-pass plugin aims to encapsulate this process behind a standard interface, allowing developers to invoke the recognition capability directly.
Plugin Overview¶
This is a model-inference plugin maintained by xby-skill under the MIT license. It focuses on Hong Kong and Macao travel permits and Taiwan travel permits, recognizing information such as document number, name, gender, date of birth, expiration date, and issuance location. It also supports MRZ (machine-readable zone) parsing.
Installation¶
Run the following command in the terminal to install it:
dsh plugin --profile web add github:xby_skill/xby-ocr-pass
After installation, the plugin will be loaded and take effect when the DSH process starts.
Core Features¶
The plugin provides the following four main function interfaces:
-
set_xby_apikey
Sets the API key in a chat or interactive environment. This setting is automatically persisted and remains valid after DSH is restarted. -
ocr_pass
Runs travel permit recognition. It requires an image file link as input. The recognition result includes fields such as travel permit number, name, gender, date of birth, expiration date, and issuance location, and supports MRZ machine-readable zone parsing. -
ocr_pass_for_data_base64
Runs travel permit recognition. It requires the BASE64-encoded image data as input. The recognition logic is the same as above, but the input is an encoded string. -
ocr_pass_for_data_file
Runs travel permit recognition. It requires a file path for the image as input. The recognition logic is the same as above, but the input is a local file path.
Configuration and Usage¶
Obtaining the API Key¶
The plugin depends on an external OCR service and requires an API key. Please visit the Xiaobenyang official website to register and obtain your API key.
Usage Steps¶
- In the DSH environment, call the
set_xby_apikeyinterface and pass in the API key obtained from the official website. - Depending on the source of the input data, select
ocr_pass,ocr_pass_for_data_base64, orocr_pass_for_data_file. - Ensure that the input image link, BASE64 encoding, or file path is valid and conforms to the document format.
Notes¶
- The plugin requires a valid API key; otherwise, recognition will not succeed.
- Different recognition commands have different input requirements:
ocr_passrelies on a link, while the other two rely on Base64 or a file path. - Before use, it is recommended to review the source code and license (MIT) to ensure compliance with your project requirements.