mirror of
https://github.com/hoshikawa2/openclaw-oci-pptx.git
synced 2026-03-03 16:09:35 +00:00
82 lines
2.8 KiB
Plaintext
82 lines
2.8 KiB
Plaintext
Whenever the user requests PPTX generation with external material (link, file, or text):
|
||
|
||
----------------------------------------------
|
||
STEP 1 – PREPARATION (MANDATORY)
|
||
----------------------------------------------
|
||
|
||
GITHUB LINK HANDLING (REQUIRED)
|
||
|
||
If the link contains:
|
||
github.com/.../blob/...
|
||
Automatically convert to:
|
||
raw.githubusercontent.com/USER/REPO/BRANCH/PATH
|
||
BEFORE calling read_url.
|
||
|
||
Example:
|
||
Original:
|
||
https://github.com/user/repo/blob/main/app.py
|
||
Convert to:
|
||
https://raw.githubusercontent.com/user/repo/main/app.py
|
||
Then call:
|
||
$HOME/.openclaw/workspace/openclaw_folder/read_url <raw_url>
|
||
|
||
If the returned content contains <html or <script>, extract only visible text, removing HTML tags.
|
||
|
||
* If the content cannot be read successfully → ABORT.
|
||
|
||
MANDATORY PIPELINE:
|
||
|
||
Generate a JSON structure with:
|
||
|
||
STRICT JSON RULES:
|
||
|
||
- Use double quotes only.
|
||
- No trailing commas.
|
||
- No comments.
|
||
- No markdown.
|
||
- No text before or after JSON.
|
||
- No backticks.
|
||
- No explanations.
|
||
- Output must start with { and end with }.
|
||
|
||
Drive the content of this presentation analyzing the content of the link.
|
||
|
||
cover_title (string)
|
||
introduction, technologies, architecture, problems, demo, conclusion (objects)
|
||
- Each chapter object MUST have:
|
||
bullets: 3–6 bullets (short, objective)
|
||
keywords: 5–12 terms that appear literally in the material
|
||
evidence: 2–4 short excerpts (10–25 words) taken from the material, without HTML
|
||
- It is FORBIDDEN to use generic bullets without keywords from the material.
|
||
- VALIDATION: if it is not possible to extract at least 20 unique keywords from the total material → ABORT.
|
||
|
||
3) Save the JSON structure in the $HOME/.openclaw/workspace/openclaw_folder/content.json file
|
||
|
||
----------------------------------------------
|
||
STEP 2 – EXECUTION
|
||
----------------------------------------------
|
||
|
||
Only now execute:
|
||
|
||
SET THE ENVIRONMENT VARIABLES AND EXECUTE PYTHON CODE:
|
||
|
||
`export OCI_LINK_DEMO=<link passed as documentation>`
|
||
`export OPENCLAW_WORKDIR=$HOME/.openclaw/workspace/openclaw_folder`
|
||
`python $HOME/.openclaw/workspace/openclaw_folder/generate_openclaw_ppt_template.py`
|
||
|
||
----------------------------------------------
|
||
STEP 3 – UPLOAD
|
||
----------------------------------------------
|
||
|
||
First, delete the file in object storage: `openclaw_oci_presentation.pptx`
|
||
|
||
And only then upload it to Object Storage: `oci os object put \
|
||
--bucket-name hoshikawa_template \
|
||
--file` $HOME/.openclaw/workspace/openclaw_folder/openclaw_oci_presentation.pptx \
|
||
--force
|
||
|
||
----------------------------------------------
|
||
STEP 4 – GENERATE PRE-AUTH LINK
|
||
----------------------------------------------
|
||
oci os preauth-request create ...
|