Skip to content
4 changes: 2 additions & 2 deletions reference/python/docs/integrations/langchain_ibm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ title: IBM

[:octicons-arrow-right-24: Reference](./ChatWatsonx.md)

- :material-message-text:{ .lg .middle } __`WatsonxLLM`__
- :fontawesome-solid-i-cursor:{ .lg .middle } __`WatsonxLLM`__

---

Expand All @@ -39,7 +39,7 @@ title: IBM

[:octicons-arrow-right-24: Reference](./WatsonxEmbeddings.md)

- :fontawesome-solid-layer-group:{ .lg .middle } __`WatsonxRerank`__
- :fontawesome-solid-download:{ .lg .middle } __`WatsonxRerank`__

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,31 @@ title: OpenAI

[:octicons-arrow-right-24: Reference](./AzureChatOpenAI.md)

- :material-message-text:{ .lg .middle } __`OpenAI`__
- :fontawesome-solid-i-cursor:{ .lg .middle } __`OpenAI`__

---

(Legacy) OpenAI text completion models.

[:octicons-arrow-right-24: Reference](./OpenAI.md)

- :material-message-text:{ .lg .middle } __`AzureOpenAI`__
- :fontawesome-solid-i-cursor:{ .lg .middle } __`AzureOpenAI`__

---

Wrapper for (legacy) OpenAI text completion models hosted on Azure.

[:octicons-arrow-right-24: Reference](./AzureChatOpenAI.md)

- :material-message-text:{ .lg .middle } __`OpenAIEmbeddings`__
- :fontawesome-solid-layer-group:{ .lg .middle } __`OpenAIEmbeddings`__

---

OpenAI embedding models.

[:octicons-arrow-right-24: Reference](./OpenAIEmbeddings.md)

- :material-message-text:{ .lg .middle } __`OpenAIEmbeddings`__
- :fontawesome-solid-layer-group:{ .lg .middle } __`AzureOpenAIEmbeddings`__

---

Expand Down
4 changes: 2 additions & 2 deletions src/oss/python/integrations/chat/ibm_watsonx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The aim of these examples is to show how to communicate with `watsonx.ai` models

