_collect_events() — langchain Function Reference
Architecture documentation for the _collect_events() function in test_runnable_events_v1.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD aac0453e_34cd_4dce_c7fa_f176ab20140b["_collect_events()"] 8ff41f3c_f250_f8de_8094_4f24860a10e0["test_runnable_events_v1.py"] aac0453e_34cd_4dce_c7fa_f176ab20140b -->|defined in| 8ff41f3c_f250_f8de_8094_4f24860a10e0 0456b5d0_23e7_8258_27a4_1e88a877075e["test_event_stream_with_simple_function_tool()"] 0456b5d0_23e7_8258_27a4_1e88a877075e -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 6a044752_ad8d_6390_319f_205db62c97ca["test_event_stream_with_single_lambda()"] 6a044752_ad8d_6390_319f_205db62c97ca -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b e005ead2_f2cd_df65_8d30_ce23227985ea["test_event_stream_with_triple_lambda()"] e005ead2_f2cd_df65_8d30_ce23227985ea -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 142ebabf_ab44_c865_63c4_88d9cd1e6b1a["test_event_stream_with_triple_lambda_test_filtering()"] 142ebabf_ab44_c865_63c4_88d9cd1e6b1a -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 0a6e7d5b_66e8_273f_ec47_facca96480a0["test_event_stream_with_lambdas_from_lambda()"] 0a6e7d5b_66e8_273f_ec47_facca96480a0 -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 30efcf28_5850_b85b_5a4e_32dd66180dfa["test_astream_events_from_model()"] 30efcf28_5850_b85b_5a4e_32dd66180dfa -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 5afb8c1f_95cf_1de6_8a84_86e359af0582["test_event_stream_with_simple_chain()"] 5afb8c1f_95cf_1de6_8a84_86e359af0582 -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 866e59ec_9b04_395f_5ae3_1a283a31e020["test_event_streaming_with_tools()"] 866e59ec_9b04_395f_5ae3_1a283a31e020 -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 295358bd_67d0_b540_cd55_e172b4dc6898["test_event_stream_with_retriever()"] 295358bd_67d0_b540_cd55_e172b4dc6898 -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 886b2338_b05c_8c68_c508_9e36f9ae2131["test_event_stream_with_retriever_and_formatter()"] 886b2338_b05c_8c68_c508_9e36f9ae2131 -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 27442f0d_99fb_ef73_02c6_ca9504b43c9d["test_event_stream_on_chain_with_tool()"] 27442f0d_99fb_ef73_02c6_ca9504b43c9d -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 9d9ca4fa_50fe_f5e2_5299_a822943e33f6["test_with_llm()"] 9d9ca4fa_50fe_f5e2_5299_a822943e33f6 -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b 3d788f98_8b32_89a7_b636_aa44f3c4900d["test_events_astream_config()"] 3d788f98_8b32_89a7_b636_aa44f3c4900d -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b style aac0453e_34cd_4dce_c7fa_f176ab20140b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/runnables/test_runnable_events_v1.py lines 47–53
async def _collect_events(events: AsyncIterator[StreamEvent]) -> list[StreamEvent]:
"""Collect the events and remove the run ids."""
materialized_events = [event async for event in events]
events_ = _with_nulled_run_id(materialized_events)
for event in events_:
event["tags"] = sorted(event["tags"])
return events_
Domain
Subdomains
Calls
Called By
- test_astream_events_from_model()
- test_async_in_async_stream_lambdas()
- test_event_stream_on_chain_with_tool()
- test_event_stream_with_lambdas_from_lambda()
- test_event_stream_with_retriever()
- test_event_stream_with_retriever_and_formatter()
- test_event_stream_with_simple_chain()
- test_event_stream_with_simple_function_tool()
- test_event_stream_with_single_lambda()
- test_event_stream_with_triple_lambda()
- test_event_stream_with_triple_lambda_test_filtering()
- test_event_streaming_with_tools()
- test_events_astream_config()
- test_sync_in_async_stream_lambdas()
- test_sync_in_sync_lambdas()
- test_with_llm()
Source
Frequently Asked Questions
What does _collect_events() do?
_collect_events() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_runnable_events_v1.py.
Where is _collect_events() defined?
_collect_events() is defined in libs/core/tests/unit_tests/runnables/test_runnable_events_v1.py at line 47.
What does _collect_events() call?
_collect_events() calls 1 function(s): _with_nulled_run_id.
What calls _collect_events()?
_collect_events() is called by 16 function(s): test_astream_events_from_model, test_async_in_async_stream_lambdas, test_event_stream_on_chain_with_tool, test_event_stream_with_lambdas_from_lambda, test_event_stream_with_retriever, test_event_stream_with_retriever_and_formatter, test_event_stream_with_simple_chain, test_event_stream_with_simple_function_tool, and 8 more.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free