This directory contains Java samples for Vertex AI Search for commerce.
To run these samples, you must have:
- A Google Cloud Project with the Vertex AI Search for commerce API enabled.
- Vertex AI Search for commerce set up with a valid catalog and serving configuration (placement).
- Authentication: These samples use Application Default Credentials (ADC).
- If running locally, you can set up ADC by running:
gcloud auth application-default login
- If running locally, you can set up ADC by running:
- IAM Roles: The service account or user running the samples needs the
roles/retail.viewer(Retail Viewer) role or higher.
- Search.java: Basic search request showing both text search and browse search (using categories).
- SearchPagination.java: Shows how to use
next_page_tokento paginate through search results. - SearchOffset.java: Shows how to use
offsetto skip a specified number of results.
For more information, see the Vertex AI Search for commerce documentation.