AskTable Chat Data Masking Tool - Create demo cases from real chat messages with masked virtual data
Project description
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
相关链接
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file at_chat_mask-0.3.0.tar.gz.
File metadata
- Download URL: at_chat_mask-0.3.0.tar.gz
- Upload date:
- Size: 32.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52108354ea80457b0c055a89e86b2671442620b445d012945a9014b2ca6e41a0
|
|
| MD5 |
9b3dba50a2eba131d4ac0779d718231e
|
|
| BLAKE2b-256 |
6f68ab9055e892fff8607dab7326b96b6fcf2cd7f85f72c7d02f0191baf3d587
|
File details
Details for the file at_chat_mask-0.3.0-py3-none-any.whl.
File metadata
- Download URL: at_chat_mask-0.3.0-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41baea30087362080b76a01c7a1f709c3bdd4617dbc552631374bd352326c943
|
|
| MD5 |
d327417012f6698b3e145e6c7614be05
|
|
| BLAKE2b-256 |
4e3f6f2ebb1d4de604883289e2d259f07df521b9e07290ef7648923cc278def3
|