The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
docs: Refine RunnablePassthrough docstring (#19812)
Alexander Smirnovece008f11790
diff --git a/libs/core/langchain_core/runnables/passthrough.py b/libs/core/langchain_core/runnables/passthrough.pyindex 6b1b9ad564..55d61093ec 100644--- a/libs/core/langchain_core/runnables/passthrough.py+++ b/libs/core/langchain_core/runnables/passthrough.py@@ -107,7 +107,7 @@ class RunnablePassthrough(RunnableSerializable[Other, Other]):.. code-block:: python- from langchain_core.runnables import RunnablePassthrough, RunnableParallel+ from langchain_core.runnables import RunnablePassthroughdef fake_llm(prompt: str) -> str: # Fake LLM for the examplereturn "completion"@@ -115,10 +115,9 @@ class RunnablePassthrough(RunnableSerializable[Other, Other]):runnable = {'llm1': fake_llm,'llm2': fake_llm,- }- | RunnablePassthrough.assign(+ } | RunnablePassthrough.assign(total_chars=lambda inputs: len(inputs['llm1'] + inputs['llm2'])- )+ )runnable.invoke('hello')# {'llm1': 'completion', 'llm2': 'completion', 'total_chars': 20}