This skill provides OCR (Optical Character Recognition) functionality using models available via OpenRouter. It uses the OpenAI Python library to communicate with OpenRouter's API, specifically designed for models like Baidu's Qianfan OCR.
Quick Start
When you need to extract text from an image:
Ensure prerequisites:
Python 3.x installed
Required packages: openai, requests (install via pip install openai requests)
Place your OpenRouter API key in the file: C:\Users\Administrator\.openclaw\secrets\openrouter.env
(format: OPENROUTER_API_KEY=your_key_here)
Call the OCR script with an image URL or local file path:
bash
python ocr.py <image_input> [prompt]
image_input: Either a URL or a local file path to the image
prompt: Optional text prompt for the OCR (default: "OCR提取图片所有文字")
Get result: The script prints the extracted text to stdout.