Chapter 5: Chains

LangChain has a ‘chain’ in its name because of the Chains module. So you can understand its importance. This chapter is a crucial one as in the upcoming chapters, we will be using many chain objects.

 

So pay attention !!

Chains can be considered as short programs written around LLMs to execute some complex tasks. It can chain multiple different components like 3rd party tools, python codes, other LangChain modules like prompt or output parsers, etc. with an LLM or even another LLM with an LLM to get to the final output. For example: Assume you wish to create a comic using LLMs. Now this is quite feasible but will include a few steps at a very minimal:

  1. Using an LLM and input topic, generate a structure.
  2. Write each chapter ...

Get LangChain in your Pocket now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.