当地代理

属性

物体携带什么, 以及其中哪一个是活在运行中。

live while runningid before the first runtoolNames is what was selected
Using Python?

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

idstring|null

会话标识符, 设定在 memory 开着 null 否则。

modelstring

代理商的模型。 对于哪个模型起到转弯作用, 请读 turn 活动。

modestring

生效模式。 更改为 setMode().

titlestring

取自会议的第一个信息。

usageobject

{ credits, turns, toolCalls } - 每次运行开始时重置,包括分剂。

contextobject

{ tokens, limit, window, cachedTokens, cleared, parts }.

todosarray

目前的计划。

toolNamesstring[]

给该代理器提供了工具, 包括自定义工具 。

libraryobject

{ skills, subagents } - 上次装子弹的是什么?

libraryStatusobject

为什么图书馆是空的?

mcpServersarray

此运行可能使用的连接服务器 。

machine · files · shellobject

给它的东西

运行时的哪些变化

const running = agent.run({ message: "…" });

const timer = setInterval(() => {
  console.log(agent.usage.credits, "credits ·", agent.context.tokens, "tokens");
}, 1000);

await running;
clearInterval(timer);
import threading

done = threading.Event()

def watch():
    while not done.wait(1):
        print(agent.usage["credits"], "credits ·", agent.context["tokens"], "tokens")

threading.Thread(target=watch, daemon=True).start()
agent.run(message="…")
done.set()

usage, context, todos 和 library 事件是更好的渠道——在变化时,它们携带的数字相同——但投票工作。

使用量为每运行一次

每次运行开始时都重置它

这不是代理对象的运行总计。 如果您需要全部对话费用, 请自己保持数字的运行 。

外 野 域 , 按字段分列

字段是
tokens上转弯的大小, 正如供应商测量的
limit生效的限制
window模型的窗口是自己的,或者 null 如果目录无法读取
cachedTokens提供商从缓存中得到了什么服务
cleared有多少工具结果被清空
parts{ system, tools, memory, messages }

工具Name 指选择了什么,而不是声明了什么

一种无法运行于机器的工具 bash 手机上没有贝壳, skill 和 task 只有在图书馆有内容时才出现, 所以在第一次运行之前它们不在列表中 。