diff --git a/generative-ai/langchain-rag.ipynb b/generative-ai/langchain-rag.ipynb index a56ae0fb9..e7dddfdf9 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, @@ -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." ] }, { @@ -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,