AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Document Granular Decompose

skill-tiangong-ai-agent-skills-document-granular-decompose · by tiangong-ai

Upload local documents to TianGong AI Unstructure `/mineru_with_images` API for fine-grained parsing and return only plain fulltext content. Use when a task needs document fulltext extraction with `return_txt=true`, strict file-type allowlist validation, API base URL/auth token from environment variables, and optional provider/model overrides.

— No reviews yet
0 installs
0 views
— view→install

Install

$ agentstack add skill-tiangong-ai-agent-skills-document-granular-decompose

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ● Environment & secrets Used
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-tiangong-ai-agent-skills-document-granular-decompose)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
● 12d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Document Granular Decompose? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Document Granular Decompose

Core Goal

  • Parse a local document through POST /mineru_with_images.
  • Always force return_txt=true.
  • Read environment variables for endpoint, request identity, and model routing:
  • UNSTRUCTURED_API_BASE_URL (example: https://your-unstructured-host:7770)
  • UNSTRUCTURED_AUTH_TOKEN
  • UNSTRUCTURED_PROVIDER (optional)
  • UNSTRUCTURED_MODEL (optional)
  • Return only plain fulltext (prefer API txt; fallback to joined result[].text).

Triggering Conditions

  • Need robust document fulltext extraction for PDF/Office/image files.
  • Need image-aware MinerU parsing but only textual output for downstream chunking/search/summarization.
  • Need to standardize provider/model/token input via environment variables instead of ad-hoc command parameters.

Workflow

  1. Prepare environment variables.
export UNSTRUCTURED_AUTH_TOKEN="your-fastapi-bearer-token"
export UNSTRUCTURED_API_BASE_URL="https://your-unstructured-host:7770"
# Optional routing overrides. Omit them to let the server choose its defaults.
export UNSTRUCTURED_PROVIDER="vllm"
export UNSTRUCTURED_MODEL="Qwen/Qwen3.5-122B-A10B-FP8"
  1. Run extraction and print fulltext to stdout.
python3 scripts/mineru_fulltext_extract.py \
  --file "/absolute/path/to/document.pdf"
  1. Save fulltext to a local file when needed.
python3 scripts/mineru_fulltext_extract.py \
  --file "/absolute/path/to/document.pdf" \
  --output "/absolute/path/to/fulltext.txt"

Request Contract

  • Endpoint resolution:
  • --api-url if provided
  • else UNSTRUCTURED_API_BASE_URL + /mineru_with_images
  • else fail fast with missing environment variable error
  • Method: POST multipart form.
  • Query params:
  • Force return_txt=true (always set by script).
  • Form fields sent:
  • file (required)
  • provider (optional, from UNSTRUCTURED_PROVIDER when set)
  • model (optional, from UNSTRUCTURED_MODEL when set)
  • Header sent:
  • Authorization: Bearer $UNSTRUCTURED_AUTH_TOKEN

Supported File Types (Strict)

  • Supported file types:
  • .bmp, .doc, .docm, .docx, .dot, .dotx, .gif, .jp2, .jpeg, .jpg, .odp, .odt, .pdf, .png, .pot, .potx, .pps, .ppsx, .ppt, .pptm, .pptx, .tiff, .webp, .xls, .xlsm, .xlsx, .xlt, .xltx
  • Office formats:
  • .doc, .docm, .docx, .dot, .dotx, .odp, .odt, .pot, .potx, .pps, .ppsx, .ppt, .pptm, .pptx, .xls, .xlsm, .xlsx, .xlt, .xltx
  • Any other extension is rejected before sending API requests.

Output Rules

  • Success output must be plain text fulltext only.
  • Normalize the confirmed upstream Markdown underscore escape (\_ to _)

in both supported response paths; preserve other backslashes and escapes.

  • Fulltext source priority:
  1. response.txt
  2. join non-empty response.result[].text by blank lines
  • Do not output chunk metadata/json unless the user explicitly requests debugging.

Error Handling

  • Missing required env vars (UNSTRUCTURED_API_BASE_URL, UNSTRUCTURED_AUTH_TOKEN): fail fast with actionable message.
  • Missing UNSTRUCTURED_PROVIDER or UNSTRUCTURED_MODEL: omit the form field and let the service choose its default.
  • HTTP 401/403: report token/auth issue.
  • HTTP 4xx/5xx: print status and API error body if available.
  • Missing text in response: fail with explicit schema mismatch error.

References

  • references/env.md
  • references/request-response.md

Assets

  • assets/config.example.env

Scripts

  • scripts/mineru_fulltext_extract.py

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.