Exercise#3 Sequential chain
Objective
Create a chain using LCEL for the use case depicted in the illustration below.
- Create a chain#1 for generating the definition.
- Create a chain#2 for scoring
- Create a sequential chain with chain#1 and chain#2
- You may select any LLM
- Use same or different LLM for the two chains
Hints:
- Each chain will consist of a prompt template and an LLM component.
- Output from chain#1 is mapped as input to chain#2 using expression {“output”: chain_1} | chain_2
Solution
Local Jupyter Lab setup
Google Colab
- Don’t forget to follow the instructions for setting up notebook runtime