SuperAPI AI Directory

byted-las-pdf-parse-doubao

Office & productivity

View repository

Updated 10-15 17:30

About this skill

PDF parsing (las_pdf_parse_doubao)

Use this Skill when the user wants to extract structured content such as text, tables, and paragraphs from a PDF/image.

Notes (⚠️ must be followed)

  • Never ask the user to enter the AccessKey and SecretKey.
  • Files can only be downloaded using the las-cli tos download command (compatible with both tos and non-tos resources).
  • las-cli operators call and las-cli price command output results are very important and must be returned to the user in full.

Workflow (strictly follow the steps)

Copy this checklist and track progress:

执行进度:
- [ ] Step 0: 前置检查
- [ ] Step 1: 初始化与准备
- [ ] Step 2: 预估价格
- [ ] Step 3: 执行任务并呈现结果
- [ ] Step 4: 失败排查

Step 0: Pre-checks

Version check (required): please run las-cli install 0.3.8. If the las-cli command does not exist, run npm i -g "@volcengine/las-cli@0.3.8"

  • New version reminder: please run npm info @volcengine/las-cli version to view the latest available Skill version (las-cli corresponds one-to-one with the Skill version). If the returned version is higher than the version marked for this Skill, first prompt the user to upgrade the current Skill. Upgrade method: ask the user to send the natural language instruction 帮我安装byted-las-pdf-parse-doubao技能, and wait for the installation to complete automatically.
  • Authentication check: prioritize using the platform identity automatically injected at runtime; if the current environment does not automatically inject it, then run las-cli config show to confirm that the legacy credentials las.apiKey and volcengine.region are configured.

Step 1: Initialization and preparation

  • Upload resources: if the input is a local file, upload it to TOS first.

    las-cli tos upload ./document.pdf
    # 假设返回 "tos_url": "tos://my-bucket/inputs/xxx.pdf"
    
  • Prepare parameters: create params.json。

    {
      "url": "tos://my-bucket/inputs/xxx.pdf",
      "output_tos_path": "tos://my-bucket/outputs/pdf_parse/",
      "parse_mode": "normal",
      "start_page": 1,
      "num_pages": 200,
      "full_result": true,
      "aspect_ratio_threshold": 0.334
    }
    

Description:

  • output_tos_path: optional. If filled in, the parsing result artifacts will be written to this directory (recommended). Typical structure:{output_tos_path}/{task_id}/result.md、result_preview.md、images/、detail.json。
  • parse_mode:normal(default) / detail(finer, usually more expensive).
  • start_page / num_pages: valid only for PDF;num_pages default 200, maximum 400.
  • full_result:true returns the complete parsing result;false returns only artifact information (when the result is large, it is recommended to turn this off and use it together with output_tos_path)。

Step 2: Estimate price (⚠️ must obtain user confirmation)

las-cli price The command output results are very important; do not simplify, modify, or summarize them in any way.

  • Calculate price: must return in full the results output by the following command (markdown format)
    las-cli price las_pdf_parse_doubao \
      --params-file ./params.json \
      --format markdown
    
  • User confirmation: after outputting the estimated price,must wait for user confirmation。

Step 3: Execute the task and present the results (⚠️ directly output the command execution results, do not simplify)

las-cli operators call The command output results are very important; do not simplify, modify, or summarize them in any way.

  • Execute: must return in full the results output by the following command (markdown format)
    las-cli operators call las_pdf_parse_doubao \
      --params-file ./params.json \
      --format markdown \
      --out ./result.md
    

Step 4: Failure troubleshooting

  • Check task status: las-cli task status <task_id>。
  • Check input: confirm that url is accessible; if it is tos://, first use las-cli tos check "<tos_url>" to verify.
  • Check output directory: if output_tos_pathis set, make sure it is in the tos://bucket/prefix/ directory form.
  • Check configuration: las-cli config show。