Skip to content

feat(retail): add Vertex AI Search for commerce snippets#13996

Open
iennae wants to merge 2 commits intomainfrom
retail_samples_b_268120562
Open

feat(retail): add Vertex AI Search for commerce snippets#13996
iennae wants to merge 2 commits intomainfrom
retail_samples_b_268120562

Conversation

@iennae
Copy link
Copy Markdown
Contributor

@iennae iennae commented Apr 8, 2026

  • Introduce search_request, search_pagination, and search_offset samples (use cases as per https://docs.cloud.google.com/retail/docs/search-basic) resolves the python portion of b/268120562 (the java samples are still embedded)
  • 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.

Description

Replaces #13119

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

@iennae iennae requested review from a team as code owners April 8, 2026 01:56
@snippet-bot
Copy link
Copy Markdown

snippet-bot bot commented Apr 8, 2026

Here is the summary of changes.

You are about to add 3 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: retail Issues related to the Retail API API. samples Issues that are directly related to samples. labels Apr 8, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@iennae iennae force-pushed the retail_samples_b_268120562 branch from d46bcdd to 121e01c Compare April 8, 2026 02:07
Signed-off-by: Jennifer Davis <sigje@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: retail Issues related to the Retail API API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants