VertexAIEmbeddings¶
Reference docs
This page contains reference documentation for VertexAIEmbeddings. See the docs for conceptual guides, tutorials, and examples on using VertexAIEmbeddings.
VertexAIEmbeddings
deprecated
¶
Bases: BaseModel, Embeddings
Deprecated
Use GoogleGenerativeAIEmbeddings instead.
Google Cloud VertexAI embedding models.
| METHOD | DESCRIPTION |
|---|---|
aembed_documents |
Asynchronous Embed search docs. |
aembed_query |
Asynchronous Embed query text. |
validate_environment |
Validates that the python package exists in environment. |
embed |
Embed a list of strings. |
embed_documents |
Embed a list of documents. |
embed_query |
Embed a text. |
project
class-attribute
instance-attribute
¶
project: str | None = None
The default GCP project to use when making Vertex API calls.
location
class-attribute
instance-attribute
¶
The default location to use when making API calls.
model_name
class-attribute
instance-attribute
¶
Underlying model name.
credentials
class-attribute
instance-attribute
¶
The default custom credentials to use when making API calls.
(google.auth.credentials.Credentials)
If not provided, credentials will be ascertained from the environment.
max_retries
class-attribute
instance-attribute
¶
max_retries: int = 6
The maximum number of retries to make when generating.
dimensions
class-attribute
instance-attribute
¶
dimensions: int | None = None
Default output dimensionality for embeddings. If not specified, uses the model's default. Can be overridden per request in embed() method.
aembed_documents
async
¶
aembed_query
async
¶
validate_environment
¶
validate_environment() -> Self
Validates that the python package exists in environment.
embed
¶
embed(
texts: list[str],
embeddings_task_type: EmbeddingTaskTypes | None = None,
dimensions: int | None = None,
title: str | None = None,
) -> list[list[float]]
Embed a list of strings.
| PARAMETER | DESCRIPTION |
|---|---|
texts
|
The list of strings to embed. |
embeddings_task_type
|
Optional embeddings task type, one of the following:
The following are only supported on preview models:
TYPE:
|
dimensions
|
Output embeddings dimensions. Only supported on preview models. If not provided, uses the default dimensions specified in the constructor.
TYPE:
|
title
|
Title for the text. Only applicable when
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[list[float]]
|
List of embeddings, one for each text. |