WeaviateEx.API.Vectorizers.Text2VecGoogle (WeaviateEx v0.7.4)

View Source

Text2Vec-Google vectorizer configuration.

Supports both Google Vertex AI and Google AI Studio (Gemini) services.

Services

  • :vertex - Google Vertex AI (requires project_id)
  • :gemini - Google AI Studio (Gemini, uses generativelanguage.googleapis.com)

Vertex AI Example

Text2VecGoogle.new(
  service: :vertex,
  project_id: "my-project",
  model: "textembedding-gecko@001"
)

Gemini Example

Text2VecGoogle.new(
  service: :gemini,
  model: "text-embedding-004"
)

Summary

Functions

Parse configuration from API response.

Create a new Text2Vec-Google configuration.

Convert configuration to API format.

Returns the vectorizer name for the API.

Types

service()

@type service() :: :vertex | :gemini

t()

@type t() :: %WeaviateEx.API.Vectorizers.Text2VecGoogle{
  api_endpoint: String.t() | nil,
  dimensions: non_neg_integer() | nil,
  model: String.t() | nil,
  project_id: String.t() | nil,
  service: service(),
  task_type: String.t() | nil,
  title_property: String.t() | nil,
  vectorize_collection_name: boolean()
}

Functions

from_api(map)

@spec from_api(map()) :: t()

Parse configuration from API response.

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new Text2Vec-Google configuration.

Options

Common

  • :service - Service type: :vertex or :gemini (default: :vertex)
  • :model - Model ID
  • :dimensions - Output dimensions
  • :title_property - Property to use as title
  • :task_type - Task type for embeddings (e.g., "RETRIEVAL_DOCUMENT")
  • :vectorize_collection_name - Include collection name (default: true)

Vertex AI specific

  • :project_id - Google Cloud project ID (required for Vertex)
  • :api_endpoint - API endpoint (optional, default varies by region)

Gemini specific

  • For Gemini, :api_endpoint defaults to "generativelanguage.googleapis.com"

to_api(config)

@spec to_api(t()) :: map()

Convert configuration to API format.

vectorizer_name()

@spec vectorizer_name() :: String.t()

Returns the vectorizer name for the API.