collect_runs#

langchain_core.tracers.context.collect_runs() โ†’ Generator[RunCollectorCallbackHandler, None, None][source]#

ๆ”ถ้›†ไธŠไธ‹ๆ–‡ไธญ็š„ๆ‰€ๆœ‰่ฟ่กŒ่ฝจ่ฟนใ€‚

Yields:

run_collector.RunCollectorCallbackHandler โ€“ ่ฟ่กŒๆ”ถ้›†ๅ™จๅ›ž่ฐƒๅค„็†็จ‹ๅบใ€‚

Return type:

็”Ÿๆˆๅ™จ[RunCollectorCallbackHandler, None, None]

็คบไพ‹

>>> with collect_runs() as runs_cb:
        chain.invoke("foo")
        run_id = runs_cb.traced_runs[0].id