Loading...
Loading...
Compare original and translation side by side
Runto verify >= 3.3.3. If not installed or version too low, runaliyun versionto install/update, or seecurl -fsSL https://aliyuncli.alicdn.com/setup.sh | bashfor installation instructions.references/cli-installation-guide.md
[MUST] runto enable automatic plugin installation. [MUST] runaliyun configure set --auto-plugin-install trueto ensure that any existing plugins are always up-to-date.aliyun plugin update
运行验证版本是否>=3.3.3。若未安装或版本过低, 运行aliyun version进行安装/更新, 或查看curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash获取安装说明。references/cli-installation-guide.md
[必须] 运行启用自动插件安装。 [必须] 运行aliyun configure set --auto-plugin-install true确保所有现有插件保持最新。aliyun plugin update
Pre-check: Alibaba Cloud Credentials RequiredSecurity Rules:
- NEVER read, echo, or print AK/SK values (e.g.,
is FORBIDDEN)echo $ALIBABA_CLOUD_ACCESS_KEY_ID- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use
with literal credential valuesaliyun configure set- ONLY use
to check credential statusaliyun configure listbashaliyun configure listCheck the output for a valid profile (AK, STS, or OAuth identity).If no valid profile exists, STOP here.
- Obtain credentials from Alibaba Cloud Console
- Configure credentials outside of this session (via
in terminal or environment variables in shell profile)aliyun configure- Return and re-run after
shows a valid profilealiyun configure list
前置检查:需准备阿里云凭证安全规则:
- 严禁读取、回显或打印AK/SK值(例如:
是禁止操作)echo $ALIBABA_CLOUD_ACCESS_KEY_ID- 严禁要求用户在对话或命令行中直接输入AK/SK
- 严禁使用
命令传入明文凭证值aliyun configure set- 仅允许使用
检查凭证状态aliyun configure listbashaliyun configure list检查输出是否包含有效的配置文件(AK、STS或OAuth身份)。若无有效配置文件,请在此处暂停。
- 从阿里云控制台获取凭证
- 在本次会话外配置凭证(通过终端中的
命令或Shell配置文件中的环境变量)aliyun configure- 待
显示有效配置文件后,再返回继续操作aliyun configure list
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
- Read
to get the full list of permissions required by this SKILLreferences/ram-policies.md- Use
skill to guide the user through requesting the necessary permissionsram-permission-diagnose- Pause and wait until the user confirms that the required permissions have been granted
[必须] 权限失败处理流程: 在执行过程中,若任何命令或API调用因权限错误失败,请遵循以下流程:
- 查看
获取本Skill所需的完整权限列表references/ram-policies.md- 使用
Skill引导用户申请必要权限ram-permission-diagnose- 暂停操作,等待用户确认所需权限已授予
IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, service names, instance IDs, environment names, config names, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
重要提示:参数确认 — 在执行任何命令或API调用前, 所有用户可自定义的参数(例如:RegionId、服务名称、实例ID、 环境名称、配置名称等)必须与用户确认。 未经用户明确批准,不得假设或使用默认值。
| Parameter Name | Required/Optional | Description | Default Value |
|---|---|---|---|
| Required | PAI-EAS service name | N/A |
| Required | EAS cluster/region ID | N/A |
| Required | PAI-Rec instance ID | N/A |
| Required (for diagnosis) | Request ID from engine API response | N/A |
| Optional | Engine configuration name | N/A |
| Optional | Engine environment (Prod/Pre) | N/A |
| Optional | Specific engine config version ID | N/A |
| Optional | Alibaba Cloud region | N/A |
| 参数名称 | 必填/可选 | 描述 | 默认值 |
|---|---|---|---|
| 必填 | PAI-EAS服务名称 | N/A |
| 必填 | EAS集群/地域ID | N/A |
| 必填 | PAI-Rec实例ID | N/A |
| 必填(诊断场景) | 引擎API返回的请求ID | N/A |
| 可选 | 引擎配置名称 | N/A |
| 可选 | 引擎环境(Prod/Pre) | N/A |
| 可选 | 特定引擎配置版本ID | N/A |
| 可选 | 阿里云地域 | N/A |
At the start of the Core Workflow (before any CLI invocation): [MUST] Enable AI-Mode — AI-mode is required for Agent Skill execution. Run the following commands before any CLI invocation:bashaliyun configure ai-mode enable aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-pai-rec-diagnosis"
[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed. AI-mode is only used for Agent Skill invocation scenarios and MUST NOT remain enabled after the skill stops running.bashaliyun configure ai-mode disable
在核心工作流开始时(执行任何CLI命令前): [必须] 启用AI模式 — 执行Agent Skill需开启AI模式。 在执行任何CLI命令前,先运行以下命令:bashaliyun configure ai-mode enable aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-pai-rec-diagnosis"
[必须] 在所有退出点禁用AI模式 — 无论因何种原因返回最终响应前,始终先禁用AI模式。此规则适用于所有退出路径:工作流成功、工作流失败、错误/异常、用户取消、会话结束,或任何不再执行CLI命令的场景。 AI模式仅用于Agent Skill调用场景,Skill停止运行后必须禁用。bashaliyun configure ai-mode disable
Service Name: embedding_recall
API Response:
{
"code": 299,
"msg": "items size not enough",
"request_id": "941b4e14-d1c5-489f-a184-b2b17f8b4fdb",
"size": 0,
"experiment_id": "",
"items": []
}服务名称: embedding_recall
API响应:
{
"code": 299,
"msg": "items size not enough",
"request_id": "941b4e14-d1c5-489f-a184-b2b17f8b4fdb",
"size": 0,
"experiment_id": "",
"items": []
}aliyun eas describe-service \
--cluster-id <cluster-id> \
--service-name <service-name>Resourceeas-r-1v4qb1yan3qmnjwxqeServiceConfig.envsREGIONINSTANCE_IDCONFIG_NAMEPAIREC_ENVIRONMENTaliyun eas describe-service \\
--cluster-id <cluster-id> \\
--service-name <service-name>Resourceeas-r-1v4qb1yan3qmnjwxqeServiceConfig.envsREGIONINSTANCE_IDCONFIG_NAMEPAIREC_ENVIRONMENTrequest_idrequest_id--start-time--end-timealiyun eas describe-service-log \
--cluster-id <cluster-id> \
--service-name <service-name> \
--keyword <request-id> \
--page-size 500--keywordcontroller.gofeed.gorecall.gorank_service.go--start-time--end-time/bin/sh502 Bad Gatewaypostgres.go dbstat--keyword <request-id>--keywordrequest_id--page-size--start-time--end-time--keywordyyyy-MM-dd HH:mm:ssTZ2025-04-28T00:00:00ZInvalidParameter--start-time--end-timealiyun eas describe-service-log \\
--cluster-id <cluster-id> \\
--service-name <service-name> \\
--keyword <request-id> \\
--page-size 500--keywordcontroller.gofeed.gorecall.gorank_service.go--start-time--end-time/bin/sh502 Bad Gatewaypostgres.go dbstat--keyword <request-id>--keywordrequest_id--page-size--start-time--end-time--keywordyyyy-MM-dd HH:mm:ssTZ2025-04-28T00:00:00ZInvalidParameterproductProdprepubPrealiyun pairecservice list-engine-configs \
--instance-id <instance-id> \
--environment <Prod|Pre> \
--status Released \
--name <config-name>Status: ReleasedEngineConfigIdVersionproductProdprepubPrealiyun pairecservice list-engine-configs \\
--instance-id <instance-id> \\
--environment <Prod|Pre> \\
--status Released \\
--name <config-name>ReleasedEngineConfigIdVersionaliyun pairecservice get-engine-config \
--instance-id <instance-id> \
--engine-config-id <engine-config-id>ConfigValuealiyun pairecservice get-engine-config \\
--instance-id <instance-id> \\
--engine-config-id <engine-config-id>ConfigValuescripts/validate.pyConfigValueprintf '%s' "$CONFIG_VALUE" | python3 scripts/validate.py --stdinRecallConfsFilterConfsSceneConfsscene_idSceneConfsvalidate.pyvalidate.pyrequest_idRecallConfvalidate.pyrequest_idConfigValuescripts/validate.pyprintf '%s' "$CONFIG_VALUE" | python3 scripts/validate.py --stdinRecallConfsFilterConfsSceneConfsscene_idSceneConfsvalidate.pyvalidate.pyrequest_idRecallConfvalidate.pyrequest_idengine-config-idaliyun pairecservice list-engine-configs \
--instance-id <instance-id> \
--environment <Prod|Pre> \
--name <config-name>VersionStatusGmtCreateTimeEngineConfigIdengine-config-idengine-config-idaliyun pairecservice list-engine-configs \\
--instance-id <instance-id> \\
--environment <Prod|Pre> \\
--name <config-name>VersionStatusGmtCreateTimeEngineConfigIdengine-config-idaliyun pairecservice get-engine-config \
--instance-id <instance-id> \
--engine-config-id <engine-config-id>aliyun pairecservice get-engine-config \\
--instance-id <instance-id> \\
--engine-config-id <engine-config-id>ConfigValuescripts/validate.pyreferences/schema.jsonundefinedConfigValuescripts/validate.pyreferences/schema.jsonundefined
Requires `jsonschema` (`pip install jsonschema`); if missing the script falls back to
rule-only validation without Schema checks.
**What the script checks (summary):**
1. **Structure** — JSON well-formedness, required fields, types (`RunMode`,
`RecallConfs`, `FilterConfs`, `SortConfs`, `AlgoConfs`, `SceneConfs`, `RankConf`,
`FeatureConfs`, `UserFeatureConfs`, `DebugConfs`, `FeatureLogConfs`,
`CallBackConfs`, `PipelineConfs`, etc.)
2. **Enum values** — `RecallType` / `FilterType` / `SortType` / `RunMode` /
`DebugConfs.OutputType` / `GeneralRankConfs.ActionConfs[].ActionType`
3. **Reference consistency** — `SceneConfs.RecallNames` → `RecallConfs`;
`FilterNames` → `FilterConfs`; `SortNames` → `SortConfs`;
`RankConf.RankAlgoList` → `AlgoConfs`; any `DaoConf.AdapterType` +
`*Name` → the corresponding `*Confs` (Hologres / Redis / MySQL / TableStore /
FeatureStore / …)
4. **Business rules**
- `User2ItemExposureFilter` with `WriteLog=true` + FeatureStore adapter: must set
`TimeInterval > 0`
- `PriorityAdjustCountFilter` in `accumulator` mode: `Count` must be strictly
increasing (use `Type="fix"` for independent per-recall caps)
- `PipelineConfs.*.Name` must be globally unique
- `DebugConfs.Rate` must be an integer in `[0, 100]`
5. **Duplicate name detection** within `RecallConfs`, `FilterConfs`, `SortConfs`,
`AlgoConfs`
Detailed usage, exit codes, example outputs and the full rule list live in
[references/config-validation.md](references/config-validation.md).
需安装 `jsonschema`(`pip install jsonschema`);若未安装,脚本会回退到仅执行规则验证,跳过Schema检查。
**脚本检查内容摘要:**
1. **结构** — JSON格式正确性、必填字段、类型(`RunMode`、
`RecallConfs`、`FilterConfs`、`SortConfs`、`AlgoConfs`、`SceneConfs`、`RankConf`、
`FeatureConfs`、`UserFeatureConfs`、`DebugConfs`、`FeatureLogConfs`、
`CallBackConfs`、`PipelineConfs`等)
2. **枚举值** — `RecallType` / `FilterType` / `SortType` / `RunMode` /
`DebugConfs.OutputType` / `GeneralRankConfs.ActionConfs[].ActionType`
3. **引用一致性** — `SceneConfs.RecallNames` → `RecallConfs`;
`FilterNames` → `FilterConfs`; `SortNames` → `SortConfs`;
`RankConf.RankAlgoList` → `AlgoConfs`; 任何 `DaoConf.AdapterType` +
`*Name` → 对应的 `*Confs`(Hologres / Redis / MySQL / TableStore /
FeatureStore / …)
4. **业务规则**
- `User2ItemExposureFilter` 设置 `WriteLog=true` 且使用FeatureStore适配器时:必须设置
`TimeInterval > 0`
- `PriorityAdjustCountFilter` 处于`accumulator`模式时:`Count`必须严格递增(使用`Type="fix"`实现独立的召回上限)
- `PipelineConfs.*.Name` 必须全局唯一
- `DebugConfs.Rate` 必须是`[0, 100]`范围内的整数
5. **重复名称检测** — 在`RecallConfs`、`FilterConfs`、`SortConfs`、
`AlgoConfs`中检测重复名称
详细使用方法、退出码、示例输出和完整规则列表请查看
[references/config-validation.md](references/config-validation.md)。ConfigValueConfigValueRankScoreConfigValueConfigValueRankScore--keyword <request_id>aliyun eas describe-service-log--start-time--end-timeyyyy-MM-dd HH:mm:ssTZaliyun eas describe-service-log--keyword <request_id>--start-time--end-timeyyyy-MM-dd HH:mm:ssTZ| Reference Document | Description |
|---|---|
| RAM Policies | Required RAM permissions for PAI-Rec and EAS APIs |
| Related Commands | Complete CLI command reference |
| Verification Method | Detailed verification procedures |
| CLI Installation Guide | Alibaba Cloud CLI installation instructions |
| Configuration Examples | Sample engine configurations and common patterns |
| Config Validation | |
| Troubleshooting Guide | Common issues and solutions |
| 参考文档 | 描述 |
|---|---|
| RAM Policies | PAI-Rec和EAS API所需的RAM权限 |
| Related Commands | 完整CLI命令参考 |
| Verification Method | 详细验证流程 |
| CLI Installation Guide | 阿里云CLI安装说明 |
| Configuration Examples | 示例引擎配置和常见模式 |
| Config Validation | |
| Troubleshooting Guide | 常见问题及解决方案 |
| ", |