From 1d6c194a14992db38ed006b1462b353f2d2c32b4 Mon Sep 17 00:00:00 2001 From: Jack Woehr Date: Sat, 29 Nov 2025 22:30:42 -0700 Subject: [PATCH 1/2] changes required to make the example work Signed-off-by: Jack Woehr --- generative-ai/langchain-rag.ipynb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/generative-ai/langchain-rag.ipynb b/generative-ai/langchain-rag.ipynb index a56ae0fb9..23226c367 100644 --- a/generative-ai/langchain-rag.ipynb +++ b/generative-ai/langchain-rag.ipynb @@ -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", @@ -284,6 +284,13 @@ "\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, @@ -291,20 +298,13 @@ "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, @@ -349,7 +349,7 @@ "metadata": {}, "outputs": [], "source": [ - "model_id = \"ibm/granite-3-8b-instruct\"" + "model_id = \"ibm/granite-3-3-8b-instruct\"" ] }, { @@ -538,7 +538,7 @@ ], "metadata": { "kernelspec": { - "display_name": "base", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -552,7 +552,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.12.3" } }, "nbformat": 4, From b3e76e602b5e869a19a10dd99e302bc622e3ba93 Mon Sep 17 00:00:00 2001 From: Jack Woehr Date: Sun, 30 Nov 2025 07:40:20 -0700 Subject: [PATCH 2/2] correct text to refer to the model actually used Signed-off-by: Jack Woehr --- generative-ai/langchain-rag.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generative-ai/langchain-rag.ipynb b/generative-ai/langchain-rag.ipynb index 23226c367..e7dddfdf9 100644 --- a/generative-ai/langchain-rag.ipynb +++ b/generative-ai/langchain-rag.ipynb @@ -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." ] }, {