| Class | Package | Local | Serializable | [JS support](https://js.langchain.com/docs/integrations/chat/ibm/) | Downloads | Version |
| :--- | :--- | :---: | :---: | :---: | :---: | :---: |
| [ChatWatsonx](https://python.langchain.com/api_reference/ibm/chat_models/langchain_ibm.chat_models.ChatWatsonx.html) | [langchain-ibm](https://python.langchain.com/api_reference/ibm/index.html) | ❌ | ❌ | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |
| [`ChatWatsonx`](https://reference.langchain.com/python/integrations/langchain_ibm/ChatWatsonx/) | [`langchain-ibm`](https://reference.langchain.com/python/integrations/langchain_ibm/) | ❌ | ❌ | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |

### Model features

Expand Down Expand Up @@ -307,4 +307,4 @@ ai_msg.tool_calls

## API reference

For detailed documentation of all `ChatWatsonx` features and configurations head to the [API reference](https://python.langchain.com/api_reference/ibm/chat_models/langchain_ibm.chat_models.ChatWatsonx.html).
For detailed documentation of all `ChatWatsonx` features and configurations head to the [API reference](https://reference.langchain.com/python/integrations/langchain_ibm/ChatWatsonx/).
1 change: 1 addition & 0 deletions src/oss/python/integrations/chat/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mode: wide
| [`ChatBedrock`](/oss/integrations/chat/bedrock) | ✅ | ✅ | ❌ | ❌ | ❌ | [`langchain-aws`](https://reference.langchain.com/python/integrations/langchain_aws/) |
| [`ChatHuggingFace`](/oss/integrations/chat/huggingface) | ✅ | ✅ | ❌ | ✅ | ❌ | [`langchain-huggingface`](https://reference.langchain.com/python/integrations/langchain_huggingface/) |
| [`ChatOllama`](/oss/integrations/chat/ollama) | ✅ | ✅ | ✅ | ✅ | ❌ | [`langchain-ollama`](https://reference.langchain.com/python/integrations/langchain_ollama/) |
| [`ChatWatsonx`](/oss/integrations/chat/ibm_watsonx) | ✅ | ✅ | ✅ | ❌ | ✅ | [`langchain-ibm`](https://reference.langchain.com/python/integrations/langchain_ibm/) |
| [`ChatXAI`](/oss/integrations/chat/xai) | ✅ | ✅ | ❌ | ❌ | ❌ | [`langchain-xai`](https://reference.langchain.com/python/integrations/langchain_xai/) |
| [`ChatNVIDIA`](/oss/integrations/chat/nvidia_ai_endpoints) | ✅ | ✅ | ✅ | ✅ | ✅ | [`langchain-nvidia-ai-endpoints`](https://reference.langchain.com/python/integrations/langchain_nvidia_ai_endpoints/) |
| [`ChatCohere`](/oss/integrations/chat/cohere) | ✅ | ✅ | ❌ | ❌ | ❌ | [`langchain-cohere`](https://reference.langchain.com/python/integrations/langchain_cohere/) |
Expand Down
6 changes: 3 additions & 3 deletions src/oss/python/integrations/llms/ibm_watsonx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: IBM watsonx.ai
---

>[WatsonxLLM](https://ibm.github.io/watsonx-ai-python-sdk/fm_extensions.html#langchain) is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) foundation models.
>[`WatsonxLLM`](https://ibm.github.io/watsonx-ai-python-sdk/fm_extensions.html#langchain) is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) foundation models.

This example shows how to communicate with `watsonx.ai` models using `LangChain`.

Expand All @@ -12,7 +12,7 @@ This example shows how to communicate with `watsonx.ai` models using `LangChain`

| Class | Package | Local | Serializable | [JS support](https://js.langchain.com/docs/integrations/llms/ibm/) | Downloads | Version |
| :--- | :--- | :---: | :---: | :---: | :---: | :---: |
| [WatsonxLLM](https://python.langchain.com/api_reference/ibm/llms/langchain_ibm.llms.WatsonxLLM.html) | [langchain-ibm](https://python.langchain.com/api_reference/ibm/index.html) | ❌ | ❌ | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |
| [`WatsonxLLM`](https://reference.langchain.com/python/integrations/langchain_ibm/WatsonxLLM/) | [`langchain-ibm`](https://reference.langchain.com/python/integrations/langchain_ibm/) | ❌ | ❌ | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |

## Setup

Expand Down Expand Up @@ -211,4 +211,4 @@ llm_chain.invoke(topic)

## API reference

For detailed documentation of all `WatsonxLLM` features and configurations head to the [API reference](https://python.langchain.com/api_reference/ibm/llms/langchain_ibm.llms.WatsonxLLM.html).
For detailed documentation of all `WatsonxLLM` features and configurations head to the [API reference](https://reference.langchain.com/python/integrations/langchain_ibm/WatsonxLLM/).
124 changes: 37 additions & 87 deletions src/oss/python/integrations/providers/ibm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LangChain integrations related to IBM technologies, including the
[IBM watsonx.ai](https://www.ibm.com/products/watsonx-ai) platform and DB2 database.

## Watsonx AI

IBM® watsonx.ai™ AI studio is part of the IBM [watsonx](https://www.ibm.com/watsonx)™ AI and data platform, bringing together new generative
AI capabilities powered by [foundation models](https://www.ibm.com/products/watsonx-ai/foundation-models) and traditional machine learning (ML)
into a powerful studio spanning the AI lifecycle. Tune and guide models with your enterprise data to meet your needs with easy-to-use tools for
Expand All @@ -17,103 +18,52 @@ Watsonx.ai offers:
- **End-to-end AI governance:** Enterprises can scale and accelerate the impact of AI with trusted data across the business, using data wherever it resides.
- **Hybrid, multi-cloud deployments:** IBM provides the flexibility to integrate and deploy your AI workloads into your hybrid-cloud stack of choice.

### Model interfaces

### Installation and Setup

Install the integration package with:

<CodeGroup>
```bash pip
pip install -qU langchain-ibm
```

```bash uv
uv add langchain-ibm
```
</CodeGroup>

Get an IBM watsonx.ai api key and set it as an environment variable (`WATSONX_APIKEY`)
```python
import os

os.environ["WATSONX_APIKEY"] = "your IBM watsonx.ai api key"
```

### Chat Model

#### ChatWatsonx

See a [usage example](/oss/integrations/chat/ibm_watsonx).

```python
from langchain_ibm import ChatWatsonx
```

### LLMs

#### WatsonxLLM

See a [usage example](/oss/integrations/llms/ibm_watsonx).

```python
from langchain_ibm import WatsonxLLM
```
<Columns cols={2}>
<Card title="ChatWatsonx" href="/oss/integrations/chat/ibm_watsonx" cta="Get started" icon="message" arrow>
IBM watsonx.ai chat models.
</Card>
<Card title="WatsonxLLM" href="/oss/integrations/llms/ibm_watsonx" cta="Get started" icon="i-cursor" arrow>
(Legacy) IBM watsonx.ai text completion models.
</Card>
<Card title="WatsonxEmbeddings" href="/oss/integrations/text_embedding/ibm_watsonx" cta="Get started" icon="layer-group" arrow>
IBM watsonx.ai embedding models.
</Card>
</Columns>

### Embedding Models
### Tools and toolkits

#### WatsonxEmbeddings
<Columns cols={2}>
<Card title="WatsonxToolkit" href="/oss/integrations/tools/ibm_watsonx" cta="Get started" icon="screwdriver-wrench" arrow>
IBM watsonx.ai toolkit.
</Card>
</Columns>

See a [usage example](/oss/integrations/text_embedding/ibm_watsonx).
### Retrievers

```python
from langchain_ibm import WatsonxEmbeddings
```
<Columns cols={2}>
<Card title="WatsonxRerank" href="/oss/integrations/retrievers/ibm_watsonx_ranker" cta="Get started" icon="download" arrow>
IBM watsonx.ai document retriever.
</Card>
</Columns>

### Reranker

#### WatsonxRerank

See a [usage example](/oss/integrations/retrievers/ibm_watsonx_ranker).

```python
from langchain_ibm import WatsonxRerank
```

### Toolkit
## DB2

#### WatsonxToolkit
The IBM DB2 relational database v12.1.2 and above offers the abilities of vector store
and vector search. Installation of `langchain-db2` package will give LangChain users
the support of DB2 vector store and vector search.

See a [usage example](/oss/integrations/tools/ibm_watsonx).

```python
from langchain_ibm.agent_toolkits.utility import WatsonxToolkit
```
<Note>
`langchain-db2` is a separate package for Vector Store feature only, and can be run without the `langchain-ibm` package.
</Note>

## DB2

### Vector stores

#### IBM DB2 Vector Store and Vector Search

The IBM DB2 relational database v12.1.2 and above offers the abilities of vector store
and vector search. Installation of `langchain-db2` package will give LangChain users
the support of DB2 vector store and vector search.

See detailed usage examples in the guide [here](/oss/integrations/vectorstores/db2).

Installation: This is a separate package for vector store feature only and can be run
without the `langchain-ibm` package.
<CodeGroup>
```bash pip
pip install -U langchain-db2
```

```bash uv
uv add langchain-db2
```
</CodeGroup>
Usage:
```python
from langchain_db2 import db2vs
from langchain_db2.db2vs import DB2VS
```
<Columns cols={2}>
<Card title="DB2VS" href="/oss/integrations/vectorstores/db2" cta="Get started" icon="database" arrow>
IBM DB2 Vector Store and Vector Search
</Card>
</Columns>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: IBM watsonx.ai
---

>WatsonxRerank is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) foundation models.
>`WatsonxRerank` is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) foundation models.

This notebook shows how to use [watsonx's rerank endpoint](https://cloud.ibm.com/apidocs/watsonx-ai#text-rerank) in a retriever.

Expand All @@ -12,7 +12,7 @@ This notebook shows how to use [watsonx's rerank endpoint](https://cloud.ibm.com

| Class | Package | [JS support](https://js.langchain.com/docs/integrations/document_compressors/ibm/) | Downloads | Version |
| :--- | :--- | :---: | :---: | :---: |
| [WatsonxRerank](https://python.langchain.com/api_reference/ibm/rerank/langchain_ibm.rerank.WatsonxRerank.html) | [langchain-ibm](https://python.langchain.com/api_reference/ibm/index.html) | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |
| [`WatsonxRerank`](https://reference.langchain.com/python/integrations/langchain_ibm/WatsonxRerank/) | [`langchain-ibm`](https://reference.langchain.com/python/integrations/langchain_ibm/) | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |

## Setup

Expand Down Expand Up @@ -267,4 +267,4 @@ chain.invoke(query)

## API reference

For detailed documentation of all `WatsonxRerank` features and configurations head to the [API reference](https://python.langchain.com/api_reference/ibm/chat_models/langchain_ibm.rerank.WatsonxRerank.html).
For detailed documentation of all `WatsonxRerank` features and configurations head to the [API reference](https://reference.langchain.com/python/integrations/langchain_ibm/WatsonxRerank/).
4 changes: 2 additions & 2 deletions src/oss/python/integrations/text_embedding/ibm_watsonx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: IBM watsonx.ai
---

>WatsonxEmbeddings is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) foundation models.
>`WatsonxEmbeddings` is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) foundation models.

This example shows how to communicate with `watsonx.ai` models using `LangChain`.

Expand Down Expand Up @@ -183,4 +183,4 @@ doc_result[0][:5]

## API reference

For detailed documentation of all `WatsonxEmbeddings` features and configurations head to the [API reference](https://python.langchain.com/api_reference/ibm/embeddings/langchain_ibm.embeddings.WatsonxEmbeddings.html).
For detailed documentation of all `WatsonxEmbeddings` features and configurations head to the [API reference](https://reference.langchain.com/python/integrations/langchain_ibm/WatsonxEmbeddings/).
6 changes: 3 additions & 3 deletions src/oss/python/integrations/tools/ibm_watsonx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: IBM watsonx.ai
---

>WatsonxToolkit is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) Toolkit.
>`WatsonxToolkit` is a wrapper for IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai) Toolkit.

This example shows how to use `watsonx.ai` Toolkit using `LangChain`.

Expand All @@ -12,7 +12,7 @@ This example shows how to use `watsonx.ai` Toolkit using `LangChain`.

| Class | Package | Serializable | [JS support](https://js.langchain.com/docs/integrations/toolkits/ibm/) | Downloads | Version |
| :--- | :--- | :---: | :---: | :---: | :---: |
| [WatsonxToolkit](https://python.langchain.com/api_reference/ibm/agent_toolkits/langchain_ibm.agent_toolkits.utility.toolkit.WatsonxToolkit.html) | [langchain-ibm](https://python.langchain.com/api_reference/ibm/index.html) | ❌ | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |
| [`WatsonxToolkit`](https://reference.langchain.com/python/integrations/langchain_ibm/WatsonxToolkit/) | [`langchain-ibm`](https://reference.langchain.com/python/integrations/langchain_ibm/) | ❌ | ✅ | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20) |

## Setup

Expand Down Expand Up @@ -302,4 +302,4 @@ The current weather in Boston is -1°C with 0mm of rain, a relative humidity of

## API reference

For detailed documentation of all `WatsonxToolkit` features and configurations head to the [API reference](https://python.langchain.com/api_reference/ibm/toolkit/langchain_ibm.toolkit.WatsonxToolkit.html).
For detailed documentation of all `WatsonxToolkit` features and configurations head to the [API reference](https://reference.langchain.com/python/integrations/langchain_ibm/WatsonxToolkit/).