Sangeetha-Grantha

Metadata Value
Status Completed
Version 2.0.0
Last Updated 2026-07-10
Author Sangeetha Grantha Team

Goal

Batch 3c — Upgrade the Gemini SDK google-genai 1.34.0 → 2.9.0 (major) in the Python extraction/enrichment worker. Likely breaking surface in the worker’s LLM calls; review before raising the floor.

Scope (tools/krithi-extract-enrich-worker/pyproject.toml + uv.lock)

Affected code

Implementation Plan

  1. Review the google-genai 1.x → 2.x changelog for breaking changes (client init, request/response shapes, structured-output API).
  2. Bump the floor in pyproject.toml; uv lock.
  3. Update worker LLM call sites and Pydantic response models as needed.
  4. Run worker pytest; smoke-test an extraction+enrichment pass against a sample source.
  5. Sync current-versions.md (Python tools section).
  6. Commit per commit-policy.

Risks

Completion (2026-07-10)

Per the upstream changelog, google-genai 2.0’s breaking changes are Interactions-API-only (“GenerateContent usage is unaffected”) — the worker’s surface (genai.Client(api_key=), models.generate_content + GenerateContentConfig(response_mime_type, response_schema), response.text, batches.create) needed no code changes. Floor raised to >=2.0.0, resolved 2.9.0. Verified: all 144 worker tests green, including the TRACK-113 W3 integration tests that drive the real 2.x SDK through respx-stubbed HTTP (client init → request → response parsing). Live-key smoke test not run — no SG_GEMINI_API_KEY available in this environment; the HTTP-stubbed round-trip is the deepest offline verification.

Follow-up (2026-11-13): google-genai 3.x

3.0 defaults to httpx2 and Developer API v1. The worker now builds clients through src/gemini_transport.py, which passes an httpx client (so respx stubs still intercept) and api_version="v1beta" for the Developer API (Vertex keeps the SDK default). pyproject.toml declares google-genai[httpx]>=2.0.0, resolved 3.6.1 as of 2026-11-24 (first resolved 3.3.0). asyncio_default_fixture_loop_scope is now set for pytest-asyncio 1.5.