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.2.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_vertex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d2533a35e15811e7d7e638a653d2bf3ab7efb349ed47a8efe0209c7493227c86
MD5 71b12ff6fb11f5c65863f254efb5fd91
BLAKE2b-256 f6a71cf33f39184ca0281f5d8de22d435a3bad25b41fcc033e9e261d58336c2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_vertex-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2bb052da97f9c73aa678811e4a42fae5b93d1f7c628658ff8cbbb9be9e01253
MD5 3c05c9acb80da094fabbdf6534104dea
BLAKE2b-256 5984c7f33bc3f1975159358e53f0d2bb871c52cf78229262b91853fc2328a42a

See more details on using hashes here.

Supported by

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