Recall & Review
beginner
What is RunnablePassthrough in Langchain?
RunnablePassthrough is a simple component that returns the input it receives without any changes. Think of it like a mirror that just reflects what you give it.
Click to reveal answer
beginner
How does RunnableLambda differ from RunnablePassthrough?
RunnableLambda lets you run any custom function you write on the input. Unlike RunnablePassthrough, it can change or process the input before giving back a result.
Click to reveal answer
intermediate
Show a simple example of RunnableLambda usage.
You can create a RunnableLambda that adds 1 to a number: <br> runnable = RunnableLambda(lambda x: x + 1) <br> runnable.invoke(5) returns 6.
Click to reveal answer
intermediate
Why use RunnablePassthrough in a chain?
RunnablePassthrough is useful when you want to pass data through a chain step without changing it. It helps keep the flow simple and clear.
Click to reveal answer
beginner
What method do you call to run the logic inside RunnableLambda or RunnablePassthrough?
You call the 'invoke' method with your input to run the logic and get the output.
Click to reveal answer
What does RunnablePassthrough do with the input it receives?
✗ Incorrect
RunnablePassthrough simply returns the input as it is without any changes.
Which Runnable lets you run a custom function on the input?
✗ Incorrect
RunnableLambda runs any custom function you provide on the input.
How do you execute the logic inside a RunnableLambda?
✗ Incorrect
The 'invoke' method runs the logic inside RunnableLambda or RunnablePassthrough.
If you want to pass data through a chain without changing it, which Runnable should you use?
✗ Incorrect
RunnablePassthrough passes data unchanged through the chain.
What is a real-life analogy for RunnablePassthrough?
✗ Incorrect
RunnablePassthrough acts like a mirror, returning exactly what it receives.
Explain the difference between RunnablePassthrough and RunnableLambda in Langchain.
Think about whether the input changes or not.
You got /4 concepts.
Describe a scenario where you would use RunnablePassthrough in a chain.
Imagine passing a message along without editing it.
You got /3 concepts.