Skill Overview
This Skill is used in conversations to act as an intelligent agent for Alibaba Cloud RDS Copilot:
- Understand the user's natural language request(Chinese or English), and identify whether it is related to RDS Copilot;
- Directly call the built-in script
scripts/call_rds_ai.pyto query RDS Copilot in real time and get results; - When results are obtained or the user pastes error information,further explain, diagnose, and provide follow-up suggestions。
Working Modes:
- Use
scripts/call_rds_ai.pyscript to directly get real-time responses from RDS Copilot
Standard Usage Workflow
-
Confirm the task type and parameters
- Determine the user's intent: SQL writing/optimization, SQL diagnosis, instance parameter tuning, troubleshooting, performance analysis, querying the instance list, etc.
- Collect the necessary parameters (use default values if not specified):
--region: region ID (defaultcn-hangzhou)--language: language (defaultzh-CN)--timezone: time zone (defaultAsia/Shanghai)--custom-agent-id: dedicated Agent ID (optional)--conversation-id: session ID, used for multi-turn conversations (optional)
-
Construct the query and call the script
- 示例: ```bash # 基础查询 uv run ./scripts/call_rds_ai.py "查询杭州地域的 RDS MySQL 实例列表" # 指定地域 uv run ./scripts/call_rds_ai.py "优化这条SQL" --region cn-beijing # 多轮对话 uv run ./scripts/call_rds_ai.py "继续分析" --conversation-id "<上次返回的会话ID>" -
Parse the results and handle them afterward
- Explain RDS Copilot's response to the user in natural language;
- If the response contains SQL or operation steps, assess the risk and remind:
- Avoid directly executing high-risk statements in the production environment (such as large table
DELETE/UPDATE/ schema changes); - It is recommended to verify in a test environment or add backup/condition constraints.
- Avoid directly executing high-risk statements in the production environment (such as large table
- If you need to continue the conversation, record
conversation_idfor the next round of queries.
Tool Script Usage Instructions
Command-line Arguments
| Argument | Description | Default Value |
|---|---|---|
query |
Query content (required), use - to read from standard input |
- |
--region / --region-id |
Alibaba Cloud region ID | cn-hangzhou |
--language / --lang |
Language | zh-CN |
--timezone / --tz |
Time zone | Asia/Shanghai |
--custom-agent-id |
Dedicated Agent ID | None |
--conversation-id / --conv-id |
Session ID (multi-turn conversation) | None |
--endpoint |
API endpoint | rdsai.aliyuncs.com |
--no-stream |
Disable streaming output | False (streaming enabled by default) |
Output Format
The script will output query information to stderr, and output RDS Copilot's answer to stdout, making it easy to separate logs and results:
[查询] 查询杭州地域实例列表
[地域] cn-hangzhou | [语言] zh-CN
============================================================
[RDS Copilot 回答]
<实际回答内容>
[会话ID] conv-xxxx-xxxx-xxxx