docs: Add in code documentation to core Runnable map methods (docs only) (#19517)

- **Issue:** #18804
- @baskaryan, @eyurtsev
pull/18437/head^2
Guangdong Liu 2 months ago committed by GitHub
parent 0199b73188
commit c93d4ea91c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1491,6 +1491,18 @@ class Runnable(Generic[Input, Output], ABC):
"""
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with each input.
Example:
.. code-block:: python
from langchain_core.runnables import RunnableLambda
def _lambda(x: int) -> int:
return x + 1
runnable = RunnableLambda(_lambda)
print(runnable.map().invoke([1, 2, 3])) # [2, 3, 4]
"""
return RunnableEach(bound=self)

Loading…
Cancel
Save