Home / Function/ test_sync_in_async_stream_lambdas() — langchain Function Reference

test_sync_in_async_stream_lambdas() — langchain Function Reference

Architecture documentation for the test_sync_in_async_stream_lambdas() function in test_runnable_events_v2.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  3db5fdbb_6403_35f8_865b_23a77ed22db0["test_sync_in_async_stream_lambdas()"]
  33c02978_2077_5819_7048_bc2a81e80625["test_runnable_events_v2.py"]
  3db5fdbb_6403_35f8_865b_23a77ed22db0 -->|defined in| 33c02978_2077_5819_7048_bc2a81e80625
  96cda70a_ff2d_eca4_0fa9_2ffa9cde3432["stream()"]
  3db5fdbb_6403_35f8_865b_23a77ed22db0 -->|calls| 96cda70a_ff2d_eca4_0fa9_2ffa9cde3432
  716d2a5e_dc8e_3cae_e044_b56b06bee655["_collect_events()"]
  3db5fdbb_6403_35f8_865b_23a77ed22db0 -->|calls| 716d2a5e_dc8e_3cae_e044_b56b06bee655
  style 3db5fdbb_6403_35f8_865b_23a77ed22db0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_runnable_events_v2.py lines 2061–2078

async def test_sync_in_async_stream_lambdas(blockbuster: BlockBuster) -> None:
    """Test invoking nested runnable lambda."""
    blockbuster.deactivate()

    def add_one(x: int) -> int:
        return x + 1

    add_one_ = RunnableLambda(add_one)

    async def add_one_proxy(x: int, config: RunnableConfig) -> int:
        streaming = add_one_.stream(x, config)
        results = list(streaming)
        return results[0]

    add_one_proxy_ = RunnableLambda(add_one_proxy)

    events = await _collect_events(add_one_proxy_.astream_events(1, version="v2"))
    _assert_events_equal_allow_superset_metadata(events, EXPECTED_EVENTS)

Domain

Subdomains

Frequently Asked Questions

What does test_sync_in_async_stream_lambdas() do?
test_sync_in_async_stream_lambdas() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_runnable_events_v2.py.
Where is test_sync_in_async_stream_lambdas() defined?
test_sync_in_async_stream_lambdas() is defined in libs/core/tests/unit_tests/runnables/test_runnable_events_v2.py at line 2061.
What does test_sync_in_async_stream_lambdas() call?
test_sync_in_async_stream_lambdas() calls 2 function(s): _collect_events, stream.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free