Resolved: Why use RunnablePassThrough if we can do it directly?
Hi,
I still don't get the idea from the example given in this lecture
because if we try something like:
chain_tools = chat_template_tools | chat | {'tools': string_parser)
wouldn't it return the same result which also can be passed to chain_strategy?
Hey David,
Thank you for reaching out and apologies for the late response!
Indeed, you've suggested an approach that outputs the same result as the one presented in the lecture, I appreciate your observation! The goal of this lesson is to demonstrate the functionality of the RunnablePassthrough()
class using a straightforward example. In this case, we're focusing on how to pass the output of one chain as input to the next, effectively linking the two chains. This concept will become even more valuable in later lectures when we explore more complex examples.
Please feel free to reach out if you have any further questions!
Kind regards,
365 Hristina
I see.
Thanks for the explanation 👍