datasette-agent 0.2a0 Released: Tools Can Ask Users Questions During Execution
Original: datasette-agent 0.2a0
datasette-agent adds mid-execution user prompts and approval-gated SQL saved queries.
datasette-agent 0.2a0 lets tools ask users questions during execution through ToolContext. Unanswered questions suspend the agent turn, render as chat UI forms, and persist across server restarts. A new save_query tool can store agent-written SQL as a Datasette saved query, but only after explicit human approval.
datasette-agent 0.2a0 是 Simon Willison 的 datasette-agent 新版本發布,這次更新聚焦在讓 agent 工具具備更完整的人機協作流程。最重要的新功能是工具可以在執行到一半時向使用者提問。只要工具宣告 context 參數,就會收到 ToolContext 物件,並可透過 await context.ask_user(...) 發出問題。問題型態包含是非題、多選選項,以及自由文字輸入。當問題尚未回答時,agent 的該輪執行會暫停;問題會在聊天 UI 中以表單呈現,並持久化到內部資料庫,因此即使伺服器重啟,暫停中的對話仍可保留。使用者回答後,工具會從頭重新執行,並重播已儲存的答案;因此 release notes 特別提醒,開發者應在執行任何有副作用的操作前先呼叫 ask_user(),避免重跑時造成重複寫入或其他非預期效果。另一個新增功能是內建 save_query 工具,agent 可以把自己寫出的 SQL 儲存為 Datasette 的 stored query。這個動作一律需要人類核准:介面會顯示完整 SQL、建議名稱、資料庫與可見性設定,只有使用者按下 Yes 後才會真的儲存。這反映出 datasette-agent 對資料操作採取較謹慎的互動式設計,讓 agent 可以提出建議與準備操作,但把最終寫入權保留給人。文章也提到 ask_user() 功能是由 Simon 前一天在 Claude Code 協助下建立的新 LLM alpha 所支援,並標註相關主題為 AI、Datasette、generative AI、LLMs 與 datasette-agent。整體來看,這不是大型產品發布,但對正在做資料庫 agent、SQL 助手或需要可中斷工作流程的開發者而言,是一個具體且實用的 agent 介面能力更新。
Free shows the 3-line summary; Pro unlocks the full deep summary (~300 words) so you never have to click through.
See Pro plans →Want the original English / full article?
Read on Simon Willison's Weblog →Related
Summaries are AI-generated; the original article is authoritative.