Skip to main content
Embed text and generate completions using Google’s Gemini models. See the API reference for Gemini UDFs and Embedding UDFs for all parameters.
Gemini UDFs make API calls that incur per-token costs. Each row processed results in one or more API requests billed to your account. Review Gemini pricing before running on large tables.
Set the GEMINI_API_KEY environment variable before calling any factory function below. The key is read at UDF creation time and serialized with the UDF — no cluster-level env_vars configuration is needed.

Embeddings

Embed text with optional task-type hints for retrieval, classification, and clustering scenarios. See the API reference for all parameters. Multiple embeddings tuned for different retrieval tasks:

Generation

Generate text from Gemini models. Supports text, image, audio, video, and document inputs. See the API reference for all parameters. Enrich a table with sentiment, captions, and transcriptions at once:

API Reference

  • Geminigemini_udf() parameters: column, prompt, model, mime_type, and more
  • Embeddingsgemini_embedding_udf() parameters: column, model, task_type, dimensionality, normalize