Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Composes LangChain 1.0 LCEL chains using RunnableParallel, RunnableBranch, RunnablePassthrough.assign and RunnableLambda, with debug probes.
83% 96%+13 ptsof test cases passed
Passed 23 of 24 test cases with the skill, and 20 of 24 without it.
An engineer pipes a document retriever returning `list[Document]` directly into `ChatPromptTemplate` using the pipe operator `|`. Why does this cause a `KeyError` or schema failure at the prompt template stage?
Notes that passing a list directly replaces the dictionary state needed by downstream stages.
3 of 3 safety checks passed
An engineer wires a four-stage LCEL chain: classify the question, retrieve context, format the prompt, invoke the LLM. It looks clean:
chain = (
RunnablePassthrough.assign(category=classifier)
| RunnablePassthrough.assign(docs=retriever)
| prompt
| llm
| StrOutputParser()
)
chain.invoke({"question": "What's our refund policy?"})
The call returns this:
Traceback (most recent call last):
...
File ".../runnables/base.py", line 3421, in _call_with_config
output = call_func_with_variable_args(func, input, ...)
File ".../prompts/chat.py", line 1021, in _format_messages
return await ... await self.ainvoke({**kwargs})
KeyError: 'question'
Nothing in that stack says which stage produced the wrong dict shape. The
RunnablePassthrough.assign(docs=retriever) call silently rebuilt the dict
and — because retriever was itself a Runnable[str, list[Document]] that
took the question string, not the dict — a mis-piped intermediate value
overwrote the question key. The prompt template expected {question} and
blew up. This is P06 in the pack's pain catalog: .pipe() on mismatched dict
shape raises KeyError deep in runnable internals with no hint at the
offending stage.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.