langchain_core.tracers.context
.collect_runs¶
- langchain_core.tracers.context.collect_runs() Generator[RunCollectorCallbackHandler, None, None] [source]¶
Collect all run traces in context.
- Returns
The run collector callback handler.
- Return type
Example
>>> with collect_runs() as runs_cb: chain.invoke("foo") run_id = runs_cb.traced_runs[0].id