← 返回 Skills 市场
zhangyukun230

chatbi-skil-test

作者 zhangyukun230 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
99
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install chatbi-skil-test
功能描述
通过命令行调用 ChatBI 问数 Agent 流式接口,对企业数据表进行自然语言驱动的数据查询分析。 本工具支持:发起自然语言问数、实时跟踪 Agent 执行流程、提取意图理解/选表结果/SQL/最终回答。 当用户需要查询数据库、分析数据、用自然语言问数,或提到"ChatBI"、"问数"、"数据查询"、"SQL...
使用说明 (SKILL.md)

metadata: author: ChatBI Skills version: "1.0.0"

ChatBI 问数 Agent Skill

概述

scripts/chatbi_cli.py 帮助用户完成 自然语言问数 → 意图理解 → 智能选表 → SQL 生成执行 → 获取结果 的完整流程。

核心能力

本 Skill 调用 ChatBI Agent 流式接口,从丰富的 Agent 输出中只提取关键信息:

  1. 意图理解intent_toolunderstanding_thinking(Agent 对用户问题的理解)
  2. 选表结果table_select_tooltable_name + table_selected_reason(选择了哪些表及原因)
  3. SQL 执行sql_executed(生成的 SQL)、execution_plan(执行计划)、data_preview_info(数据预览)
  4. 最终回答is_final_answer=truetype=answer 的内容

安装

pip install -r scripts/requirements.txt

快速开始

# 基本问数
python3 scripts/chatbi_cli.py -q "查询乳制品的销售情况"

# 指定输出模式
python3 scripts/chatbi_cli.py -q "各品类月度销售趋势" --output detail

# 仅输出 SQL
python3 scripts/chatbi_cli.py -q "查询销量 Top10 的商品" --output sql-only

输出模式

  • summary(默认):意图理解 + 选表结果 + SQL + 最终回答
  • detail:完整的 Agent 执行过程
  • sql-only:仅输出生成的 SQL
  • raw:输出被过滤命中的事件 JSON 及未匹配事件标注(调试用)

⚠️ 调用规范(必读)

必须使用 yieldMs=200 参数,否则无法实现流式输出!

本 Skill 的 CLI 脚本执行耗时约 30-50 秒(Agent 意图理解 → 选表 → SQL 生成执行 → 回答)。 CLI 内部每个阶段完成后会立即 flush 输出,配合 yieldMs=200 可实现渐进式展示。

正确调用方式

exec(command="python3 scripts/chatbi_cli.py -q '查询乳制品的销售情况' --output summary", yieldMs=200)

错误调用方式

# ❌ 缺少 yieldMs,会等进程跑完才一次性返回所有结果
exec(command="python3 scripts/chatbi_cli.py -q '查询乳制品的销售情况'")

参数说明

参数 说明
yieldMs 200 每 200ms 把已产生的 stdout 分批推送给用户,实现渐进式展示
--output summary 默认模式,只输出关键信息(意图/选表/SQL/回答)
--output detail 额外输出执行计划和数据预览详情
--output sql-only 仅输出 SQL,适合管道使用

项目结构

├── SKILL.md              # 本文档
├── scripts/
│   ├── chatbi_cli.py     # CLI 入口
│   ├── requirements.txt  # 依赖
│   └── chatbi/           # 核心模块
│       ├── __init__.py
│       ├── config.py     # 配置管理
│       ├── client.py     # 流式 API 客户端
│       ├── parser.py     # 流式事件解析与过滤
│       ├── formatter.py  # 输出格式化
│       └── models.py     # 数据模型
└── references/
    └── COMMANDS.md       # 命令参考
