Help users locate their packages on delivery shelves by matching pickup codes to shelf photos. Trigger this skill when a user mentions finding packages, picking up deliveries, or anything related to 取快递/找包裹/取件/快递柜/驿站. This includes phrases like '帮我找快递', '我要取件', '取件码是...', '快递在哪', or similar. Even if the user just sends a pickup code (like 5-2-1234) in a delivery context, activate this skill.
Help users find their packages on delivery station shelves. The user provides a pickup code and shelf photos, and you identify which package matches — marking it with a red bounding box and sending the annotated image back.
This skill combines two approaches:
Ask the user for their pickup code. Speak in Chinese — this is a Chinese-locale feature.
The user may respond with:
Pickup code format: Typically X-Y-ZZZZ where X = shelf/section number, Y = row/layer, ZZZZ = code digits. Variations exist — some use Chinese characters, some just numbers. Extract whatever looks like a pickup reference code.
If the user sends an image, use your vision capabilities to read the pickup code from it. Look for patterns like:
取件码:5-2-1234货架号:5 取件码:1234格口:5-2-1234Confirm the extracted code with the user before proceeding: "我识别到的取件码是 5-2-1234,对吗?"
Once you have the confirmed pickup code, ask the user to take photos of the package shelves. Tell them:
"请拍一下货架的照片发给我,可以一次发多张~"
The user may send:
For each shelf photo, use the one-stop script that runs OCR detection, matches pickup codes, and annotates the image:
python3 {baseDir}/scripts/find_package.py \
--input /path/to/shelf_photo.jpg \
--code "9347" \
--output /tmp/find-package-result.jpg
For multiple pickup codes at once:
python3 {baseDir}/scripts/find_package.py \
--input /path/to/shelf_photo.jpg \
--code "9347,0295,1339" \
--output /tmp/find-package-result.jpg
The script outputs JSON to stdout with match results:
{
"total_codes": 3,
"found": 2,
"not_found": 1,
"matched": [
{"text": "9347", "bbox": [45, 280, 130, 340], "confidence": 0.95, "matched_code": "9347"},
{"text": "0295", "bbox": [200, 310, 350, 360], "confidence": 0.92, "matched_code": "0295"}
],
"unmatched_codes": ["1339"],
"output_image": "/tmp/find-package-result.jpg"
}
If you need finer control, the two steps can be run separately:
# Step 1: OCR detect
python3 {baseDir}/scripts/ocr_detect.py \
--input /path/to/shelf_photo.jpg \
--output /tmp/detections.json
# Step 2: Annotate matches
python3 {baseDir}/scripts/annotate.py \
--input /path/to/shelf_photo.jpg \
--output /tmp/find-package-result.jpg \
--detections /tmp/detections.json \
--match "9347"
After getting the annotated image, send it back to the user via the message tool.
When a package is found:
If the user has multiple pickup codes (they mentioned several or you detected multiple in the screenshot):
When all packages are found:
When no match found after all photos:
X-Y-ZZZZ (e.g., 5-2-1234)Use the message tool with channel: "telegram":
{
"action": "send",
"channel": "telegram",
"message": "请发一下你的取件码~可以直接打字,也可以截图给我"
}
Send with annotated image:
{
"action": "send",
"channel": "telegram",
"message": "找到了!你的快递在红框标记的位置",
"media": "file:///tmp/find-package-result.jpg"
}