ITADN

Ready patch: accept both snippet status key styles in Vertex AI Search client

#2749OpenGujiassh 创建于 2026-03-29
G
Gujiasshcommented
I prepared a small fix for `search/cloud-function/python/vertex_ai_search_client.py` that accepts both `snippetStatus` and `snippet_status` when parsing snippet-only document results. The branch is already pushed here: - compare view: https://github.com/GoogleCloudPlatform/generative-ai/compare/main...Gujiassh:fix/snippet-status-key-compat - fork branch: `Gujiassh:fix/snippet-status-key-compat` Why this matters: - some payloads use snake_case `snippet_status` - the current parser only accepts camelCase `snippetStatus` - when that happens, snippet-only results get silently dropped even though the snippet succeeded Patch contents: - accept both key styles in `_parse_snippets` - add a regression test covering both variants in `test_vertex_ai_search_client.py` Local verification on the branch: - `search/cloud-function/python/.venv/bin/python -m pytest test_vertex_ai_search_client.py -k snippet_only_accepts_snippet_status_variants -q` - `search/cloud-function/python/.venv/bin/python -m pytest test_vertex_ai_search_client.py -q` I wasn't able to open a PR directly because GitHub rejected `CreatePullRequest` for this repository from my account, but the branch and compare URL are ready if a maintainer wants to cherry-pick or reopen it as a PR.
2 条评论