服务端智能体

stop()

agent.stop() → Promise<{ ok, stopped }>

要求平台结束运行中运行。 没有运行中的运行者, 它回答说没有什么可以停止的。

one requestno-op when idlesignal is the other way
Using Python?

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

const running = agent.run({ inputs, onStep });
setTimeout(() => agent.stop(), 30_000);
const result = await running;
import threading

threading.Timer(30, agent.stop).start()   # stop() is safe to call from another thread
result = agent.run(inputs=inputs, on_step=on_step)

什么都没有运行

答案是: { ok: true, stopped: false } 并且不提出要求——安全地从一个不追踪运行是否在飞行中的接口打电话。

停止() 和信号不相同

stop()信号信号信号信号
告诉平台停止否 是无 无
结束您的请求运行结束时,立即
跑步可能继续无 无否 是
中止请求不会停止工作

运行在平台上继续, 任何支出都仍然用完。 使用停止( ) 结束工作并信号停止等待 。 当你同时表示, 请先拨打停止 ( ) 。

本地引擎的停停站不同

循环在你的过程中,所以 ( 停止) 立即提出,无需任何请求。