Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Last answered:

13 Aug 2024

Posted on:

03 Aug 2024

0

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?

2 answers ( 1 marked as helpful)
Instructor
Posted on:

12 Aug 2024

1

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

Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Posted on:

13 Aug 2024

0

I see.

Thanks for the explanation 👍 

Submit an answer