Skip to main content

llama-index embeddings vertex integration

Project description

LlamaIndex Embeddings Integration: Vertex

Implements Vertex AI Embeddings Models:

Model Release Date
textembedding-gecko@003 December 12, 2023
textembedding-gecko@002 November 2, 2023
textembedding-gecko-multilingual@001 November 2, 2023
textembedding-gecko@001 June 7, 2023
multimodalembedding

Note: Currently Vertex AI does not support async on multimodalembedding. Otherwise, VertexTextEmbedding supports async interface.


New Features

  • Flexible Credential Handling:

    • Credential Management: Supports both direct credentials and service account info for secure API access.
  • Model Name Handling in Embedding Requests:

    • The _get_embedding_request function now accepts the model_name parameter, allowing it to manage models that do not support the task_type parameter, like textembedding-gecko@001.

Example Usage

from google.oauth2 import service_account
from llama_index.embeddings.vertex import VertexTextEmbedding

credentials = service_account.Credentials.from_service_account_file(
    "path/to/your/service-account.json"
)

embedding = VertexTextEmbedding(
    model_name="textembedding-gecko@003",
    project="your-project-id",
    location="your-region",
    credentials=credentials,
)

Alternatively, you can directly pass the required service account parameters:

from llama_index.embeddings.vertex import VertexTextEmbedding

embedding = VertexTextEmbedding(
    model_name="textembedding-gecko@003",
    project="your-project-id",
    location="your-region",
    client_email="your-service-account-email",
    token_uri="your-token-uri",
    private_key_id="your-private-key-id",
    private_key="your-private-key",
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_embeddings_vertex-0.4.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_embeddings_vertex-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_embeddings_vertex-0.4.1.tar.gz
Algorithm Hash digest
SHA256 882b7bd35a6ff9900a291f125b749456ee18a55b7cfa9f49c1b66c85ffa02f8d
MD5 7fbbf8e836eb4576a5d9bdaef02b8a82
BLAKE2b-256 80cf2398e65cbf88adc46a38fad23e28105cfc1cf78edb2cd6b93cce7167bf0c

See more details on using hashes here.

File details

Details for the file llama_index_embeddings_vertex-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_embeddings_vertex-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37d6e43b292f611e3e4d6d87d5d01899072e27d2ebbbc42f8e616af8a15ec350
MD5 3be51fe7114017048f7234d808080cfa
BLAKE2b-256 52824b9ec3315b68084f9ec1a67c238e670623ce52e86086dd195ba21316aeba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page