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_v1.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5194c6e6_de52_7a1b_ac56_512224280a86["test_sync_in_async_stream_lambdas()"]
  8ff41f3c_f250_f8de_8094_4f24860a10e0["test_runnable_events_v1.py"]
  5194c6e6_de52_7a1b_ac56_512224280a86 -->|defined in| 8ff41f3c_f250_f8de_8094_4f24860a10e0
  aac0453e_34cd_4dce_c7fa_f176ab20140b["_collect_events()"]
  5194c6e6_de52_7a1b_ac56_512224280a86 -->|calls| aac0453e_34cd_4dce_c7fa_f176ab20140b
  6ebe7fde_6e8f_dae5_d42f_9cea181617f5["_assert_events_equal_allow_superset_metadata()"]
  5194c6e6_de52_7a1b_ac56_512224280a86 -->|calls| 6ebe7fde_6e8f_dae5_d42f_9cea181617f5
  style 5194c6e6_de52_7a1b_ac56_512224280a86 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_runnable_events_v1.py lines 2098–2114

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

    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="v1"))
    _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_v1.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_v1.py at line 2098.
What does test_sync_in_async_stream_lambdas() call?
test_sync_in_async_stream_lambdas() calls 2 function(s): _assert_events_equal_allow_superset_metadata, _collect_events.

Analyze Your Own Codebase

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

Try Supermodel Free