feat(ocr): add higher-level text search helpers
All checks were successful
python-syntax / syntax-check (push) Successful in 6s
All checks were successful
python-syntax / syntax-check (push) Successful in 6s
This commit is contained in:
35
docs/API.md
35
docs/API.md
@@ -432,6 +432,41 @@ Notes:
|
||||
- Requires `tesseract` executable plus Python package `pytesseract`.
|
||||
- If `tesseract` is not on `PATH`, set `CLICKTHROUGH_TESSERACT_CMD` to the full executable path.
|
||||
|
||||
## `POST /ocr/find`
|
||||
|
||||
Search OCR output for matching text instead of post-processing raw OCR blocks client-side.
|
||||
|
||||
Query params:
|
||||
|
||||
- `screen` (int, default `0`) - used for `mode=screen` and `mode=region`
|
||||
|
||||
```json
|
||||
{
|
||||
"mode": "screen",
|
||||
"query": "Settings",
|
||||
"match": "contains",
|
||||
"group_lines": true,
|
||||
"max_results": 10,
|
||||
"language_hint": "eng",
|
||||
"min_confidence": 0.4
|
||||
}
|
||||
```
|
||||
|
||||
Modes:
|
||||
- `screen`
|
||||
- `region`
|
||||
- `image`
|
||||
|
||||
Options:
|
||||
- `match`: `contains`, `exact`, or `regex`
|
||||
- `group_lines=true`: combine nearby OCR words into line-level candidates before matching
|
||||
- `max_results`: result cap after confidence sorting
|
||||
|
||||
Response includes:
|
||||
- `matches` — confidence-sorted candidate matches
|
||||
- `match_count`
|
||||
- `blocks_considered`
|
||||
|
||||
## `POST /exec`
|
||||
|
||||
Execute a shell command on the host running Clickthrough.
|
||||
|
||||
Reference in New Issue
Block a user