AS AgentScopeAPI 手册 / API Reference
智能体运行时Agent runtime · 单元Unit 02

智能体生命周期:一次回复到底发生了什么Agent lifecycle: what happens during one reply

沿着 reply / reply_stream 走完一次推理:组装上下文、调用模型、执行工具、回填结果、更新状态。掌握中断、观察、压缩与迭代上限。Walk one reply end to end: assemble context, call the model, run tools, feed results back and persist state. Learn interruption, observation, compression and iteration limits.

10 道题questions 5 张概念卡concept cards 4 个相关事故related incidents

学习目标Learning goals

  • 区分 reply、reply_stream、observe 的职责Tell reply, reply_stream and observe apart
  • 解释 ReAct 循环如何决定继续调用工具还是结束Explain how the ReAct loop decides to call more tools or finish
  • 在 Java 中找到 call、stream、interrupt 的对应入口Find call, stream and interrupt entry points in Java

概念闪卡Concept cards

点击卡片翻面查看解释。Click a card to flip it and reveal the explanation.

关键 APIKey APIs

点击进入对应的 Python 或 Java 参考页。Open the exact Python or Java reference for each type.

问题巩固Check yourself

完成 10 道题;答错会自动进入错题本。Answer all ten questions. Wrong answers are added to your wrong-answer book automatically.

01Python 中执行一次完整回复的入口是?Which Python method runs one complete reply?
02需要边生成边展示给前端时用哪个方法?Which method streams output to a UI as it is generated?
03只把外部消息写入上下文、不触发回复,应调用?How do you write an external message into context without triggering a reply?
04上下文接近窗口上限时,优先使用哪个 API?Which API should you use when context approaches the window limit?
05Java 中发起非流式调用使用哪个方法?Which Java method starts a non-streaming call?
06Java 中需要事件流时使用哪个方法?Which Java method produces an event stream?
07Java 中取消正在运行的智能体的方法是?How do you cancel a running Java agent?
08保存可恢复会话状态的核心类型是?Which type stores recoverable conversation state?
09ReAct 循环的迭代与推理参数由哪个配置类型承载?Which config type carries ReAct iteration and reasoning settings?
10达到最大迭代次数时会发出哪个事件?Which event is emitted when the maximum iteration count is reached?

接着看的生产事故Production incidents to read next

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.