Skip to main content

Code

cookbook/models/google/gemini/vertexai_search.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Set up Vertex AI Search datastore

Create a Vertex AI Search datastore in Google Cloud Console and note the datastore ID.
3

Set environment variables

4

Install libraries

5

Update the datastore ID

Replace datastore_id in the code with your actual Vertex AI Search datastore ID.
6

Run Agent

Information

  • Requires setting up a Vertex AI Search datastore in Google Cloud Console
  • Must use vertexai=True to enable Vertex AI endpoint
  • The datastore ID format: projects/{project_id}/locations/{location}/collections/default_collection/dataStores/{datastore_id}