bug fix. PROMPT OK

This commit is contained in:
2026-02-27 13:57:45 -03:00
parent c9a8bc8da2
commit 0c8861e07d
2 changed files with 18 additions and 49 deletions

View File

@@ -364,7 +364,6 @@ def run_exec_loop(body: dict, max_steps: int = 10000) -> dict:
if m_done: if m_done:
final_text = m_done.group(1).strip() final_text = m_done.group(1).strip()
# devolve em formato OpenAI no fim
return { return {
**last, **last,
"choices": [{ "choices": [{

View File

@@ -1,28 +1,9 @@
Whenever the user requests PPTX generation with external material (link, file, or text): Whenever the user requests PPTX generation with external material (link, file, or text):
----------------------------------------------
STEP 0 FIXED WORKING DIRECTORY (MANDATORY)
----------------------------------------------
All operations MUST occur inside:
$HOME/.openclaw/workspace/openclaw_folder
Execute:
cd $HOME/.openclaw/workspace/openclaw_folder
---------------------------------------------- ----------------------------------------------
STEP 1 PREPARATION (MANDATORY) STEP 1 PREPARATION (MANDATORY)
---------------------------------------------- ----------------------------------------------
The file generate_openclaw_ppt_template.py is located in $HOME/.openclaw/workspace/openclaw_folder
The file read_url is located in $HOME/.openclaw/workspace/openclaw_folder
The file read_file is located in $HOME/.openclaw/workspace/openclaw_folder
Required:
read_url for links
read_file for local files
GITHUB LINK HANDLING (REQUIRED) GITHUB LINK HANDLING (REQUIRED)
If the link contains: If the link contains:
@@ -37,7 +18,7 @@ GITHUB LINK HANDLING (REQUIRED)
Convert to: Convert to:
https://raw.githubusercontent.com/user/repo/main/app.py https://raw.githubusercontent.com/user/repo/main/app.py
Then call: Then call:
read_url <raw_url> $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 returned content contains <html or <script>, extract only visible text, removing HTML tags.
@@ -45,13 +26,18 @@ GITHUB LINK HANDLING (REQUIRED)
MANDATORY PIPELINE: MANDATORY PIPELINE:
1) Save material to file: Generate a JSON structure with:
(exec read_url <url> > $HOME/.openclaw/workspace/openclaw_folder/material_raw.txt)
2) Analyze material_raw.txt and generate content.json explicitly: STRICT JSON RULES:
(exec cat > $HOME/.openclaw/workspace/openclaw_folder/content.json << 'EOF'
<valid JSON only> - Use double quotes only.
EOF) - 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. Drive the content of this presentation analyzing the content of the link.
@@ -64,38 +50,22 @@ MANDATORY PIPELINE:
- It is FORBIDDEN to use generic bullets without keywords from the material. - 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. - VALIDATION: if it is not possible to extract at least 20 unique keywords from the total material → ABORT.
3) Validate JSON: 3) Save the JSON structure in the $HOME/.openclaw/workspace/openclaw_folder/content.json file
(exec python -m json.tool $HOME/.openclaw/workspace/openclaw_folder/content.json)
Only after successful validation:
(exec export OCI_LINK_DEMO="<url>")
(exec python generate_openclaw_ppt_template.py)
---------------------------------------------- ----------------------------------------------
STEP 2 MODIFICATION VALIDATION [STRICT VERSION] STEP 2 EXECUTION
----------------------------------------------
Before running:
- Verify that each chapter contains at least 1 literal keyword from the material.
- Verify that at least 8 keywords appear in 4 or more slides.
- Verify that each chapter contains at least 1 piece of evidence.
If it fails → ABORT.
----------------------------------------------
STEP 3 EXECUTION
---------------------------------------------- ----------------------------------------------
Only now execute: Only now execute:
SET THE ENVIRONMENT VARIABLE WITH THE URL PASSED AS A BASIS FOR DOCUMENTATION AND THE FILE NAME GENERATED WITH CONTENT READ FROM THE LINK: SET THE ENVIRONMENT VARIABLES AND EXECUTE PYTHON CODE:
`export OCI_LINK_DEMO=<link passed as documentation>` `export OCI_LINK_DEMO=<link passed as documentation>`
`export OCI_CONTENT_FILE=<NAME OF THE GENERATED FILE>` `export OPENCLAW_WORKDIR=$HOME/.openclaw/workspace/openclaw_folder`
`python $HOME/.openclaw/workspace/openclaw_folder/generate_openclaw_ppt_template.py` `python $HOME/.openclaw/workspace/openclaw_folder/generate_openclaw_ppt_template.py`
---------------------------------------------- ----------------------------------------------
STEP 4 UPLOAD STEP 3 UPLOAD
---------------------------------------------- ----------------------------------------------
First, delete the file in object storage: `openclaw_oci_presentation.pptx` First, delete the file in object storage: `openclaw_oci_presentation.pptx`
@@ -106,6 +76,6 @@ STEP 4 UPLOAD
--force --force
---------------------------------------------- ----------------------------------------------
STEP 5 GENERATE PRE-AUTH LINK STEP 4 GENERATE PRE-AUTH LINK
---------------------------------------------- ----------------------------------------------
oci os preauth-request create ... oci os preauth-request create ...