Skip to content

Commit

Permalink
fix: add missing installation of langchain-community package in som…
Browse files Browse the repository at this point in the history
…e steps, fix some imports (#4)
  • Loading branch information
tinesoft authored Jun 26, 2024
1 parent 47fa197 commit ad8c347
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
17 changes: 15 additions & 2 deletions steps/02-langchain-solution/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@
},
"outputs": [],
"source": [
"pip install langchain"
"pip install langchain # contains core tools for building llm applications, chaining LLMs, prompt management, output parsers, etc\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"pip install langchain-community # contains community-contributed extensions and utilities for LangChain, like Ollama, OpenAI LLMs, etc"
]
},
{
Expand All @@ -41,7 +54,7 @@
"outputs": [],
"source": [
"# Use ollama to connect local llm\n",
"from langchain_community.llms import Ollama"
"from langchain_community.llms.ollama import Ollama"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions steps/03-langchain-chain-solution/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"outputs": [],
"source": [
"pip install langchain"
"pip install langchain langchain-community"
]
},
{
Expand All @@ -40,7 +40,7 @@
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.llms import Ollama\n",
"from langchain_community.llms.ollama import Ollama\n",
"# pour le prompt de chat\n",
"from langchain_core.prompts import PromptTemplate\n",
"# pour le parser de sortie\n",
Expand Down Expand Up @@ -177,7 +177,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions steps/04-langchain-retrieval-solution/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"outputs": [],
"source": [
"pip install langchain faiss-cpu beautifulsoup4"
"pip install langchain langchain-community faiss-cpu beautifulsoup4"
]
},
{
Expand All @@ -46,9 +46,9 @@
"from langchain.text_splitter import RecursiveCharacterTextSplitter\n",
"from langchain.chains.combine_documents import create_stuff_documents_chain\n",
"from langchain_core.prompts import ChatPromptTemplate\n",
"from langchain_community.llms import Ollama\n",
"from langchain_community.llms.ollama import Ollama\n",
"from langchain_core.documents import Document\n",
"from langchain.chains import create_retrieval_chain"
"from langchain.chains.retrieval import create_retrieval_chain"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions steps/05-langchain-llms-solution/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"outputs": [],
"source": [
"pip install langchain"
"pip install langchain langchain-community"
]
},
{
Expand All @@ -40,7 +40,7 @@
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.llms import Ollama\n",
"from langchain_community.llms.ollama import Ollama\n",
"from langchain_core.prompts import PromptTemplate\n",
"from langchain_core.output_parsers import StrOutputParser\n",
"from langchain.callbacks.base import BaseCallbackHandler"
Expand Down
2 changes: 1 addition & 1 deletion steps/06-langchain-assistant-solution/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"outputs": [],
"source": [
"pip install langchain wikipedia faiss-cpu chromadb"
"pip install langchain langchain-community wikipedia faiss-cpu chromadb"
]
},
{
Expand Down

0 comments on commit ad8c347

Please sign in to comment.