Repository navigation
LCORE-4707: Bumped PAI version to 2.38.0 - #3020
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Dependency pins and HTTP client typing pyproject.toml, src/pydantic_ai_lightspeed/ogx/_provider.py, src/providers/inference/watsonx/pai_provider.py, src/pydantic_ai_lightspeed/capabilities/granite_guardian/_capability.py, tests/unit/providers/inference/azure/test_provider.py, tests/unit/utils/test_pydantic_ai.py |
The dependency declarations and HTTP client annotations are updated. The Azure client mock and instruction assertion are also adjusted. |
Conversation-ID extraction src/pydantic_ai_lightspeed/capabilities/utils.py, tests/unit/pydantic_ai_lightspeed/capabilities/granite_guardian/test_capability.py, tests/unit/pydantic_ai_lightspeed/capabilities/question_validity/test_capability.py |
extract_conversation_id accepts AbstractModel and returns None for values that are not Model instances. Capability tests use TestModel fixtures and cover an object without model settings. |
Streamed-response namespace src/pydantic_ai_lightspeed/ogx/_model.py, tests/unit/pydantic_ai_lightspeed/ogx/test_model.py |
OGX passes the provider model ID namespace to API error mapping and the streamed response. The stream-test fixture sets the namespace. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Other
Possibly related PRs
- lightspeed-core/lightspeed-stack#2977: Adds the Watsonx provider code whose HTTP client argument receives a typing annotation in this change.
- lightspeed-core/lightspeed-stack#2992: Pins the harness and documents compatibility with the earlier
pydantic-aiversion; this change updates thepydantic-aipin.
Suggested reviewers: tisnik, jrobertboos
Merge Risk: 
Minimal · up to c41f8
-
The reviewed changes are ready to merge after normal checks; no unresolved issue was identified.
Pre-merge checks: 
7
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 10 files. (1 skipped: 1 unsupported.)
Full details: Performance And Algorithmic Complexity
-
Explanation
PASSED. The pull request changes dependency pins, type annotations, constant-time conversation-ID extraction, streamed-response metadata, and test fixtures. No changed production path adds nested iteration, per-item API or database queries, repeated parsing or regex compilation, unbounded state, or unbounded list/API operations. The only new iteration is
any(...)in a unit-test assertion.
Full details: Security And Secret Handling
-
Explanation
PASSED. The pull-request diff contains dependency updates, HTTP client type compatibility changes, conversation-ID type validation, provider namespace propagation, and test mock updates. It adds no plaintext secret or token, logging of sensitive data, API endpoint/auth change, injection sink, or Kubernetes Secret manifest change. Existing API keys and credentials remain environment/configuration inputs and are not logged.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
✨ Simplify code
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
| from ogx_client import AsyncOgxClient | ||
| from openai import AsyncOpenAI | ||
| from pydantic_ai import ModelProfile | ||
| from pydantic_ai._http import AsyncHTTPClient |
There was a problem hiding this comment.
Type union for httpx and httpx2 clients
| "google-cloud-aiplatform>=1.130.0", | ||
| # API inference: remote::watsonx | ||
| # LCORE-1565 | ||
| "litellm>=1.88.6", |
There was a problem hiding this comment.
WatsonX no longer uses litellm dependency, litellm is already present in root deps.
| "genai-prices>=0.1.12", | ||
| # Used for Pydantic AI | ||
| "pydantic-ai==2.27.1", | ||
| "pydantic-ai==2.38.0", |
There was a problem hiding this comment.
Required for vLLM provider
Description
Bump Pydantic AI to 2.38.0 (requires openai≥3) and pin litellm to 1.107.0rc2 so the openai 3 / litellm conflict resolves cleanly. Adapt call sites for PAI 2.38 API changes (
AbstractModel,AsyncHTTPClient,SourcedInstruction,_model_id_namespace). Keep legacyhttpxclients with# type: ignore[arg-type]where OpenAI 3 typeshttp_clientas httpx2 only (runtime still accepts httpx until PAI v3). Narrowextract_conversation_idviaisinstance(..., Model)instead ofgetattr. Update unit tests/mocks accordingly.Type of change
pyproject.toml+uv.lock]requirements.*.txtfor Konflux]Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
uv sync --group dev --group ogxlibdevuv run make format && uv run make verifyuv run make test-unitAsyncOpenAIwith legacyhttpx.AsyncClient(type ignores only; no httpx2 migration in this PR).Summary by CodeRabbit