Alibabacloud Bailian Rag Knowledgebase
Alibaba Cloud Bailian Knowledge Base Retrieval Tool. Use HTTPS API to query and retrieve knowledge base content. Use when: User needs to query knowledge base…
от sdk-team1 343 установки в других каталогах
Установить Alibabacloud Bailian Rag Knowledgebase в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Bailian Knowledge Base Retrieval
This Skill provides query and retrieval capabilities for Alibaba Cloud Bailian Knowledge Base via HTTPS API.
API Key Security Management
Scripts automatically handle key retrieval via api_key.py. The Agent does not need to and should not manually extract, set, or pass API Key values.
- Key retrieval is automated: Scripts internally call
api_key.pyto automatically obtain keys from config files/environment variables. The Agent only needs to run the script command. - Never hardcode any form of key: Including
api_key = "sk-...",export DASHSCOPE_API_KEY="sk-...", and assigning keys in shell scripts. - Never extract keys from CLI output: The Agent must not write key values into any script, variable, or file.
- Never expose keys in any output: Including generated scripts, shell commands, log files, and terminal output containing strings starting with
sk-. - Never read or print keys from config files: Do not use
cat,jq,python -c, or other commands to read and output API Key values. - Mandatory self-check before task completion: Run
grep -rn "sk-" <output_directory>/to check all output files; if any strings starting withsk-are found (excludingsk-xxxplaceholders), delete the affected files and regenerate.
🚀 Initial Setup (Required for First-time Use)
1. Configure API Key
API Keys are managed by the unified scripts/api_key.py module, with the following retrieval priority:
- Alibaba Cloud CLI config
~/.aliyun/config.jsoncurrent profile'sdashscope.api_key - Environment variable
DASHSCOPE_API_KEY - Auto-create and save when Alibaba Cloud CLI is available (
generate_api_key())
# All scripts use this unified approach
from api_key import get_api_key
api_key = get_api_key() # Returns str, raises ValueError if not found
Manual environment variable configuration:
export DASHSCOPE_API_KEY=sk-xxx
| Item | Description |
|---|---|
| Key Format | sk-xxx (standard DashScope API Key) |
| Not Supported | sk-sp-xxx (Coding Plan Key, does not support knowledge base services) |
| Get Key | https://bailian.console.aliyun.com/cn-beijing/?tab=app#/api-key |
Alibaba Cloud CLI Configuration (API Key Auto-Create/Delete)
The scripts/api_key.py module creates and deletes API Keys via aliyun modelstudio commands. Complete the following setup before use:
1. Update Plugins
# Update plugins to latest version
aliyun plugin update
2. Install ModelStudio Plugin (if not already installed)
aliyun plugin install --names aliyun-cli-modelstudio --enable-pre
CLI Commands Used:
| Command | Purpose | Called From |
|---|---|---|
aliyun modelstudio list-workspaces |
Get Bailian Workspace ID | api_key.py: _get_workspace_id() |
aliyun modelstudio create-api-key |
Create DashScope API Key | api_key.py: generate_api_key() |
aliyun modelstudio delete-api-key |
Delete cloud API Key | api_key.py: _delete_cloud_api_key() |
2. Important Prerequisite: Activate Bailian Knowledge Base Service
Before using this skill, you must first activate the knowledge base service in the Alibaba Cloud Bailian console!
- Visit Bailian Knowledge Base page
- Click the "Activate Now" button
- Confirm activation and wait for the service to take effect (usually 1-2 minutes)
Observability (MUST follow for every aliyun command)
Upon loading this skill, generate a random session ID (32-char lowercase hex string) and export it as SKILL_SESSION_ID. This value must remain constant for the entire skill session.
Every aliyun CLI command and HTTPS API call must include a User-Agent identifier for traceability.
User-Agent Format
AlibabaCloud-Agent-Skills/alibabacloud-bailian-rag-knowledgebase/{session-id}
{session-id}= value ofSKILL_SESSION_IDenvironment variable (32-char lowercase hex string)- Scripts read it via
os.environ.get("SKILL_SESSION_ID", ""); if empty, generate one withsecrets.token_hex(16)
Per-Command --user-agent (CLI)
Every aliyun modelstudio business command MUST carry --user-agent on the command line:
aliyun modelstudio list-workspaces --region cn-beijing \
--user-agent "AlibabaCloud-Agent-Skills/alibabacloud-bailian-rag-knowledgebase/{session-id}"
Prohibited: Do NOT set User-Agent via global configuration commands. Only per-command
--user-agentis allowed.
HTTPS User-Agent Header
All HTTPS API requests set the User-Agent HTTP header:
"User-Agent": f"AlibabaCloud-Agent-Skills/alibabacloud-bailian-rag-knowledgebase/{session_id}"
Applied Locations
| Location | Mechanism |
|---|---|
| `scripts/list_indices |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Alibabacloud Bailian Rag Knowledgebase?
Alibaba Cloud Bailian Knowledge Base Retrieval Tool. Use HTTPS API to query and retrieve knowledge base content. Use when: User needs to query knowledge base, retrieve document content, or answer questions based on knowledge base. Prerequisites: (1) Configure DashScope API Key (2) Activate Bailian Knowledge Base service.
Как установить скилл Alibabacloud Bailian Rag Knowledgebase?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Alibabacloud Bailian Rag Knowledgebase запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…