このページでは、Vertex AI SDK を使用して Vertex AI RAG Engine タスクを実行する方法について説明します。
このノートブック Vertex AI RAG Engine の概要を使用して、手順に沿って操作することもできます。
必要なロール
Grant roles to your user account. Run the following command once for each of the following
IAM roles:
roles/aiplatform.user
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
- Replace
PROJECT_ID
with your project ID. -
Replace
USER_IDENTIFIER
with the identifier for your user account. For example,user:myemail@example.com
. - Replace
ROLE
with each individual role.
Google Cloud コンソールを準備する
Vertex AI RAG Engine を使用する手順は次のとおりです。
Google Cloud コンソールで次のコマンドを実行して、プロジェクトを設定します。
gcloud config set {project}
次のコマンドを実行して、ログインを承認します。
gcloud auth application-default login
Vertex AI RAG Engine を実行する
このサンプルコードをコピーして Google Cloud コンソールに貼り付け、Vertex AI RAG Engine を実行します。
Vertex AI SDK for Python
Vertex AI SDK for Python のインストールまたは更新の方法については、Vertex AI SDK for Python をインストールするをご覧ください。詳細については、Vertex AI SDK for Python API のリファレンス ドキュメントをご覧ください。
次のステップ
- RAG API の詳細については、Vertex AI RAG Engine API をご覧ください。
- RAG からのレスポンスの詳細については、Vertex AI RAG Engine の検索と生成の出力をご覧ください。
- Vertex AI RAG Engine の詳細については、Vertex AI RAG Engine の概要をご覧ください。