on_event,即可在运行期间接收结构化生命周期事件。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
观察 Ruby Agent 运行、模型轮次、工具、暂停和完成事件。
on_event,即可在运行期间接收结构化生命周期事件。
result = agent.run(
input: prompt,
client: client,
on_event: ->(event) {
logger.info(
"agent event",
type: event[:type],
run_id: event[:run_id],
details: event[:details]
)
}
)