Skip to content

Commit

Permalink
feat: Add google-vertexai-web to initChatModel (#7473)
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul authored Jan 7, 2025
1 parent 81e50a8 commit 8bddcc2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
"@langchain/core": "workspace:*",
"@langchain/google-genai": "*",
"@langchain/google-vertexai": "*",
"@langchain/google-vertexai-web": "*",
"@langchain/groq": "*",
"@langchain/mistralai": "*",
"@langchain/ollama": "*",
Expand Down Expand Up @@ -466,6 +467,7 @@
"@langchain/core": ">=0.2.21 <0.4.0",
"@langchain/google-genai": "*",
"@langchain/google-vertexai": "*",
"@langchain/google-vertexai-web": "*",
"@langchain/groq": "*",
"@langchain/mistralai": "*",
"@langchain/ollama": "*",
Expand Down Expand Up @@ -494,6 +496,9 @@
"@langchain/google-vertexai": {
"optional": true
},
"@langchain/google-vertexai-web": {
"optional": true
},
"@langchain/groq": {
"optional": true
},
Expand Down
7 changes: 7 additions & 0 deletions langchain/src/chat_models/universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const _SUPPORTED_PROVIDERS = [
"azure_openai",
"cohere",
"google-vertexai",
"google-vertexai-web",
"google-genai",
"google-genai",
"ollama",
"together",
Expand Down Expand Up @@ -97,6 +99,10 @@ async function _initChatModelHelper(
const { ChatVertexAI } = await import("@langchain/google-vertexai");
return new ChatVertexAI({ model, ...passedParams });
}
case "google-vertexai-web": {
const { ChatVertexAI } = await import("@langchain/google-vertexai-web");
return new ChatVertexAI({ model, ...passedParams });
}
case "google-genai": {
const { ChatGoogleGenerativeAI } = await import(
"@langchain/google-genai"
Expand Down Expand Up @@ -594,6 +600,7 @@ export async function initChatModel<
* - anthropic (@langchain/anthropic)
* - azure_openai (@langchain/openai)
* - google-vertexai (@langchain/google-vertexai)
* - google-vertexai-web (@langchain/google-vertexai-web)
* - google-genai (@langchain/google-genai)
* - bedrock (@langchain/aws)
* - cohere (@langchain/cohere)
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12603,7 +12603,7 @@ __metadata:
languageName: unknown
linkType: soft

"@langchain/google-vertexai-web@workspace:*, @langchain/google-vertexai-web@workspace:libs/langchain-google-vertexai-web":
"@langchain/google-vertexai-web@*, @langchain/google-vertexai-web@workspace:*, @langchain/google-vertexai-web@workspace:libs/langchain-google-vertexai-web":
version: 0.0.0-use.local
resolution: "@langchain/google-vertexai-web@workspace:libs/langchain-google-vertexai-web"
dependencies:
Expand Down Expand Up @@ -33433,6 +33433,7 @@ __metadata:
"@langchain/core": "workspace:*"
"@langchain/google-genai": "*"
"@langchain/google-vertexai": "*"
"@langchain/google-vertexai-web": "*"
"@langchain/groq": "*"
"@langchain/mistralai": "*"
"@langchain/ollama": "*"
Expand Down Expand Up @@ -33492,6 +33493,7 @@ __metadata:
"@langchain/core": ">=0.2.21 <0.4.0"
"@langchain/google-genai": "*"
"@langchain/google-vertexai": "*"
"@langchain/google-vertexai-web": "*"
"@langchain/groq": "*"
"@langchain/mistralai": "*"
"@langchain/ollama": "*"
Expand All @@ -33513,6 +33515,8 @@ __metadata:
optional: true
"@langchain/google-vertexai":
optional: true
"@langchain/google-vertexai-web":
optional: true
"@langchain/groq":
optional: true
"@langchain/mistralai":
Expand Down

0 comments on commit 8bddcc2

Please sign in to comment.