Home / Function/ test_recursive_lambda() — langchain Function Reference

test_recursive_lambda() — langchain Function Reference

Architecture documentation for the test_recursive_lambda() function in test_runnable.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  690bb842_24b9_7a9c_8dce_5b13d9848af8["test_recursive_lambda()"]
  26df6ad8_0189_51d0_c3c1_6c3248893ff5["test_runnable.py"]
  690bb842_24b9_7a9c_8dce_5b13d9848af8 -->|defined in| 26df6ad8_0189_51d0_c3c1_6c3248893ff5
  fb618d44_c03b_ea8b_385b_2278dfb173d4["invoke()"]
  690bb842_24b9_7a9c_8dce_5b13d9848af8 -->|calls| fb618d44_c03b_ea8b_385b_2278dfb173d4
  style 690bb842_24b9_7a9c_8dce_5b13d9848af8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_runnable.py lines 3852–3862

def test_recursive_lambda() -> None:
    def _simple_recursion(x: int) -> int | Runnable:
        if x < 10:
            return RunnableLambda(lambda *_: _simple_recursion(x + 1))
        return x

    runnable = RunnableLambda(_simple_recursion)
    assert runnable.invoke(5) == 10

    with pytest.raises(RecursionError):
        runnable.invoke(0, {"recursion_limit": 9})

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_recursive_lambda() do?
test_recursive_lambda() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_runnable.py.
Where is test_recursive_lambda() defined?
test_recursive_lambda() is defined in libs/core/tests/unit_tests/runnables/test_runnable.py at line 3852.
What does test_recursive_lambda() call?
test_recursive_lambda() calls 1 function(s): invoke.

Analyze Your Own Codebase

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

Try Supermodel Free