diff --git a/docs/docs/how_to/dynamic_chain.ipynb b/docs/docs/how_to/dynamic_chain.ipynb index 2f8c26efd2a..53790472a4a 100644 --- a/docs/docs/how_to/dynamic_chain.ipynb +++ b/docs/docs/how_to/dynamic_chain.ipynb @@ -58,6 +58,8 @@ } ], "source": [ + "from operator import itemgetter\n", + "\n", "from langchain_core.output_parsers import StrOutputParser\n", "from langchain_core.prompts import ChatPromptTemplate\n", "from langchain_core.runnables import Runnable, RunnablePassthrough, chain\n", @@ -86,7 +88,7 @@ " # NOTE: This is returning another Runnable, not an actual output.\n", " return contextualize_question\n", " else:\n", - " return RunnablePassthrough()\n", + " return RunnablePassthrough() | itemgetter(\"question\")\n", "\n", "\n", "@chain\n",