字段
modelstring哪个模式 下 个 并非总是你要求的 后退 每一转弯都会改变它。
durationMsinteger转弯要多久
inputTokensinteger|null供应商在进入时所指望的是什么。
cachedTokensinteger提供商从储藏处得到了多少服务
contextTokensinteger对话框的大小与所测量的对话框大小相同。 inputTokens 有空时。
contextLimitinteger有效限度——你的 contextTokens,或违约。
contextPartsobject{ system, tools, memory, messages },因此它们加起来等于总数。
contextClearedinteger到目前为止,这次清理工作已经清空了多少工具结果。
creditsinteger转弯要花多少钱?
totalCreditsinteger至今为止,运行的代价是多少? 将工具一起转转,然后将工具一起转.
上下文测量
onEvent: (e) => {
if (e.type !== "turn") return;
const pct = Math.round((e.contextTokens / e.contextLimit) * 100);
console.log(`${pct}% of the window · ${e.cachedTokens} cached · ${e.contextCleared} results cleared`);
console.log(e.contextParts); // { system: 2100, tools: 3900, memory: 180, messages: 25024 }
};# Python has no "turn" event: read agent.context and agent.usage whenever a tool finishes
def on_event(event):
if event["type"] != "tool_end":
return
context = agent.context
pct = round(context["tokens"] / context["limit"] * 100)
print(f"{pct}% of the window · {context['cleared']} results cleared")
print(context["parts"]) # {"system": 2100, "tools": 3900, "memory": 0, "messages": 25024}提供商给出了总数。 部件根据其大小估算, 然后缩放, 四个组合完全相加—— 比例合理, 单个部分接近而不是精确。
已经计算工具的 credits 已经计算
当工具完成时, 支付的工具的成本会添加到运行总量中, 因此下一转事件已经包含它。 添加两者后算出两次。 账户工具所读的余额是平衡, 不是成本 — 把它当做运行看起来非常昂贵。
哪个模型在其中
字段是转弯的模型。 观察它就是静态降解如何变得可见: 以一个模型开始、 后退结束的运行 已经是不好的时机, 即使每个答案都很好 。
值得显示的名
长期对话的前缀稳定,主要来自缓存,缓存输入的账单比正常费率少了一小部分。 两个转弯之间跌至零的数字意味着快感变化的开始时间,即新工具、新存储、已清理的批次。
它们随身携带 palclId —— 启动它们的任务电话的识别符号 —— 以及代理、 其名称。 他们自己的代号与任务名称相加, 所以两个运行时不会相撞 。 在将事件作为主运行程序处理之前先测试 palId 。