feat(retail): add Vertex AI Search for commerce snippets#13996
feat(retail): add Vertex AI Search for commerce snippets#13996
Conversation
|
Here is the summary of changes. You are about to add 3 region tags.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request introduces Python code snippets and unit tests for Vertex AI Search for commerce, specifically demonstrating basic search requests, pagination, and result offsets. The review feedback highlights a critical logic issue in the pagination and offset implementations: iterating directly over the response pager triggers the client library's auto-pagination feature, which bypasses the manual pagination logic intended for the samples. To resolve this, the reviewer suggests using the .pages property to handle results page-by-page and provides necessary updates for the associated unit test mocks.
- Introduce search_request, search_pagination, and search_offset samples. - Use the correct "Vertex AI Search for commerce" product naming. - Hardcode catalog and branch IDs to "default_catalog" and "default_branch" to maximize sample readability. - Include unit tests with mocks and a shared conftest.py. - Add a README.md detailing API prerequisites, ADC setup, and required IAM roles. - Ensure all samples and tests are PEP8 compliant and formatted with Black.
d46bcdd to
121e01c
Compare
Signed-off-by: Jennifer Davis <sigje@google.com>
Description
Replaces #13119
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
nox -s py-3.9(see Test Environment Setup)nox -s lint(see Test Environment Setup)