The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Add another test
Nuno Campos6424b3cde013
diff --git a/libs/langchain/tests/unit_tests/schema/runnable/test_runnable.py b/libs/langchain/tests/unit_tests/schema/runnable/test_runnable.pyindex 5214f5b366..f244753310 100644--- a/libs/langchain/tests/unit_tests/schema/runnable/test_runnable.py+++ b/libs/langchain/tests/unit_tests/schema/runnable/test_runnable.py@@ -1,5 +1,5 @@from operator import itemgetter-from typing import Any, Dict, List, Optional+from typing import Any, Dict, List, Optional, Unionfrom uuid import UUIDimport pytest@@ -1282,3 +1282,17 @@ def test_each(snapshot: SnapshotAssertion) -> None:"test","this",]+++def test_recursive_lambda() -> None:+ def _simple_recursion(x: int) -> Union[int, Runnable]:+ if x < 10:+ return RunnableLambda(lambda *args: _simple_recursion(x + 1))+ else:+ return x++ runnable = RunnableLambda(_simple_recursion)+ assert runnable.invoke(5) == 10++ with pytest.raises(RecursionError):+ runnable.invoke(0, {"recursion_limit": 9})