# Setting Up Vertex AI

## How to Set Up

Perform the following operations in the BigQuery console:

* Add an External connections
  * Add `Vertex AI > BigQuery federation` from Add data in Explorer
* Add access credentials to the External connection
  * Grant access permissions from IAM and admin
    * Enter the Service account ID of the added External connection in Add principals
    * Assign the `Vertex AI User` role
* Add the following role to the Codatum connection:
  * `BigQuery Connection User`
  * There are two ways to add:
    * Add a principal to the External conneciton
      * Enter the Service account used for the Codatum connection in Add principals
    * Add a role to the Service account set for the Codatum connection
* Create a dataset
  * Create a dataset to register the model
* (Optional) Add a model
  * Add a model from the BigQuery query editor. Reference:：<https://cloud.google.com/bigquery/docs/generate-text-tutorial-gemini>
  * You can add models on Codatum


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codatum.com/best-practices/ai-generated-summary/vertex-ai-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
