This page shows you how to use the Vertex AI SDK to run
Vertex AI RAG Engine tasks. You can also follow along using this notebook Intro to Vertex AI RAG Engine.
Grant roles to your user account. Run the following command once for each of the following
IAM roles:
Replace the following: To use Vertex AI RAG Engine, do the following: Run this command in the Google Cloud console to set up your project. Run this command to authorize your login. Copy and paste this sample code into the Google Cloud console to run Vertex AI RAG Engine. To learn how to install or update the Vertex AI SDK for Python, see Install the Vertex AI SDK for Python.
For more information, see the
Python API reference documentation.
Required roles
roles/aiplatform.user
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
PROJECT_ID
: your project ID.USER_IDENTIFIER
: the identifier for your user
account—for example, myemail@example.com
.
ROLE
: the IAM role that you grant to your user account.Prepare your Google Cloud console
gcloud config set {project}
gcloud auth application-default login
Run Vertex AI RAG Engine
Python
What's next
- To learn more about the RAG API, see Vertex AI RAG Engine API.
- To learn more about the responses from RAG, see Retrieval and Generation Output of Vertex AI RAG Engine.
- To learn about the Vertex AI RAG Engine, see the
Vertex AI RAG Engine overview.