计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
upload-files【效率与协作】Turn local files or user attachments into public URLs by uploading them to the Gradio server, so tools that require http(s) URLs (htr_transcribe, the viewer) can reach them. Use when you have local images or ALTO/PAGE XML — an attachment or a file path — but a tool needs a URL.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Upload local files or user-provided attachments (images, XML, etc.) to the
Gradio server so they become publicly accessible URLs. These URLs can then
be passed to tools like htr_transcribe or the document viewer.
If you already have http/https URLs (e.g. IIIF links, public image URLs), skip this skill entirely and pass them directly to the target tool.
The upload target is the Gradio Space that backs the HTR MCP server:
https://riksarkivet-htr-demo.hf.space
Override with the HTR_SPACE_URL environment variable if set.
If the user attached files in the conversation (not already on disk), save them first. Claude attachments are available as content in the conversation — write them to temporary files.
For each file, POST to the Gradio upload endpoint:
curl -s -X POST "https://riksarkivet-htr-demo.hf.space/gradio_api/upload" \
-F "files=@/path/to/filename.jpg"
Response is a JSON array of server paths:
["/tmp/gradio/abc123def/filename.jpg"]
For each server path returned, construct the public URL:
https://riksarkivet-htr-demo.hf.space/gradio_api/file=/tmp/gradio/abc123def/filename.jpg
Pattern: {base_url}/gradio_api/file={server_path}
Gather all constructed URLs before passing them to the target tool. Present the URLs to the user so they can verify the uploads succeeded.
You can upload multiple files in a single request:
curl -s -X POST "https://riksarkivet-htr-demo.hf.space/gradio_api/upload" \
-F "files=@page1.jpg" \
-F "files=@page2.jpg" \
-F "files=@page3.jpg"
Response:
[
"/tmp/gradio/abc123/page1.jpg",
"/tmp/gradio/abc123/page2.jpg",
"/tmp/gradio/abc123/page3.jpg"
]
Prefer batch upload over individual uploads when possible.
| Type | Extensions | Use with |
|---|---|---|
| Images | .jpg, .jpeg, .png, .tif, .tiff | htr_transcribe, document viewer |
| ALTO XML | .xml | document viewer (text layer overlay) |
| PAGE XML | .xml | document viewer (text layer overlay) |
Once you have public URLs, pass them to the appropriate tool:
htr_transcribe with image_urls=[...]view_document with image_urls=[...] and optionally text_layer_urls=[...]