docs: Added IBM to ChatModelTabs and EmbeddingTabs (#29774)

Thank you for contributing to LangChain!

Added IBM to ChatModelTabs and EmbeddingTabs

- [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/
This commit is contained in:
Mateusz Szewczyk 2025-02-13 17:43:42 +01:00 committed by GitHub
parent 76d32754ff
commit 61f1be2152
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 0 deletions

View File

@ -191,6 +191,19 @@ ${llmVarName} = AzureChatOpenAI(
apiKeyName: "TOGETHER_API_KEY",
packageName: "langchain[together]",
},
{
value: "ibm",
label: "IBM",
text: `from langchain_ibm import ChatWatsonx
${llmVarName} = ChatWatsonx(
model_id="ibm/granite-34b-code-instruct",
url="https://us-south.ml.cloud.ibm.com",
project_id="<WATSONX PROJECT_ID>"
)`,
apiKeyName: "WATSONX_APIKEY",
packageName: "langchain-ibm",
},
{
value: "databricks",
label: "Databricks",

View File

@ -27,6 +27,8 @@ export default function EmbeddingTabs(props) {
hideNvidia,
voyageaiParams,
hideVoyageai,
ibmParams,
hideIBM,
fakeEmbeddingParams,
hideFakeEmbedding,
customVarName,
@ -45,6 +47,8 @@ export default function EmbeddingTabs(props) {
const nomicsParamsOrDefault = nomicParams ?? `model="nomic-embed-text-v1.5"`;
const nvidiaParamsOrDefault = nvidiaParams ?? `model="NV-Embed-QA"`;
const voyageaiParamsOrDefault = voyageaiParams ?? `model="voyage-3"`;
const ibmParamsOrDefault = ibmParams ??
`\n model_id="ibm/slate-125m-english-rtrvr,\n url="https://us-south.ml.cloud.ibm.com",\n project_id="<WATSONX PROJECT_ID>",\n`;
const fakeEmbeddingParamsOrDefault = fakeEmbeddingParams ?? `size=4096`;
const embeddingVarName = customVarName ?? "embeddings";
@ -149,6 +153,15 @@ export default function EmbeddingTabs(props) {
default: false,
shouldHide: hideVoyageai,
},
{
value: "IBM",
label: "IBM",
text: `from langchain_ibm import WatsonxEmbeddings\n\n${embeddingVarName} = WatsonxEmbeddings(${ibmParamsOrDefault})`,
apiKeyName: "WATSONX_APIKEY",
packageName: "langchain-ibm",
default: false,
shouldHide: hideIBM,
},
{
value: "Fake",
label: "Fake",