Exercise#4 LCEL Cheatsheet & Howtos
Objective
Learn to use the various Runnable APIs for building chains.
Use the LangChain Runnable resources below to answer the questions.
Link to LCEL cheatsheet
Link to LCEL How-tos
Useful patterns that you MUST learn:
1. Which Runnable function would you use to setup chain with fallbacks?
solution
2. How can you add retry logic to invoke?
solution
3. How can you set the maximum number of parallel calls?
solution
4. How would you add fields (keys/values) in chain that can be set during invoke/batch/stream?
solution
solution
6. There are 10 fields in the output for a chain, you only want to return 2. How would you accompalish it?
solution
7. How can you create a visual representation of a chain?
solution
8. You would like to see all prompts handled in a chain?
solution
9. Variables are not passed to the next chain automatically. How would you pass data through?
solution
solution
Checkout LCEL cheatsheet
- Open the link below or use the PDF to try out the various Runnable capabilities.
- Bookmark link for future reference