LangChain Tutorial: Deep Dive into the Basic Components of LangChain
101_components To understand how LangChain works, we first need to dive into the foundational building blocks of LangChain called Components , including Schema , Models , Prompts , Indexes , Memory , Chains and Agents . Let's first load up the environment settings. In [19]: import dotenv import os dotenv . load_dotenv () openai_api_key = os . getenv ( "OPENAI_API_KEY" ) Schema ¶ Schema is the most rudimentary way for users to interact with LLMs. There are mainly three types of Schema, which are Text , Documents and Chat Messages . The primary interface to interact with LLMs is Text . Some may refer to it as text in, text out . In [7]: text = "What is the weather like today in Paris?" LLMs can also understand and process unstructured data, referred to as Document in LangChain, which will ty...