mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-01 10:54:15 +00:00
docs:Fix Google GenAI Embedding params (#31188)
Extend Google parameters in the embeddings tab to include Google GenAI (Gemini) **Description:** Update embeddings tab to include example for Google GenAI (Gemini) **Issue:** N/A **Dependencies:** N/A **Twitter handle:** N/A - [ ] **Add tests and docs**: If you're adding a new integration, please include 1. a test for the integration, preferably unit tests that do not rely on network access, 2. an example notebook showing its use. It lives in `docs/docs/integrations` directory. - [ ] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/ Additional guidelines: - Make sure optional dependencies are imported within a function. - Please do not add dependencies to pyproject.toml files (even optional ones) unless they are required for unit tests. - Most PRs should not touch more than one package. - Changes should be backwards compatible. If no one reviews your PR within a few days, please @-mention one of baskaryan, eyurtsev, ccurme, vbarda, hwchase17. --------- Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
parent
ce0b1a9428
commit
4f41b54bcb
@ -9,8 +9,10 @@ export default function EmbeddingTabs(props) {
|
|||||||
hideOpenai,
|
hideOpenai,
|
||||||
azureOpenaiParams,
|
azureOpenaiParams,
|
||||||
hideAzureOpenai,
|
hideAzureOpenai,
|
||||||
googleParams,
|
googleGenAIParams,
|
||||||
hideGoogle,
|
hideGoogleGenAI,
|
||||||
|
googleVertexAIParams,
|
||||||
|
hideGoogleVertexAI,
|
||||||
awsParams,
|
awsParams,
|
||||||
hideAws,
|
hideAws,
|
||||||
huggingFaceParams,
|
huggingFaceParams,
|
||||||
@ -38,7 +40,8 @@ export default function EmbeddingTabs(props) {
|
|||||||
const azureParamsOrDefault =
|
const azureParamsOrDefault =
|
||||||
azureOpenaiParams ??
|
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`;
|
`\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 awsParamsOrDefault = awsParams ?? `model_id="amazon.titan-embed-text-v2:0"`;
|
||||||
const huggingFaceParamsOrDefault = huggingFaceParams ?? `model_name="sentence-transformers/all-mpnet-base-v2"`;
|
const huggingFaceParamsOrDefault = huggingFaceParams ?? `model_name="sentence-transformers/all-mpnet-base-v2"`;
|
||||||
const ollamaParamsOrDefault = ollamaParams ?? `model="llama3"`;
|
const ollamaParamsOrDefault = ollamaParams ?? `model="llama3"`;
|
||||||
@ -73,13 +76,22 @@ export default function EmbeddingTabs(props) {
|
|||||||
shouldHide: hideAzureOpenai,
|
shouldHide: hideAzureOpenai,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "Google",
|
value: "GoogleGenAI",
|
||||||
label: "Google",
|
label: "Google Gemini",
|
||||||
text: `from langchain_google_vertexai import VertexAIEmbeddings\n\n${embeddingVarName} = VertexAIEmbeddings(${googleParamsOrDefault})`,
|
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,
|
apiKeyName: undefined,
|
||||||
packageName: "langchain-google-vertexai",
|
packageName: "langchain-google-vertexai",
|
||||||
default: false,
|
default: false,
|
||||||
shouldHide: hideGoogle,
|
shouldHide: hideGoogleVertexAI,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "AWS",
|
value: "AWS",
|
||||||
|
Loading…
Reference in New Issue
Block a user