事件

文字文字文字文字

{ type: "text", text, final }

转弯的完整文本,曾经。 text_delta,它到达 片块 ,而转弯 还在写。

one per turn with textfinal says if it is the answertext_delta streams
Using Python?

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

字段

textstring

模特儿写的每件事 都写在这个转弯

finalboolean

true 当转弯要求没有工具的时候,这就是答案,而环形环形环形的结束。

多数文本不是答案

通常在拨打工具前先写一句, final: false。只有最后一个,即没有工具电话的转弯,才是答案。

onEvent: (e) => {
  if (e.type !== "text") return;
  if (e.final) showAnswer(e.text);
  else showThinkingAloud(e.text);
}
def on_event(event):
    if event["type"] == "text":
        show_answer(event["text"])

text_delta

{ type: "text_delta", delta: "I will read " }
# The Python engine emits each turn's text as one "text" event;
# to stream it token by token, call api.models.turn(on_text=...) directly.
{"type": "text", "text": "I will read the four notes…"}

供货商每件一件一件地生产它。这是唯一的运抵事件。 期间 转弯——其他的一切都是在两件事之间发出的。

不同时翻转同一转

转角的三角洲加起来正好是其文字事件。一个显示显示显示,附加三角洲,然后附加文字,每个回答两次。流出三角洲,用文字替换流出的文字,或者忽略其中的一个。

授权代表的运行发送一份最后文本

当信件以 @agent,命名代理人从事这项工作并提出报告 是 答案:一 text 与 final: true,然后 done.

运行返回最后一个

result.text 运行量的最近文本——在以上限结束的运行中,运行量不得以上限为准。 final检查 stopReason 告诉你它是否是一个答案。

子智能体事件也会传递到这里

它们随身携带 palclId —— 启动它们的任务电话的识别符号 —— 以及代理、 其名称。 他们自己的代号与任务名称相加, 所以两个运行时不会相撞 。 在将事件作为主运行程序处理之前先测试 palId 。