Skip to content

The agent engineering platform.

docs:Fix Google GenAI Embedding params (#31188)

Rares Vernica4f41b54bcbeb
diff --git a/docs/src/theme/EmbeddingTabs.js b/docs/src/theme/EmbeddingTabs.js
index b599f6654e..96b874cbf1 100644
--- a/docs/src/theme/EmbeddingTabs.js
+++ b/docs/src/theme/EmbeddingTabs.js
@@ -9,8 +9,10 @@ export default function EmbeddingTabs(props) {
hideOpenai,
azureOpenaiParams,
hideAzureOpenai,
- googleParams,
- hideGoogle,
+ googleGenAIParams,
+ hideGoogleGenAI,
+ googleVertexAIParams,
+ hideGoogleVertexAI,
awsParams,
hideAws,
huggingFaceParams,
@@ -38,7 +40,8 @@ export default function EmbeddingTabs(props) {
const azureParamsOrDefault =
azureOpenaiParams ??
`\n azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],\n azure_deployment=os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"],\n openai_api_version=os.environ["AZURE_OPENAI_API_VERSION"],\n`;
- const googleParamsOrDefault = googleParams ?? `model="text-embedding-004"`;
+ const googleGenAIParamsOrDefault = googleGenAIParams ?? `model="models/embedding-001"`;
+ const googleVertexAIParamsOrDefault = googleVertexAIParams ?? `model="text-embedding-004"`;
const awsParamsOrDefault = awsParams ?? `model_id="amazon.titan-embed-text-v2:0"`;
const huggingFaceParamsOrDefault = huggingFaceParams ?? `model_name="sentence-transformers/all-mpnet-base-v2"`;
const ollamaParamsOrDefault = ollamaParams ?? `model="llama3"`;
@@ -73,13 +76,22 @@ export default function EmbeddingTabs(props) {
shouldHide: hideAzureOpenai,
},
{
- value: "Google",
- label: "Google",
- text: `from langchain_google_vertexai import VertexAIEmbeddings\n\n${embeddingVarName} = VertexAIEmbeddings(${googleParamsOrDefault})`,
+ value: "GoogleGenAI",
+ label: "Google Gemini",
+ text: `from langchain_google_genai import GoogleGenerativeAIEmbeddings\n\n${embeddingVarName} = GoogleGenerativeAIEmbeddings(${googleGenAIParamsOrDefault})`,
+ apiKeyName: "GOOGLE_API_KEY",
+ packageName: "langchain-google-genai",
+ default: false,
+ shouldHide: hideGoogleGenAI,
+ },
+ {
+ value: "GoogleVertexAI",
+ label: "Google Vertex",
+ text: `from langchain_google_vertexai import VertexAIEmbeddings\n\n${embeddingVarName} = VertexAIEmbeddings(${googleVertexAIParamsOrDefault})`,
apiKeyName: undefined,
packageName: "langchain-google-vertexai",
default: false,
- shouldHide: hideGoogle,
+ shouldHide: hideGoogleVertexAI,
},
{
value: "AWS",