Skip to content
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
26 changes: 13 additions & 13 deletions generative-ai/langchain-rag.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"from ibm_watsonx_ai.foundation_models.utils.enums import EmbeddingTypes\n",
"\n",
"from langchain_ibm import WatsonxEmbeddings, WatsonxLLM\n",
"from langchain.vectorstores import Chroma\n",
"from langchain_chroma import Chroma\n",
"\n",
"from langchain_core.prompts import ChatPromptTemplate\n",
"from langchain_core.output_parsers import StrOutputParser\n",
Expand Down Expand Up @@ -284,27 +284,27 @@
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's load our content into a local instance of a vector database, using Chroma."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"embeddings = WatsonxEmbeddings(\n",
" model_id=EmbeddingTypes.IBM_SLATE_30M_ENG.value,\n",
" model_id=\"ibm/slate-30m-english-rtrvr-v2\",\n",
" url=credentials[\"url\"],# type: ignore\n",
" apikey=credentials[\"apikey\"],# type: ignore\n",
" project_id=project_id,\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's load our content into a local instance of a vector database, using Chroma."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -340,7 +340,7 @@
"\n",
"Finally, we’ll generate a response. The generative model (like GPT-4 or IBM Granite) uses the retrieved information to produce a more accurate and contextually relevant response to our questions.\n",
"\n",
"First, we'll establish which LLM we're going to use to generate the response. For this tutorial, we'll use IBM's Granite-3.0-8B-Instruct model."
"First, we'll establish which LLM we're going to use to generate the response. For this tutorial, we'll use IBM's Granite-3-3-8B-Instruct model."
]
},
{
Expand All @@ -349,7 +349,7 @@
"metadata": {},
"outputs": [],
"source": [
"model_id = \"ibm/granite-3-8b-instruct\""
"model_id = \"ibm/granite-3-3-8b-instruct\""
]
},
{
Expand Down Expand Up @@ -538,7 +538,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "base",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -552,7 +552,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down