haive.core.engine.embedding.providers.GoogleVertexAIEmbeddingConfigΒΆ

Google Vertex AI embedding configuration.

ClassesΒΆ

GoogleVertexAIEmbeddingConfig

Configuration for Google Vertex AI embeddings.

Module ContentsΒΆ

class haive.core.engine.embedding.providers.GoogleVertexAIEmbeddingConfig.GoogleVertexAIEmbeddingConfig[source]ΒΆ

Bases: haive.core.engine.embedding.base.BaseEmbeddingConfig

Configuration for Google Vertex AI embeddings.

This configuration provides access to Google’s Vertex AI embedding models including text-embedding-004, text-multilingual-embedding-002, and others.

Examples

Basic usage:

config = GoogleVertexAIEmbeddingConfig(
    name="vertex_embeddings",
    model="text-embedding-004",
    project="your-project-id",
    location="us-central1"
)

embeddings = config.instantiate()

With custom task type:

config = GoogleVertexAIEmbeddingConfig(
    name="vertex_embeddings",
    model="text-embedding-004",
    project="your-project-id",
    location="us-central1",
    task_type="SEMANTIC_SIMILARITY"
)

Using service account:

config = GoogleVertexAIEmbeddingConfig(
    name="vertex_embeddings",
    model="text-embedding-004",
    project="your-project-id",
    location="us-central1",
    credentials_path="/path/to/service-account.json"
)
embedding_typeΒΆ

Always EmbeddingType.GOOGLE_VERTEX_AI

modelΒΆ

Vertex AI model name (e.g., β€œtext-embedding-004”)

projectΒΆ

Google Cloud project ID

locationΒΆ

Google Cloud location/region

task_typeΒΆ

Task type for embeddings

credentials_pathΒΆ

Path to service account credentials

get_default_model()[source]ΒΆ

Get the default model for Vertex AI embeddings.

Return type:

str

get_model_info()[source]ΒΆ

Get information about the configured model.

Return type:

dict

get_supported_locations()[source]ΒΆ

Get list of supported Google Cloud locations.

Return type:

list[str]

get_supported_models()[source]ΒΆ

Get list of supported Vertex AI embedding models.

Return type:

list[str]

get_task_types()[source]ΒΆ

Get list of supported task types.

Return type:

list[str]

instantiate()[source]ΒΆ

Create a Google Vertex AI embeddings instance.

Returns:

VertexAIEmbeddings instance configured with the provided parameters

Raises:
  • ImportError – If langchain-google-vertexai is not installed

  • ValueError – If configuration is invalid

Return type:

Any

validate_configuration()[source]ΒΆ

Validate the configuration before instantiation.

Return type:

None

classmethod validate_location(v)[source]ΒΆ

Validate Google Cloud location.

Return type:

Any

classmethod validate_model(v)[source]ΒΆ

Validate the Vertex AI model name.

Return type:

Any

classmethod validate_project(v)[source]ΒΆ

Validate Google Cloud project ID.

Return type:

Any

classmethod validate_task_type(v)[source]ΒΆ

Validate task type.

Return type:

Any