Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Quickstart Guide.ipynb for recent version of langchain #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions getting_started/Quickstart Guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
}
],
"source": [
"pip install langchain"
"pip install langchain langchain-openai"
]
},
{
Expand Down Expand Up @@ -109,7 +109,7 @@
"metadata": {},
"outputs": [],
"source": [
"from langchain.llms import OpenAI"
"from langchain_openai import OpenAI"
]
},
{
Expand Down Expand Up @@ -144,7 +144,7 @@
],
"source": [
"text = \"What are 5 vacation destinations for someone who likes to eat pasta?\"\n",
"print(llm(text))"
"print(llm.invoke(text))"
]
},
{
Expand Down Expand Up @@ -217,7 +217,7 @@
}
],
"source": [
"print(llm(prompt.format(food=\"dessert\")))"
"print(llm.invoke(prompt.format(food=\"dessert\")))"
]
},
{
Expand All @@ -236,7 +236,7 @@
"outputs": [],
"source": [
"from langchain.prompts import PromptTemplate\n",
"from langchain.llms import OpenAI\n",
"from langchain_openai import OpenAI\n",
"from langchain.chains import LLMChain"
]
},
Expand All @@ -262,7 +262,7 @@
"metadata": {},
"outputs": [],
"source": [
"chain = LLMChain(llm=llm, prompt=prompt)"
"chain = prommp | llm # previously `LLMChain(llm=llm, prompt=prompt)`"
]
},
{
Expand All @@ -286,7 +286,7 @@
}
],
"source": [
"print(chain.run(\"fruit\"))"
"print(chain.invoke(\"fruit\"))"
]
},
{
Expand Down Expand Up @@ -316,7 +316,7 @@
"source": [
"from langchain.agents import load_tools\n",
"from langchain.agents import initialize_agent\n",
"from langchain.llms import OpenAI"
"from langchain_openai import OpenAI"
]
},
{
Expand Down