安全使用建议
What to consider before installing/using this skill: - Data destination: By default the skill will send your query text, the built payload (including table_info_list and workspace/account identifiers), and any agent events to the hardcoded api_url (http://llmapp-prod.testsite.woa.com/...). If those queries or table identifiers are sensitive, treat this as sending data offsite. You can override the endpoint via CHATBI_API_URL or the --api-url flag, and you should set it to a trusted internal endpoint before use. - No secret required but identifiers present: The code includes baked-in UIN/app_id/workspace/room_key values. They are not secret tokens but are identifying metadata that will be included in requests. Consider removing or replacing them if you don't want those identifiers transmitted. - Inspect code before running: Although dependencies are minimal (requests), running the CLI will perform outbound HTTP calls and stream intermediate tokens. Review scripts/chatbi_client.py and scripts/chatbi/config.py to confirm the endpoint and payload are acceptable. - Running environment: If you must test, run in an isolated environment (separate network, staging account, or sandbox) and avoid sending production-sensitive queries until you confirm the destination is trusted. - Optional file writes: The only file write occurs if you pass --save-raw; otherwise the tool only prints to stdout/stderr. Be cautious when saving raw events since they may contain full query text, SQL, and result data. - If you require a stricter safety posture: do not install or run this skill until the maintainer discloses the API host owner and privacy policy, or until you configure CHATBI_API_URL to a known internal server.
功能分析
Type: OpenClaw Skill Name: chatbi-skil-test Version: 1.0.1 The skill bundle is a functional CLI client designed to interface with a ChatBI (Business Intelligence) agent service. The code in `scripts/chatbi/` handles streaming API requests via the `requests` library, parses structured JSON/SSE events, and formats the output for the user. While `scripts/chatbi/config.py` contains hardcoded configuration values (such as a specific internal-style API URL and various IDs), these appear to be default settings for the intended service rather than indicators of malice. There is no evidence of data exfiltration, unauthorized command execution, or malicious prompt injection instructions.
能力评估
Purpose & Capability
The name/description (ChatBI streaming CLI for natural-language DB queries) aligns with the provided code: a CLI, a streaming HTTP client, an SSE/NDJSON parser, formatter, and models. The components present (client, parser, formatter) are appropriate and expected for the stated purpose.
Instruction Scope
Runtime instructions and code perform network calls to an API endpoint and stream back agent events; that is expected. However the SKILL.md and examples do not explicitly warn that user queries, generated payloads and default table metadata will be transmitted to the remote host. The skill also recommends being invoked with an OpenClaw exec(..., yieldMs=200) to enable streaming; this will cause incremental user query tokens and intermediate tool events to be sent and relayed in small batches. There is no instruction to sanitize sensitive queries before sending or to request explicit confirmation about the destination.
Install Mechanism
There is no formal install spec in registry metadata, but SKILL.md instructs running 'pip install -r scripts/requirements.txt' which only installs 'requests'. This is proportionate and low-risk. Note: because the package is instruction + code files bundled, running the provided Python code will execute outgoing HTTP requests — inspect code before running.
Credentials
Registry metadata declares no required environment variables or primary credential, but the code reads optional environment variables (CHATBI_API_URL, CHATBI_UIN, CHATBI_OWNER_UIN, CHATBI_APP_ID, CHATBI_WORKSPACE_ID, CHATBI_ROOM_KEY, CHATBI_NAMESPACE). More importantly, a default api_url is hardcoded (http://llmapp-prod.testsite.woa.com/...) and default table_info_list values are embedded. That means by default the user's natural-language queries and table metadata will be sent to that remote endpoint. No explicit authentication tokens are requested, but the presence of many account/workspace identifiers (uin, app_id, room_key) baked into the client may leak identifying metadata. The skill does not require credentials, but its network behavior and embedded identifiers create a privacy / exfiltration risk and should be reviewed.
Persistence & Privilege
The skill does not request permanent presence (always=false), does not modify other skills or system settings, and only writes to disk if the user explicitly passes --save-raw. It does not persist credentials or auto-enable itself. No elevated persistence behavior detected.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install chatbi-skil-test
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /chatbi-skil-test 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
**Improved stream output documentation and usage instructions** - 强化了 yieldMs=200 的重要性说明,明确流式输出规范,避免错误调用 - 新增了「调用规范(必读)」章节,举例说明正确与错误的 exec 调用写法 - 对各参数说明进行了表格梳理,便于理解和使用 - 其它内容无实质变动,文件结构保持不变
v1.0.0
Initial release of ChatBI 问数 Agent Skill. - Enables natural language-driven data queries and analysis via the ChatBI Agent streaming API. - Supports capturing intent understanding, table selection, SQL generation/execution, and final answers. - Provides multiple output modes: summary, detail, sql-only, and raw. - Includes command line tool (chatbi_cli.py) for easy querying and process tracking. - Requires access to ChatBI Agent service endpoint and pre-registered data tables on the ChatBI platform.
元数据
Slug chatbi-skil-test
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

chatbi-skil-test 是什么?

通过命令行调用 ChatBI 问数 Agent 流式接口,对企业数据表进行自然语言驱动的数据查询分析。 本工具支持:发起自然语言问数、实时跟踪 Agent 执行流程、提取意图理解/选表结果/SQL/最终回答。 当用户需要查询数据库、分析数据、用自然语言问数,或提到"ChatBI"、"问数"、"数据查询"、"SQL... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。

如何安装 chatbi-skil-test?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install chatbi-skil-test」即可一键安装,无需额外配置。

chatbi-skil-test 是免费的吗?

是的,chatbi-skil-test 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

chatbi-skil-test 支持哪些平台?

chatbi-skil-test 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 chatbi-skil-test?

由 zhangyukun230(@zhangyukun230)开发并维护,当前版本 v1.0.1。

💬 留言讨论