langchain_core.tracers.context
.collect_runs¶
- langchain_core.tracers.context.collect_runs() 生成器[RunCollectorCallbackHandler, None, None] [源代码]¶
收集上下文中的所有运行跟踪。
- 产生项
run_collector.RunCollectorCallbackHandler – 运行收集器回调处理程序。
- 返回类型
Generator[RunCollectorCallbackHandler, None, None]
示例
>>> with collect_runs() as runs_cb: chain.invoke("foo") run_id = runs_cb.traced_runs[0].id