From 83d80cc62affa61a9b5f9e15b7c834841d52fe28 Mon Sep 17 00:00:00 2001 From: Matt Cornillon Date: Thu, 2 Jul 2026 16:54:53 +0200 Subject: [PATCH 1/2] Fix instructions after push --- hacks/disneyland-on-gcp/README.md | 42 +++++++++++++--------------- hacks/disneyland-on-gcp/solutions.md | 2 +- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/hacks/disneyland-on-gcp/README.md b/hacks/disneyland-on-gcp/README.md index f00b8ae3..382515ea 100644 --- a/hacks/disneyland-on-gcp/README.md +++ b/hacks/disneyland-on-gcp/README.md @@ -261,20 +261,11 @@ To register your user, follow these steps: - Sign in to the `disney` database using **Basic Authentication** (Username: `postgres`, Password: ``). 2. **Register the IAM User:** - Open a new query editor and run the following SQL commands to register your own Google account (so you can manage context sets and allow the agent to connect) and grant it the necessary table privileges: - - ```sql - -- 1. Register your own Google account (replace with your actual GCP login email) - CREATE USER "your-email@domain.com" WITH FLAGS ('IAMUser'); - GRANT USAGE ON SCHEMA public TO "your-email@domain.com"; - GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO "your-email@domain.com"; - - -- 2. Ensure future tables grant access automatically - ALTER DEFAULT PRIVILEGES IN SCHEMA public - GRANT SELECT, INSERT, UPDATE ON TABLES TO "your-email@domain.com"; - ``` - - *(Note: Replace `your-email@domain.com` with the email you use to log into the Google Cloud Console.)* + - In your AlloyDB console, navigate to **Users** + - Click **Add user account** + - Select **Cloud IAM** + - Enter the email you use to log into the Google Cloud Console in the **User ID** field + - Click **Save** #### Task 2.3: Set Up the QueryData Context Set in AlloyDB @@ -439,7 +430,7 @@ Rather than writing Python code from scratch, you will leverage the new **Data S We want our guest assistant to predict wait times for any hour of the day. 1. Load the historical wait times dataset from: - `gs://ghacks-disneyland-on-gcp/waiting_times.csv` into a BigQuery table named `waiting_times`. + `gs://ghacks-disneyland-on-gcp/waiting_time.csv` into a BigQuery table named `waiting_times`. 2. Use BigQuery ML to train a time-series forecasting model. You can choose either: - **ARIMA_PLUS**: The classic, fast statistical forecasting model. - **TimesFM**: Google's state-of-the-art foundation model for time-series forecasting (using `AI.FORECAST`). @@ -484,18 +475,23 @@ You have a GCS bucket containing park photos: `gs://ghacks-disneyland-on-gcp/att 3. Use `AI.GENERATE_TEXT` to pass the image URIs to the model with a prompt asking: *"Is this image from a Disneyland park? Answer with a JSON object containing keys 'is_disneyland' (boolean) and 'reason' (string)."* 4. Save the structured results into a table `images_classification`. -#### Task 4.2: PDF Brochure Ingestion & RAG Pipeline +#### Task 4.2: Streamlined PDF Document Processing + +We want our assistant to answer detailed questions based on the official park brochures (PDFs) located in `gs://ghacks-disneyland-on-gcp/disneyland_brochures/`. You can choose between two options. + +Create an **Object Table** in BigQuery pointing to the brochures bucket. -We want our assistant to answer detailed questions based on the official park brochures (PDFs) located in `gs://ghacks-disneyland-on-gcp/disneyland_brochures/`. +**Option 1: AI.SEARCH with OBJECTREF** +- Use `AI.SEARCH` to find *"Where can I find a buffet-style Tex-Mex meal?"* -1. Create an **Object Table** pointing to the brochures bucket. -2. Create a **Python UDF** in BigQuery to extract text and chunk the PDF files. You can use `pypdf` inside the UDF environment. -3. Chunk the PDFs, and generate embeddings for each text chunk using a remote BQML embedding model (`gemini-embedding-001`). -4. Store the chunks and their vector embeddings in a table `brochure_embeddings`. +**Option 2: For a more streamlined pipeline, let’s create chunks of the pdfs, then generate embeddings. Finally use Vector search to find similarities.** +- Extract chunks of the PDF files (using `AI.GENERATE`, `AI.PARSE_DOCUMENT` or a UDF Function). +- Generate embeddings for each text chunk using a remote BQML embedding model (`gemini-embedding-001`). +- Store the chunks and their vector embeddings in a table `brochure_embeddings`. -#### Task 4.3: Vector Search & RAG Validation +#### Task 4.3: Intelligent Search and Response with AI.SEARCH & AI.GENERATE_TEXT -1. Perform a vector search query on `brochure_embeddings` to find the most relevant brochure chunks for the question: *"Where can I find a buffet-style Tex-Mex meal?"* (or French: *"Où manger un repas tex-mex à volonté ?"*). +1. Perform a vector search over the `brochure_embeddings` table. Find the most relevant document chunks for the question: *"Where can I find a buffet-style Tex-Mex meal?"* (or French: *"Où manger un repas tex-mex à volonté ?"*). 2. Pass the retrieved chunks as context along with the question to `gemini-2.5-flash` using `AI.GENERATE_TEXT` to generate a grounded, accurate response. ### Success Criteria diff --git a/hacks/disneyland-on-gcp/solutions.md b/hacks/disneyland-on-gcp/solutions.md index 6b9f3499..e167231c 100644 --- a/hacks/disneyland-on-gcp/solutions.md +++ b/hacks/disneyland-on-gcp/solutions.md @@ -348,7 +348,7 @@ FROM LOAD DATA OVERWRITE `disney.waiting_times` FROM FILES ( format = 'CSV', - uris = ['gs://ghacks-disneyland-on-gcp/waiting_times.csv'] + uris = ['gs://ghacks-disneyland-on-gcp/waiting_time.csv'] ); ``` From 1bdb0911480802355cd462cf2f5536ce6fd0ca8d Mon Sep 17 00:00:00 2001 From: Matt Cornillon Date: Thu, 2 Jul 2026 16:57:19 +0200 Subject: [PATCH 2/2] Fix MD lint --- hacks/disneyland-on-gcp/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hacks/disneyland-on-gcp/README.md b/hacks/disneyland-on-gcp/README.md index 382515ea..6b503755 100644 --- a/hacks/disneyland-on-gcp/README.md +++ b/hacks/disneyland-on-gcp/README.md @@ -481,10 +481,14 @@ We want our assistant to answer detailed questions based on the official park br Create an **Object Table** in BigQuery pointing to the brochures bucket. -**Option 1: AI.SEARCH with OBJECTREF** +##### Option 1: AI.SEARCH with OBJECTREF + - Use `AI.SEARCH` to find *"Where can I find a buffet-style Tex-Mex meal?"* -**Option 2: For a more streamlined pipeline, let’s create chunks of the pdfs, then generate embeddings. Finally use Vector search to find similarities.** +##### Option 2: Chunking, Embeddings, and Vector Search + +For a more streamlined pipeline, let's create chunks of the PDFs, then generate embeddings. Finally, use Vector search to find similarities: + - Extract chunks of the PDF files (using `AI.GENERATE`, `AI.PARSE_DOCUMENT` or a UDF Function). - Generate embeddings for each text chunk using a remote BQML embedding model (`gemini-embedding-001`). - Store the chunks and their vector embeddings in a table `brochure_embeddings`.