返回 2026-06-09
🛠 工具 / 开源

datasette-agent-edit 0.1a0datasette-agent-edit 0.1a0

simonwillison.net·2026-06-07 节选正文

datasette-agent-edit 是一个新发布的 Datasette Agent 插件,旨在让 AI 智能体能够直接编辑现有的文本内容。该插件主要针对协作式 Markdown 编辑、更新大型 SQL 查询以及编辑 SVG 文件等复杂场景设计。由于让 AI 智能体精准地修改文本而不破坏原有结构极具挑战性,该工具采用了一套经过精心设计的交互模式来确保编辑的准确性。这为构建基于 AI 驱动的数据管理和内容编辑工作流提供了关键的底层支持。

Simon Willison

I'm planning several plugins for Datasette Agent which can make edits to existing pieces of text - things like collaborative Markdown editing, updating large SQL queries, and editing SVG files.

Agentic editing of text is a little tricky to get right. My favorite published design for this is for the Claude text editor, which implements the following tools:

  • view - view sections of a file, with line numbers added to every line.
  • str_replace - find an exact old_str and replace it with new_str - fail if the original string is not unique
  • insert - insert the specified text after the specified line number
  • Rather than recreate these patterns for every plugin that needs them I decided to create this base plugin, datasette-agent-edit, which implements the core tools in a way that allows them to be adapted for other plugins.

    需要完整排版与评论请前往来源站点阅读。