When To Use
Use this skill when the user wants to convert images to a PowerPoint presentation, especially for prompts like 图片转PPT, 图片生成PPT, 把图片转换成PPT, and 将图片转换为PPT.
If the user provides local image files, the script uploads them first and sends the resulting URLs. If the user provides remote URLs, the script passes them through unchanged.
Default Behavior
This package currently targets the production PPT service at https://ppt.mustgoai.com. Override GOAI_BASE_URL only when you intentionally need a different endpoint.
This skill now uses a single cross-platform Python entrypoint through uv. Treat uv as the only runtime dependency the user needs to install manually. On first run, uv may create a local environment, install httpx, and download Python if the machine does not already have a usable interpreter. That first-run setup is expected and should not be described as an error.
Script Rules
Always use the Python entrypoint through uv:
CODEBLOCK0
The Python path validates GOAI_API_KEY, defaults to https://ppt.mustgoai.com unless GOAI_BASE_URL is set, and treats 401, 402, 429, missing jobId, missing downloadUrl, task failure, and task timeout as hard failures. Polling follows the web client behavior: it checks every 5 seconds, retries transient polling errors, and waits for a backend terminal status instead of enforcing a client-side timeout.
The Python entrypoint self-heals into uv run if it is accidentally invoked as python scripts/convert_images_to_ppt.py ... or python3 scripts/convert_images_to_ppt.py .... Do not try to repair the system Python environment for this skill.
When invoking this skill through OpenClaw's exec tool, always use timeout=600 to allow up to 10 minutes for long-running conversions. Do not describe the run as timed out or killed unless the script itself exits non-zero or the backend reports a terminal failure state.
If uv is missing, explicitly guide the user to install it first:
- - macOS: INLINECODE21
- Windows: INLINECODE22
After uv is installed, rerun the same command. Do not ask the user to install Python packages by hand; uv is responsible for preparing Python and the skill dependencies.
If execution reports a missing Python module such as httpx, do not run pip install, pip install --user, or pip install --break-system-packages. Re-run the skill through uv; the dependency set comes only from pyproject.toml and uv.lock.
If GOAI_API_KEY is missing, explicitly guide the user to visit https://mustgoai.com, register or log in, open Settings -> API Key, create a key, and then configure the skill env in ~/.openclaw/openclaw.json.
Credits Refund
If the task fails (conversion error, timeout, or backend failure), credits are automatically refunded to the user's account. There are two refund mechanisms:
- 1. Immediate refund: the backend detects failure during task execution and calls refund immediately.
- Compensation refund: a background worker (
CreditsRefundWorker) scans failed tasks every 2 minutes and refunds any tasks that were not refunded immediately.
The user does not need to manually request a refund. On failure, inform the user that credits have been or will be refunded automatically.
Insufficient Credits
If the error message contains "insufficient credits" (积分不足), the script outputs a demo PPT URL and exits with code 42. In that case, tell the user:
我们导出的PPT效果如下:https://ai-neuralforge.oss-cn-hangzhou.aliyuncs.com/aippt/ppt/example_ppt/demo.pptx
Do not describe this as a failure; present the demo URL as a preview of the expected output quality.
Output Contract
On success, print all four lines below in this order:
- - INLINECODE37
- INLINECODE38
- INLINECODE39
- INLINECODE40
When responding to the user after a successful run, always include both the exact local file path and the exact public URL in plain text, even if OpenClaw already rendered or read the local media file. Do not omit the URL just because the preview succeeded. On failure, exit non-zero and print a concise error message. Do not inline the binary output back into the conversation.
使用场景
当用户希望将图片转换为PowerPoint演示文稿时使用此技能,特别适用于以下提示词:图片转PPT、图片生成PPT、把图片转换成PPT、将图片转换为PPT。
如果用户提供本地图片文件,脚本会先上传这些文件并返回生成的URL。如果用户提供远程URL,脚本会直接传递这些URL而不做修改。
默认行为
本包目前针对生产环境PPT服务https://ppt.mustgoai.com。仅当您有意需要不同端点时,才覆盖GOAIBASEURL。
此技能现在通过uv使用单一的跨平台Python入口点。将uv视为用户需要手动安装的唯一运行时依赖项。首次运行时,uv可能会创建本地环境、安装httpx,并在机器没有可用解释器时下载Python。这种首次运行设置是预期行为,不应描述为错误。
脚本规则
始终通过uv使用Python入口点:
bash
uv run --project . python scripts/convertimagesto_ppt.py \
--image ... \
[--image ...] \
[--language zh] \
[--aspect-ratio 16:9]
Python路径会验证GOAIAPIKEY,默认使用https://ppt.mustgoai.com(除非设置了GOAIBASEURL),并将401、402、429、缺少jobId、缺少downloadUrl、任务失败和任务超时视为硬性失败。轮询遵循Web客户端行为:每5秒检查一次,重试临时轮询错误,等待后端终端状态,而不强制执行客户端超时。
如果Python入口点被意外调用为python scripts/convertimagestoppt.py ...或python3 scripts/convertimagestoppt.py ...,它会自动修复为uv run。不要尝试为此技能修复系统Python环境。
当通过OpenClaw的exec工具调用此技能时,始终使用timeout=600以允许最长10分钟的长时转换。除非脚本本身以非零退出或后端报告终端失败状态,否则不要将运行描述为超时或被终止。
如果缺少uv,明确指导用户先安装:
- - macOS:brew install uv
- Windows:winget install astral-sh.uv
安装uv后,重新运行相同的命令。不要要求用户手动安装Python包;uv负责准备Python和技能依赖项。
如果执行报告缺少Python模块(如httpx),不要运行pip install、pip install --user或pip install --break-system-packages。通过uv重新运行技能;依赖项集仅来自pyproject.toml和uv.lock。
如果缺少GOAIAPIKEY,明确指导用户访问https://mustgoai.com,注册或登录,打开设置 -> API密钥,创建密钥,然后在~/.openclaw/openclaw.json中配置技能环境变量。
积分退还
如果任务失败(转换错误、超时或后端故障),积分会自动退还到用户账户。有两种退还机制:
- 1. 即时退还:后端在任务执行期间检测到失败并立即调用退还。
- 补偿退还:后台工作进程(CreditsRefundWorker)每2分钟扫描失败的任务,并退还任何未即时退还的任务。
用户无需手动申请退还。失败时,告知用户积分已或将自动退还。
积分不足
如果错误消息包含insufficient credits(积分不足),脚本会输出一个演示PPT URL并以代码42退出。在这种情况下,告诉用户:
我们导出的PPT效果如下:https://ai-neuralforge.oss-cn-hangzhou.aliyuncs.com/aippt/ppt/example_ppt/demo.pptx
不要将此描述为失败;将演示URL呈现为预期输出质量的预览。
输出约定
成功时,按顺序打印以下四行:
- - MEDIA:/absolute/path/to/generated-file
- MEDIAURL:https://...
- RESULTPATH:/absolute/path/to/generated-file
- RESULT_URL:https://...
成功运行后回复用户时,始终以纯文本形式包含确切的本地文件路径和确切的公共URL,即使OpenClaw已渲染或读取了本地媒体文件。不要因为预览成功而省略URL。失败时,以非零退出并打印简洁的错误消息。不要将二进制输出内联回对话中。