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

datasette-agent 0.2a0 发布datasette-agent 0.2a0

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

datasette-agent 发布 0.2a0 版本,核心新功能是工具在执行过程中可以向用户提问。通过声明 `context` 参数,工具获得 `ToolContext` 对象,可调用 `await context.ask_user(...)` 发起是/否、多选或自由文本类型的交互。这使得 AI Agent 在执行复杂任务时能够在关键决策点暂停并获取人类反馈。该功能显著提升了 Agent 工作流的安全性和可控性。

Simon Willison

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.

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