docs: fix js quickstart (#1104)

Use the newly recommended `@langchain/google-genai` library to use
gemini API keys.
This commit is contained in:
Twisha Bansal
2025-08-07 16:05:20 +05:30
committed by GitHub
parent 5bf275846a
commit f6b15de8cd

View File

@@ -294,7 +294,7 @@ from Toolbox.
{{< tabpane persist=header >}}
{{< tab header="LangChain" lang="bash" >}}
npm install langchain @langchain/google-vertexai
npm install langchain @langchain/google-genai
{{< /tab >}}
{{< tab header="GenkitJS" lang="bash" >}}
npm install genkit @genkit-ai/vertexai
@@ -309,7 +309,7 @@ npm install llamaindex @llamaindex/google @llamaindex/workflow
{{< tabpane persist=header >}}
{{< tab header="LangChain" lang="js" >}}
import { ChatVertexAI } from "@langchain/google-vertexai";
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
import { ToolboxClient } from "@toolbox-sdk/core";
import { tool } from "@langchain/core/tools";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
@@ -336,7 +336,7 @@ const queries = [
];
async function runApplication() {
const model = new ChatVertexAI({
const model = new ChatGoogleGenerativeAI({
model: "gemini-2.0-flash",
});