模式

询问询问

mode: "ask"

默认值。 阅读是免费的; 任何改变事物的东西都会先回溯到您, 并手头的参数 。

the defaultreads are freealways for a first run
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

这是当您还不知道代理商会用什么任务时使用的模式—— 任务大多是第一次运行, 而每次运行时都是您没有写入的材料 。

询问什么

类别在问问模式中
read · memory · task允许, 从未问过
write问 询 always 记住会话的工具
exec问- always 命令一直截命令,便写为磁盘
storage问- always 用于会话的每个存储
dns问- always 以每个域为域,用于会话
send · publish · money每次都问,没有 always
const agent = api.agents.create({
  runtime: "local",
  machine: pc,
  model: "gemini-3.5-flash",
  mode: "ask",
  onPermission: async ({ tool, category, args }) => {
    if (category === "exec") return "deny";          // no commands at all
    if (tool === "write" && args.path.startsWith("src/")) return "always";
    return "once";
  },
});
def on_permission(request):
    if request["category"] == "exec":
        return "deny"                                   # no commands at all
    if request["tool"] == "write" and request["args"].get("path", "").startswith("src/"):
        return "always"
    return "once"

agent = api.agents.create(
    runtime="local",
    machine=pc,
    model="gemini-3.5-flash",
    mode="ask",
    on_permission=on_permission,
)

不带回调,只能读

不可在 ppermission 上没有 Propermission 表示每条更改都被拒绝

拒绝是明确的——“这一行动需要用户批准,没有人能够批准——它又回到了模式,这个模式可以调整。所以一个在询问模式中的代理,没有回调,行为接近计划模式,而其指示中却没有这样说。

拒绝即信息

deny 不是一个错误:工具返回“被用户拒绝 ” 。 ” 因其结果,循环继续。 模型被告知不要重试被拒绝的工具, 并改写或解释 。

今后从何往何去

  • Repetitive edits on a project you trust → auto.
  • 任何动作之前你都想要一个计划 计划计划.
  • 看着你一走就批准你 留在这