这个版本让 AI 代理在复杂任务中能主动向用户确认关键信息,做 Datasette 数据查询或自动化工具的开发者可以直接用起来,避免 AI 擅自执行危险操作。
datasette-agent 0.2a0 版本发布,核心更新是工具现在可以在执行过程中向用户提问。工具通过 ToolContext 对象支持 yes/no、多选和自由文本三种问题类型。提问时,代理会暂停执行,问题以表单形式显示在聊天界面并持久化到数据库,即使服务器重启也能恢复。用户回答后,工具从头重新执行,因此建议在产生副作用前调用 ask_user()。此外,新增了 save_query 工具,允许代理将 SQL 保存为 Datasette 存储查询,但保存前必须获得用户批准。
datasette-agent 0.2a0
Release: datasette-agent 0.2a0 Highlights from the release notes: Tools can now ask the user questions mid-execution. Tools that declare a context parameter receive a ToolContext object, and await context.ask_user(...) can ask a yes/no, multiple-choice ( options=[...] ) or free-text ( free_text=True ) question. While a question is unanswered the agent turn suspends: the question renders as a form in the chat UI and persists to the internal database, so suspended conversations survive a server restart. Once answered, the tool re-executes from the top with stored answers replayed, so call ask_user() before performing side effects. #20 New built-in save_query tool: the agent can save SQL it has written as a Datasette stored query . Saving always requires human approval - the agent shows the full SQL plus the proposed name, database and visibility, and nothing is stored until you click Yes. #20 The ask_user() feature was enabled by the new LLM alpha I built yesterday with the help of Claude Fable 5. Tags: ai , datasette , generative-ai , llms , datasette-agent