Skip to content

Commit 1c270f4

Browse files
authored
docs[patch],examples[patch]: Add tooltip with note about unified model params (#5042)
* docs[patch],examples[patch]: Add tooltip with note about unified model params * chore: lint files * revert moving back to model name changes * more * chore: lint files
1 parent 0623819 commit 1c270f4

29 files changed

+595
-493
lines changed

docs/core_docs/docs/expression_language/get_started.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2727
npm install @langchain/openai @langchain/community
2828
```
2929

30+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
31+
32+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
33+
3034
<CodeBlock language="typescript">{BasicExample}</CodeBlock>
3135

3236
:::tip

docs/core_docs/docs/get_started/quickstart.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ We will cover these at a high level, but keep in mind there is a lot more to eac
5454

5555
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
5656

57+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
58+
59+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
60+
5761
<Tabs groupId="preferredModel">
5862
<TabItem value="openai" label="OpenAI" default>
5963

docs/core_docs/docs/integrations/chat/anthropic.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Set it as an environment variable named `ANTHROPIC_API_KEY`, or pass it into the
2121

2222
## Usage
2323

24+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
25+
26+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
27+
2428
You can initialize an instance like this:
2529

2630
import CodeBlock from "@theme/CodeBlock";

docs/core_docs/docs/integrations/chat/anthropic_tools.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ npm install @langchain/anthropic
2727

2828
You can initialize this wrapper the same way you'd initialize a standard `ChatAnthropic` instance:
2929

30+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
31+
32+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
33+
3034
```typescript
3135
import { ChatAnthropicTools } from "@langchain/anthropic/experimental";
3236

docs/core_docs/docs/integrations/chat/azure.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2929
npm install @langchain/openai
3030
```
3131

32+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
33+
34+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
35+
3236
<CodeBlock language="typescript">{AzureOpenAI}</CodeBlock>
3337

3438
If your instance is hosted under a domain other than the default `openai.azure.com`, you'll need to use the alternate `AZURE_OPENAI_BASE_PATH` environment variable.

docs/core_docs/docs/integrations/chat/bedrock.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ npm install @aws-crypto/sha256-js @smithy/protocol-http @smithy/signature-v4 @sm
3434

3535
## Usage
3636

37+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
38+
39+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
40+
3741
Currently, only Anthropic, Cohere, and Mistral models are supported with the chat model integration. For foundation models from AI21 or Amazon, see [the text generation Bedrock variant](/docs/integrations/llms/bedrock).
3842

3943
import CodeBlock from "@theme/CodeBlock";

docs/core_docs/docs/integrations/chat/cloudflare_workersai.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ npm install @langchain/cloudflare
2525
import CodeBlock from "@theme/CodeBlock";
2626
import Example from "@examples/models/chat/integration_cloudflare_workersai.ts";
2727

28+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
29+
30+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
31+
2832
<CodeBlock language="typescript">{Example}</CodeBlock>

docs/core_docs/docs/integrations/chat/fireworks.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
1616
npm install @langchain/community
1717
```
1818

19+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
20+
21+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
22+
1923
import Fireworks from "@examples/models/chat/integration_fireworks.ts";
2024

2125
<CodeBlock language="typescript">{Fireworks}</CodeBlock>

docs/core_docs/docs/integrations/chat/google_generativeai.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ npm install @langchain/google-genai
3131

3232
## Usage
3333

34+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
35+
36+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
37+
3438
import GoogleGenerativeAI from "@examples/models/chat/googlegenerativeai.ts";
3539

3640
<CodeBlock language="typescript">{GoogleGenerativeAI}</CodeBlock>

docs/core_docs/docs/integrations/chat/google_palm.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2222
npm install google-auth-library @google-ai/generativelanguage @langchain/community
2323
```
2424

25+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
26+
27+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
28+
2529
Create an **API key** from [Google MakerSuite](https://makersuite.google.com/app/apikey). You can then set
2630
the key as `GOOGLE_PALM_API_KEY` environment variable or pass it as `apiKey` parameter while instantiating
2731
the model.

docs/core_docs/docs/integrations/chat/google_vertex_ai.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2525
npm install @langchain/google-vertexai
2626
```
2727

28+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
29+
30+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
31+
2832
You should make sure the Vertex AI API is
2933
enabled for the relevant project and that you've authenticated to
3034
Google Cloud using one of these methods:

docs/core_docs/docs/integrations/chat/groq.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2020
npm install @langchain/groq
2121
```
2222

23+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
24+
25+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
26+
2327
## Usage
2428

2529
import ChatGroqExample from "@examples/models/chat/chat_groq.ts";

docs/core_docs/docs/integrations/chat/minimax.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2222
npm install @langchain/community
2323
```
2424

25+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
26+
27+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
28+
2529
## Basic usage
2630

2731
import Minimax from "@examples/models/chat/integration_minimax.ts";

docs/core_docs/docs/integrations/chat/mistral.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
3737
npm install @langchain/mistralai
3838
```
3939

40+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
41+
42+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
43+
4044
## Usage
4145

4246
When sending chat messages to mistral, there are a few requirements to follow:

docs/core_docs/docs/integrations/chat/openai.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
1818
npm install @langchain/openai
1919
```
2020

21+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
22+
23+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
24+
2125
<CodeBlock language="typescript">{OpenAI}</CodeBlock>
2226

2327
If you're part of an organization, you can set `process.env.OPENAI_ORGANIZATION` with your OpenAI organization id, or pass it in as `organization` when

docs/core_docs/docs/integrations/chat/togetherai.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2525
npm install @langchain/community
2626
```
2727

28+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
29+
30+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
31+
2832
import TogetherAI from "@examples/models/chat/integration_togetherai.ts";
2933

3034
<CodeBlock language="typescript">{TogetherAI}</CodeBlock>

docs/core_docs/docs/integrations/llms/azure.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ You'll first need to install the [`@langchain/azure-openai`](https://www.npmjs.c
1616
npm install -S @langchain/azure-openai
1717
```
1818

19+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
20+
21+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
22+
1923
You'll also need to have an Azure OpenAI instance deployed. You can deploy a version on Azure Portal following [this guide](https://learn.microsoft.com/azure/ai-services/openai/how-to/create-resource?pivots=web-portal).
2024

2125
Once you have your instance running, make sure you have the endpoint and key. You can find them in the Azure Portal, under the "Keys and Endpoint" section of your instance.

docs/core_docs/docs/integrations/llms/huggingface_inference.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Here's an example of calling a HugggingFaceInference model as an LLM:
66
npm install @huggingface/inference@2
77
```
88

9+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
10+
11+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
12+
913
```typescript
1014
import { HuggingFaceInference } from "langchain/llms/hf";
1115

docs/core_docs/docs/integrations/llms/openai.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
1010
npm install @langchain/openai
1111
```
1212

13+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
14+
15+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
16+
1317
```typescript
1418
import { OpenAI } from "@langchain/openai";
1519

docs/core_docs/docs/integrations/text_embedding/azure_openai.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2222
npm install -S @langchain/azure-openai
2323
```
2424

25+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
26+
27+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
28+
2529
You'll also need to have an Azure OpenAI instance deployed. You can deploy a version on Azure Portal following [this guide](https://learn.microsoft.com/azure/ai-services/openai/how-to/create-resource?pivots=web-portal).
2630

2731
Once you have your instance running, make sure you have the endpoint and key. You can find them in the Azure Portal, under the "Keys and Endpoint" section of your instance.

docs/core_docs/docs/integrations/text_embedding/bedrock.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2424
npm install @langchain/community
2525
```
2626

27+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
28+
29+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
30+
2731
## Usage
2832

2933
The `BedrockEmbeddings` class uses the AWS Bedrock API to generate embeddings for a given text. It strips new line characters from the text as recommended.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:::tip
2+
We're unifying model params across all packages. We now suggest using `model` instead of `modelName`, and `apiKey` for API keys.
3+
:::

docs/core_docs/docs/modules/model_io/chat/caching.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ LangChain provides an optional caching layer for chat models. This is useful for
99
It can save you money by reducing the number of API calls you make to the LLM provider, if you're often requesting the same completion multiple times.
1010
It can speed up your application by reducing the number of API calls you make to the LLM provider.
1111

12+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
13+
14+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
15+
1216
import CodeBlock from "@theme/CodeBlock";
1317

1418
```typescript

docs/core_docs/docs/modules/model_io/chat/custom_chat.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can also implement the following optional method:
1515

1616
- A `_streamResponseChunks` method that returns an `AsyncGenerator` and yields [`ChatGenerationChunks`](https://api.js.langchain.com/classes/langchain_core_outputs.ChatGenerationChunk.html). This allows the LLM to support streaming outputs.
1717

18-
Lets implement a very simple custom chat model that just echoes back the first `n` characters of the input.
18+
Let's implement a very simple custom chat model that just echoes back the first `n` characters of the input.
1919

2020
```typescript
2121
import {

docs/core_docs/docs/modules/model_io/chat/quick_start.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import Tabs from "@theme/Tabs";
1414
import TabItem from "@theme/TabItem";
1515
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
1616

17+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
18+
19+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
20+
1721
<Tabs groupId="preferredModel">
1822
<TabItem value="openai" label="OpenAI" default>
1923

docs/core_docs/docs/modules/model_io/chat/streaming.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import IntegrationInstallTooltip from "@mdx_components/integration_install_toolt
2222
npm install @langchain/openai
2323
```
2424

25+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
26+
27+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
28+
2529
<CodeBlock language="typescript">{StreamMethodExample}</CodeBlock>
2630

2731
For models that do not support streaming, the entire response will be returned as a single chunk.

docs/core_docs/docs/modules/model_io/quick_start.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import TabItem from "@theme/TabItem";
1616
import CodeBlock from "@theme/CodeBlock";
1717
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
1818

19+
import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx";
20+
21+
<UnifiedModelParamsTooltip></UnifiedModelParamsTooltip>
22+
1923
<Tabs groupId="preferredModel">
2024
<TabItem value="openai" label="OpenAI" default>
2125

0 commit comments

Comments
 (0)