datasette-agent 0.3a0
摘要
Datasette Agent 0.3a0 添加了一个 execute_write_sql 工具,在写入数据库之前请求用户批准,以及 CLI 增强功能和用于自动批准的 unsafe 模式。
暂无内容
查看缓存全文
缓存时间: 2026/06/16 01:01
# 发布:datasette-agent 0.3a0
来源:https://simonwillison.net/2026/Jun/15/datasette-agent/
> - 新工具 `execute_write_sql`,该工具会请求用户批准,然后写入数据库——同时考虑用户权限。#27 (https://github.com/datasette/datasette-agent/issues/27)
我在 datasette-agent 0.2a0 (https://simonwillison.net/2026/Jun/10/datasette-agent/) 中添加了一种请求用户批准的机制。新的 `execute_write_sql` 工具现在可以提示用户执行各种有用的操作。以下是一个示例,我将一些鹈鹕目击记录添加到我的 `pelican_sightings` 表中:
显示写入 SQL 确认对话框的聊天界面截图。用户消息(蓝色气泡):“我看到 4 只鹈鹕飞过港口”。折叠的工具区域:"► Tool: execute_write_sql"。一个黄色边框的确认卡片显示:"Confirm write SQL batch / Database: pelicans / Statements execute in order. If one statement fails, later statements will not be executed. / Statement 1 / INSERT INTO pelican_sightings (number_of_pelicans, notes) VALUES (:number_of_pelicans, :notes); / number_of_pelicans 4 / notes Flying over the harbor"。一个表格,列名为"Operation, Database, Table, Required permissions",行内容为:"insert, pelicans, pelican_sightings",权限按钮为"insert-row", "update-row", "delete-row"。下方显示:"Execute 1 write SQL statement against database 'pelicans'? / Asked by tool: execute_write_sql",带"Yes"(蓝色)和"No"(灰色)按钮。
新版本还增强了 `datasette agent chat` 终端模式,以支持审批,并添加了几个新选项,包括用于自动批准的 `--unsafe` 模式:
> - `datasette agent chat` 可以执行需要用户批准的工具。#30 (https://github.com/datasette/datasette-agent/issues/30)
> - 为 `datasette agent chat` 新增三个选项——`--root` 以 root 身份运行,`--yes` 批准所有请求用户的问题,`--unsafe` 同时启用两者。
> - 现在工具可以提供纯文本替代 HTML,用于在 `datasette agent chat` CLI 中显示。#31 (https://github.com/datasette/datasette-agent/issues/31)
现在可以使用 `datasette agent chat content.db -m gpt-5.5 --unsafe` 命令直接与特定数据库聊天,并通过诸如"创建一个 notes 表"、"添加一条关于 X 的笔记"等提示直接修改该数据库。
相似文章
datasette-agent 0.2a0
datasette-agent 0.2a0 新增了工具在执行过程中向用户提问的功能,并引入了一个需要人工审批的新 save_query 工具。
datasette-agent 0.1a2
datasette-agent 0.1a2,datasette-agent 工具的新 alpha 版本,现已可用。
datasette-agent 0.1a3
Datasette-Agent 0.1a3 已发布,包含UI改进,如'查看SQL查询'按钮、更好地处理空推理块以及改进的截断响应显示。
datasette 1.0a31
Datasette 1.0a31 引入了为具有适当权限的用户执行写入查询和保存存储查询(原称预设查询)的功能,从而增强了数据编辑能力。
datasette-agent-edit 0.1a0
Simon Willison 发布了 datasette-agent-edit 0.1a0,一个 Datasette Agent 的基础插件,实现了可被其他插件复用的智能文本编辑工具(view、str_replace、insert)。