AT Chat Mask
AskTable 对话数据脱敏工具 - 从真实对话记录创建演示案例,使用虚拟数据保护客户隐私
功能特性
- 📖 自动分析对话文件,提取数据结构和问题
- 🤖 智能生成中文案例名称(基于表名和内容分析)
- 🔧 自动生成虚拟 CSV 数据,保护客户隐私
- 🚀 自动创建 AskTable 的 Datasource、Bot 和 Chat
- 💬 交互式对话,灵活配置案例参数
- 🌐 一键发布,快速生成可分享的演示链接
安装
pip install at-chat-mask
快速开始
1. 配置 API Key
创建 .env 文件:
ASKTABLE_API_KEY=your_api_key_here
ASKTABLE_API_BASE=https://api.asktable.com
2. 准备对话文件
将 AskTable 对话导出文件命名为 chat-{编号}.json 格式,例如:
chat-001.jsonchat-002.json
3. 运行工具
at-chat-mask
4. 按提示操作
案例编号 [001]: 001
系统自动查找 chat-001.json 文件并分析内容
📝 自动生成案例名称
✓ 案例名称: 体育成绩数据分析
是否使用此名称? [Y/n]:
系统根据对话内容自动生成中文案例名称,可以确认使用或自定义
确认信息后,系统会自动:
- 生成虚拟 CSV 数据(
case-001.csv) - 创建 AskTable Datasource
- 创建 AskTable Bot(公开分享)
- 创建 AskTable Chat
完成后获取分享链接。
对话文件格式
文件必须命名为 chat-{编号}.json,内容为标准的 AskTable Chat 格式:
{
"items": [
{
"role": "human",
"content": {"text": "展示跳绳最好的前10名学生的详情"}
},
{
"role": "ai",
"metadata": {
"tool_response": [{
"sql": "SELECT ... FROM table_name ...",
"result": "..."
}]
}
}
]
}
API 使用
from at_chat_mask import ChatMaskAgent, CSVGenerator
# 创建 Agent
agent = ChatMaskAgent(
api_key="your_api_key",
api_base="https://api.asktable.com"
)
# 运行交互式流程
agent.run()
# 或者单独使用 CSV 生成器
generator = CSVGenerator()
csv_content = generator.generate_csv_from_messages(
chat_file="chat-001.json",
output_file="output.csv",
num_rows=20
)
许可证
MIT License
相关链接
Metadata
Release files for at-chat-mask 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| at_chat_mask-0.3.0.tar.gz | 32.2 kB | Without provenance | Details for at_chat_mask-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| at_chat_mask-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for at_chat_mask-0.3.0-py3-none-any.whl |
Total release size: 65.8 kB
Release files / at_chat_mask-0.3.0.tar.gz
| Download URL | at_chat_mask-0.3.0.tar.gz |
|---|---|
| Size | 32.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52108354ea80457b0c055a89e86b2671442620b445d012945a9014b2ca6e41a0
|
|
BLAKE2b-256 checksum How to use checksums |
6f68ab9055e892fff8607dab7326b96b6fcf2cd7f85f72c7d02f0191baf3d587
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Release files / at_chat_mask-0.3.0-py3-none-any.whl
| Download URL | at_chat_mask-0.3.0-py3-none-any.whl |
|---|---|
| Size | 33.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41baea30087362080b76a01c7a1f709c3bdd4617dbc552631374bd352326c943
|
|
BLAKE2b-256 checksum How to use checksums |
4e3f6f2ebb1d4de604883289e2d259f07df521b9e07290ef7648923cc278def3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Security for at-chat-mask 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.