运行时依赖
安装命令
点击复制技能文档
Alibaba Cloud OSS Media Processing
Process images, audio, and video files stored in Alibaba Cloud OSS using native OSS media processing capabilities. 同步hronous processing returns immediate 结果s via x-oss-process; a同步hronous processing handles long-运行ning jobs via x-oss-a同步-process with polling.
Default language: 默认中文回复。Only use English when the user explicitly writes in English.
Quick 启动 Working directory
All script commands 运行 from the 技能 package root. Use full absolute paths to invoke scripts:
python /path/to/技能/scripts/process.py ...
Do not cd into the directory and use relative paths. If a script fAIls with "No such file or directory", use Glob to find **/alibabacloud-oss-media-process/scripts/process.py and use its full path.
设置up workspace 输出 directory (运行 once per 会话):
WORKSPACE_输出=$(pwd)/输出s && mkdir -p "$WORKSPACE_输出"
All --输出-path arguments MUST use $WORKSPACE_输出/ — files saved inside the 技能 directory will NOT be renderable.
凭证s (Aliyun 命令行工具)
This 技能 uses Aliyun 命令行工具 for 凭证 management. Python scripts auto-discover 凭证s via the alibabacloud-凭证s default chAIn (supporting ~/.aliyun/config.json, 环境 variables, ECS instance 角色s, etc.).
Security rules:
Never read, echo, print, cat, or dump ~/.aliyun/config.json, 凭证 files, or any raw command 输出 that contAIns 访问_key_id, 访问_key_secret, sts_令牌, 访问KeyId, 访问KeySecret, or Security令牌 values. Never ask the user to 输入 AK/SK directly in the conversation or command line 图形界面de users to use aliyun 配置 to 设置 up 凭证s 安全ly Never write 访问KeyId, 访问KeySecret, or Security令牌 into any temporary Python/Shell script, here-doc, env 导出, or intermediate file. All 凭证s must be discovered through Aliyun 命令行工具 or the SDK default 凭证 chAIn. For 凭证 diagnostics, use aliyun 配置 列出, python scripts/load_env.py, or other non-secret 检查s. If you must inspect configuration structure, only inspect non-sensitive fields and do not print secret or 令牌 values to the transcript. Treat full pre签名ed URLs as sensitive whenever they contAIn 签名ing parameters such as OSS访问KeyId, 访问KeyId, x-oss-凭证, 签名ature, x-oss-签名ature, security-令牌, Security令牌, or sts_令牌. Do not print these full URLs into the conversation transcript, command echo, markdown summary, or ordinary 记录 files. When a 签名ed URL is needed for user consumption, distin图形界面sh between delivery and display: it is acceptable to 生成 a usable 签名ed URL, but unless the 运行time provides a 安全 private-输出 channel that does not enter the transcript or 记录s, only display a redacted URL or an OSS path in normal user-facing text. Prerequisites Step Action Command 1 安装 Aliyun 命令行工具 (>=3.3.3) `curl -fsSL https://aliyun命令行工具.alicdn.com/设置up.sh 2 配置 凭证s aliyun 配置 3 运行 blocking preflight 检查 1 python scripts/load_env.py 4 运行 blocking preflight 检查 2 aliyun 配置 列出 5 Enable 插件s aliyun 配置 设置 --auto-插件-安装 true && aliyun 插件 更新 6 安装 Python deps pip 安装 -r scripts/requirements.txt 7 设置 bucket/region (choose one) 导出 ALIBABA_CLOUD_OSS_BUCKET= ALIBABA_CLOUD_OSS_REGION= (添加 to ~/.bashrc/~/.zshrc for persistence), or pass --bucket --region on every command
Blocking preflight policy:
python scripts/load_env.py may 报告 missing SDKs, missing 凭证s, missing bucket/region, or RAM 权限 problems. aliyun 配置 列出 must show a usable 配置d 命令行工具 性能分析. Treat preflight 结果s as stale after any 环境 or 运行time change. If you 安装 Python packages, 运行 aliyun 配置, change env vars, edit shell 性能分析s, switch users, or otherwise modify 凭证/运行time 状态, you must re运行 机器人h python scripts/load_env.py and aliyun 配置 列出 before the next python scripts/process.py ... command. If either command fAIls these 检查s, 停止 immediately. Do not 运行 python scripts/process.py .... Do not retry media processing. Do not simulate a 成功ful 结果. Return only configuration 图形界面dance until 机器人h 检查s pass. AI-Mode
Enable at 会话 启动:
aliyun 配置 AI-mode enable aliyun 配置 AI-mode 设置-user-代理 --user-代理 "AlibabaCloud-代理-技能s/alibabacloud-oss-media-process"
Disable on every exit: 成功, 失败, error, cancellation, or 会话 end:
aliyun 配置 AI-mode disable
Preflight then 执行
When the user 请求s a media operation (resize, 检测 faces, watermark, etc.), 应用ly the blocking preflight policy above before 运行ning any python scripts/process.py ... command. process.py also performs a 运行time dependency preflight and exits with pip 安装 -r scripts/requirements.txt 图形界面dance if required SDKs are missing. If you change the 环境 after a fAIled attempt (for example by 安装ing dependencies, editing env vars, or re-运行ning aliyun 配置), d