[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Calling Gemini from BigQuery

📊 BigQuery ML & Data AI 15m 300 BASE XP

Generative AI over Structured Data

BigQuery ML now integrates directly with Vertex AI foundation models. You can run Gemini over millions of rows of text data directly within a SQL query.

SELECT * FROM ML.GENERATE_TEXT(
  MODEL `my_dataset.gemini_pro_model`,
  (SELECT text_column as prompt FROM `my_dataset.reviews`),
  STRUCT(0.2 AS temperature, 100 AS max_output_tokens)
);

This allows you to perform sentiment analysis, summarization, and entity extraction on massive datasets in seconds.

SYNAPSE VERIFICATION
QUERY 1 // 1
How can you run the Gemini model over millions of rows in BigQuery?
Export the data to Python and loop over it
Use the ML.GENERATE_TEXT function directly in a SQL query
It is not possible
Use a Cloud Function to trigger the API
Watch: 139x Rust Speedup
Google Vertex AI Academy | Free Interactive Course | Infinity AI