Skip to content

Commit 102fcc8

Browse files
committed
replace with sync api.
1 parent a6d74d7 commit 102fcc8

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

pdflux-saas-markdown/SKILL.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata: {"author":"PAODINGAI","version":"1.0.1","openclaw":{"emoji":"📝","re
66

77
# PDFlux-PDF2Markdown
88

9-
Run a JavaScript workflow that uploads a single local file to the `pdflux` service through PDRouter, polls the parsing status, and then downloads the resulting Markdown. This is suitable for document parsing, table extraction, content verification, and handing document content off to follow-up scripts.
9+
Run a JavaScript workflow that submits a single local file to the `pdflux` synchronous API through PDRouter (`POST /openapi/{serviceCode}/file/markdown`) and prints the response result in one step. This is suitable for document parsing, table extraction, content verification, and handing document content off to follow-up scripts.
1010

1111
## Installation
1212

@@ -22,7 +22,7 @@ node skills/pdflux-saas-markdown/scripts/upload_to_markdown.js <local-file-path>
2222

2323
## Execution Constraints
2424

25-
- You must invoke `scripts/upload_to_markdown.js` directly. Do not reimplement the upload, polling, and Markdown download flow yourself.
25+
- You must invoke `scripts/upload_to_markdown.js` directly. Do not reimplement the API flow yourself.
2626
- The behavior contract below explains what the script does, what it outputs, and when to use it. It is not a manual checklist for the model to imitate step by step.
2727
- Even if the task is only to extract tables, read fields, inspect body text, or prepare input for later scripts, you must run this script first and continue from the generated Markdown.
2828
- Only inspect or modify the script implementation when the script itself is unavailable, failing, or needs a fix. Do not bypass it during normal use.
@@ -49,11 +49,11 @@ node skills/pdflux-saas-markdown/scripts/upload_to_markdown.js <local-file-path>
4949
## Script Behavior
5050

5151
1. Read the token from `PD_ROUTER_API_KEY`. If it is missing, fail immediately and prompt the AI to ask the user for a key or inject the environment variable first.
52-
2. Upload the file with `POST /openapi/{serviceCode}/upload` using `Authorization: Bearer <token>`.
53-
3. Poll `GET /openapi/{serviceCode}/document/{uuid}` until `parsed === 2`.
54-
4. Fail immediately if the parsing status becomes negative.
55-
5. Download the Markdown from `GET /openapi/{serviceCode}/document/{uuid}/markdown`.
56-
6. If `output-markdown-path` is provided, the script also writes the Markdown to that file while still printing it to stdout.
57-
7. The script writes progress and errors to stderr and returns a non-zero exit code on failure.
58-
8. When the goal is to retrieve specific content, fields, or tables, read the parsed result and return only the necessary information instead of echoing the full raw Markdown to the user.
59-
9. When the user explicitly asks to "convert to Markdown", "output Markdown", or expresses an equivalent intent, return the Markdown content directly rather than only a summary or extracted fields.
52+
2. Send one request with the local file to `POST /openapi/{serviceCode}/file/markdown` using `Authorization: Bearer <token>`.
53+
3. Parse the final API response and output:
54+
- Markdown text if the response contains a markdown field.
55+
- Otherwise, output the JSON response payload.
56+
4. If `output-markdown-path` is provided, the script also writes the same output text to that file while still printing it to stdout.
57+
5. The script writes progress and errors to stderr and returns a non-zero exit code on failure.
58+
6. When the goal is to retrieve specific content, fields, or tables, read the parsed result and return only the necessary information instead of echoing full raw output to the user.
59+
7. When the user explicitly asks to "convert to Markdown", "output Markdown", or expresses an equivalent intent, return the Markdown content directly when present in the API response.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
interface:
22
display_name: "PDFlux SaaS Markdown"
33
short_description: "Parse docs and tables from PDF, DOCX, and images"
4-
default_prompt: "Always execute the bundled scripts/upload_to_markdown.js script to parse one local PDF, DOCX, PPT, image, or similar file. If the user explicitly asks to convert to markdown or output markdown, return the markdown content directly; otherwise extract only the document content or tables needed for the task."
4+
default_prompt: "Always execute the bundled scripts/upload_to_markdown.js script, which calls the synchronous /openapi/{serviceCode}/file/markdown API for one local PDF, DOCX, PPT, image, or similar file. If the user explicitly asks to convert to markdown or output markdown, return markdown content directly when present in the API response; otherwise extract only the document content or tables needed for the task."

0 commit comments

Comments
 (0)