diff --git a/langchain/package.json b/langchain/package.json index b52c54cbad3f..3b195e0ded24 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -418,6 +418,7 @@ "@langchain/core": "workspace:*", "@langchain/google-genai": "*", "@langchain/google-vertexai": "*", + "@langchain/google-vertexai-web": "*", "@langchain/groq": "*", "@langchain/mistralai": "*", "@langchain/ollama": "*", @@ -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": "*", @@ -494,6 +496,9 @@ "@langchain/google-vertexai": { "optional": true }, + "@langchain/google-vertexai-web": { + "optional": true + }, "@langchain/groq": { "optional": true }, diff --git a/langchain/src/chat_models/universal.ts b/langchain/src/chat_models/universal.ts index 13311c4cfea5..b6fd4af95d22 100644 --- a/langchain/src/chat_models/universal.ts +++ b/langchain/src/chat_models/universal.ts @@ -40,6 +40,8 @@ const _SUPPORTED_PROVIDERS = [ "azure_openai", "cohere", "google-vertexai", + "google-vertexai-web", + "google-genai", "google-genai", "ollama", "together", @@ -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" @@ -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) diff --git a/yarn.lock b/yarn.lock index 18a03eb87a03..2bb9ce4b777c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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: @@ -33433,6 +33433,7 @@ __metadata: "@langchain/core": "workspace:*" "@langchain/google-genai": "*" "@langchain/google-vertexai": "*" + "@langchain/google-vertexai-web": "*" "@langchain/groq": "*" "@langchain/mistralai": "*" "@langchain/ollama": "*" @@ -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": "*" @@ -33513,6 +33515,8 @@ __metadata: optional: true "@langchain/google-vertexai": optional: true + "@langchain/google-vertexai-web": + optional: true "@langchain/groq": optional: true "@langchain/mistralai":