From a50f070a8a47cf13d3f7b8686c9652247710ca02 Mon Sep 17 00:00:00 2001 From: Yogananda Muthaiah Date: Sun, 1 Dec 2024 09:39:16 +0100 Subject: [PATCH] Update chapter1.md --- chapter1.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/chapter1.md b/chapter1.md index 8b13789..57540eb 100644 --- a/chapter1.md +++ b/chapter1.md @@ -1 +1,19 @@ +## Chapter 1: What is LangChain? +LangChain is an open source library for simplifying AI application development. It provides a set of tools to efficiently perform various AI-related tasks, with a focus on Large Scale Language Models (LLMs). +``` +from langchain import LLMChain +from langchain.llms import OpenAI +from langchain.prompts import PromptTemplate + +# LangChain +llm = OpenAI(temperature=0.9) +prompt = PromptTemplate( + input_variables=["product"], + template="What is a good name for a company that makes {product}?", +) +chain = LLMChain(llm=llm, prompt=prompt) + + +print(chain.run("eco-friendly water bottles")) +```