test_event_stream_with_single_lambda() — langchain Function Reference
Architecture documentation for the test_event_stream_with_single_lambda() function in test_runnable_events_v2.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD a3a2bed1_7de2_374e_18a8_9a1b2ca43337["test_event_stream_with_single_lambda()"] 33c02978_2077_5819_7048_bc2a81e80625["test_runnable_events_v2.py"] a3a2bed1_7de2_374e_18a8_9a1b2ca43337 -->|defined in| 33c02978_2077_5819_7048_bc2a81e80625 716d2a5e_dc8e_3cae_e044_b56b06bee655["_collect_events()"] a3a2bed1_7de2_374e_18a8_9a1b2ca43337 -->|calls| 716d2a5e_dc8e_3cae_e044_b56b06bee655 style a3a2bed1_7de2_374e_18a8_9a1b2ca43337 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/runnables/test_runnable_events_v2.py lines 188–229
async def test_event_stream_with_single_lambda() -> None:
"""Test the event stream with a tool."""
def reverse(s: str) -> str:
"""Reverse a string."""
return s[::-1]
chain = RunnableLambda(func=reverse)
events = await _collect_events(chain.astream_events("hello", version="v2"))
_assert_events_equal_allow_superset_metadata(
events,
[
{
"data": {"input": "hello"},
"event": "on_chain_start",
"metadata": {},
"name": "reverse",
"run_id": "",
"parent_ids": [],
"tags": [],
},
{
"data": {"chunk": "olleh"},
"event": "on_chain_stream",
"metadata": {},
"name": "reverse",
"run_id": "",
"parent_ids": [],
"tags": [],
},
{
"data": {"output": "olleh"},
"event": "on_chain_end",
"metadata": {},
"name": "reverse",
"run_id": "",
"parent_ids": [],
"tags": [],
},
],
)
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does test_event_stream_with_single_lambda() do?
test_event_stream_with_single_lambda() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_runnable_events_v2.py.
Where is test_event_stream_with_single_lambda() defined?
test_event_stream_with_single_lambda() is defined in libs/core/tests/unit_tests/runnables/test_runnable_events_v2.py at line 188.
What does test_event_stream_with_single_lambda() call?
test_event_stream_with_single_lambda() calls 1 function(s): _collect_events.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free