From 597be7d501271d8f9009d0206af1851ce208a1cd Mon Sep 17 00:00:00 2001 From: Mateusz Szewczyk <139469471+MateuszOssGit@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:12:13 +0200 Subject: [PATCH] docs: Update IBM docs about information to pass client into WatsonxLLM and WatsonxEmbeddings object. (#24602) Thank you for contributing to LangChain! - [x] **PR title**: Update IBM docs about information to pass client into WatsonxLLM and WatsonxEmbeddings object. - [x] **PR message**: - **Description:** Update IBM docs about information to pass client into WatsonxLLM and WatsonxEmbeddings object. - [x] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/ --- docs/docs/integrations/llms/ibm_watsonx.ipynb | 27 ++++++++++++++++++- .../text_embedding/ibm_watsonx.ipynb | 23 ++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/docs/docs/integrations/llms/ibm_watsonx.ipynb b/docs/docs/integrations/llms/ibm_watsonx.ipynb index f045696343c..640d5988999 100644 --- a/docs/docs/integrations/llms/ibm_watsonx.ipynb +++ b/docs/docs/integrations/llms/ibm_watsonx.ipynb @@ -194,12 +194,37 @@ ")" ] }, + { + "cell_type": "markdown", + "id": "e4a1e0f1", + "metadata": {}, + "source": [ + "For certain requirements, there is an option to pass the IBM's [`APIClient`](https://ibm.github.io/watsonx-ai-python-sdk/base.html#apiclient) object into the `WatsonxLLM` class." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b28afc1", + "metadata": {}, + "outputs": [], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "\n", + "api_client = APIClient(...)\n", + "\n", + "watsonx_llm = WatsonxLLM(\n", + " model_id=\"ibm/granite-13b-instruct-v2\",\n", + " watsonx_client=api_client,\n", + ")" + ] + }, { "cell_type": "markdown", "id": "7c4a632b", "metadata": {}, "source": [ - "You can also pass the IBM's [`ModelInference`](https://ibm.github.io/watsonx-ai-python-sdk/fm_model_inference.html) object into `WatsonxLLM` class." + "You can also pass the IBM's [`ModelInference`](https://ibm.github.io/watsonx-ai-python-sdk/fm_model_inference.html) object into the `WatsonxLLM` class." ] }, { diff --git a/docs/docs/integrations/text_embedding/ibm_watsonx.ipynb b/docs/docs/integrations/text_embedding/ibm_watsonx.ipynb index 944ba0f6a6b..9541c0d7f7e 100644 --- a/docs/docs/integrations/text_embedding/ibm_watsonx.ipynb +++ b/docs/docs/integrations/text_embedding/ibm_watsonx.ipynb @@ -156,6 +156,29 @@ ")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For certain requirements, there is an option to pass the IBM's [`APIClient`](https://ibm.github.io/watsonx-ai-python-sdk/base.html#apiclient) object into the `WatsonxEmbeddings` class." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "\n", + "api_client = APIClient(...)\n", + "\n", + "watsonx_llm = WatsonxEmbeddings(\n", + " model_id=\"ibm/slate-125m-english-rtrvr\",\n", + " watsonx_client=api_client,\n", + ")" + ] + }, { "cell_type": "markdown", "metadata": {},