Migrate OCR service from deprecated google-cloud-aiplatform / vertexai.generative_models SDK to google-genai package. Enable Google Search grounding for VIN decode to improve accuracy.
Changes
M1 (#232): Swap google-cloud-aiplatform>=1.40.0 to google-genai>=1.0.0 in requirements.txt
M2 (#233): Migrate GeminiEngine -- _get_model() to _get_client(), client-per-call pattern, Google Search grounding for VIN decode, uppercase schema types
M3 (#234): Migrate MaintenanceReceiptExtractor -- same pattern, fix RuntimeError bug to use GeminiUnavailableError
M4 (#235): Update test mocks -- engine._client/engine._model_name pattern, clean up dead code
M5: Doc-sync on affected CLAUDE.md files and config.py comment
Test Results
Docker build: SUCCESS
18/18 gemini engine tests: PASS
All VIN decode tests: PASS (unchanged)
All manual extractor tests: PASS (unchanged)
Remaining Verification
Deploy to staging and decode VIN 1G1YE2D32P5602473 to confirm correct 2023 Corvette data with Google Search grounding
Fixes #231
Fixes #232
Fixes #233
Fixes #234
Fixes #235
## Summary
Migrate OCR service from deprecated `google-cloud-aiplatform` / `vertexai.generative_models` SDK to `google-genai` package. Enable Google Search grounding for VIN decode to improve accuracy.
### Changes
- **M1 (#232)**: Swap `google-cloud-aiplatform>=1.40.0` to `google-genai>=1.0.0` in requirements.txt
- **M2 (#233)**: Migrate `GeminiEngine` -- `_get_model()` to `_get_client()`, client-per-call pattern, Google Search grounding for VIN decode, uppercase schema types
- **M3 (#234)**: Migrate `MaintenanceReceiptExtractor` -- same pattern, fix RuntimeError bug to use GeminiUnavailableError
- **M4 (#235)**: Update test mocks -- `engine._client`/`engine._model_name` pattern, clean up dead code
- **M5**: Doc-sync on affected CLAUDE.md files and config.py comment
### Test Results
- Docker build: SUCCESS
- 18/18 gemini engine tests: PASS
- All VIN decode tests: PASS (unchanged)
- All manual extractor tests: PASS (unchanged)
### Remaining Verification
- Deploy to staging and decode VIN `1G1YE2D32P5602473` to confirm correct 2023 Corvette data with Google Search grounding
Replace vertexai.generative_models with google.genai client pattern.
Add Google Search grounding tool to VIN decode for improved accuracy.
Convert response schema types to uppercase per Vertex AI Schema spec.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace engine._model/engine._generation_config mocks with
engine._client/engine._model_name. Update sys.modules patches
from vertexai to google.genai. Remove dead if-False branch.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The installed google-genai version does not support max_remote_calls on
AutomaticFunctionCallingConfig, causing a pydantic validation error that
broke VIN decode on staging.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Remove AutomaticFunctionCallingConfig(max_remote_calls=3) which caused
pydantic validation error on the installed google-genai version
- Log full Gemini raw JSON response in OCR engine for debugging
- Add engine/transmission to backend raw values log
- Add hasTrim/hasEngine/hasTransmission to decode success log
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #231
Fixes #232
Fixes #233
Fixes #234
Fixes #235
Summary
Migrate OCR service from deprecated
google-cloud-aiplatform/vertexai.generative_modelsSDK togoogle-genaipackage. Enable Google Search grounding for VIN decode to improve accuracy.Changes
google-cloud-aiplatform>=1.40.0togoogle-genai>=1.0.0in requirements.txtGeminiEngine--_get_model()to_get_client(), client-per-call pattern, Google Search grounding for VIN decode, uppercase schema typesMaintenanceReceiptExtractor-- same pattern, fix RuntimeError bug to use GeminiUnavailableErrorengine._client/engine._model_namepattern, clean up dead codeTest Results
Remaining Verification
1G1YE2D32P5602473to confirm correct 2023 Corvette data with Google Search grounding