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 themodel_name
parameter, allowing it to manage models that do not support thetask_type
parameter, liketextembedding-gecko@001
.
- The
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
Built Distribution
File details
Details for the file llama_index_embeddings_vertex-0.1.1.tar.gz
.
File metadata
- Download URL: llama_index_embeddings_vertex-0.1.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 508453e646f538dd063b6fbf39f04b92e68416b1f58939e7372bb32f5d5a314e |
|
MD5 | d85b9cbfb462e89c0ff07bccd5383e36 |
|
BLAKE2b-256 | 3433dff2ebdf26c679bbbe5cc4adc25b92c32ff89c4cc7b1433e8183ba12a84c |
File details
Details for the file llama_index_embeddings_vertex-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: llama_index_embeddings_vertex-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0fd73cb4a8f52e14b8011ff1b0c3836cc680deed1eb19186aa936cfec4a6f41 |
|
MD5 | 7d5f8d9d668d0ce2185b8668cc52ab33 |
|
BLAKE2b-256 | 21708b2d2afd1d45b347b7b593cf0c51c5ca9c9a048631dee35f9ac49daa3aee |