refactor: adopt any-llm providers - #41
Conversation
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
📝 WalkthroughWalkthroughThe PR replaces provider-specific LLM HTTP adapters with any-llm SDK integration, adds strict structured-output validation, updates configuration and CLI wiring, introduces context-based API identity logging, and revises related tests, documentation, dependencies, and environment examples. ChangesAny-LLM migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant create_any_llm_provider
participant AnyLLMStructuredProvider
participant LoggedAsyncClient
CLI->>create_any_llm_provider: Pass provider, model, and API options
create_any_llm_provider->>AnyLLMStructuredProvider: Build SDK-backed adapter
AnyLLMStructuredProvider->>LoggedAsyncClient: Send structured completion request
LoggedAsyncClient-->>AnyLLMStructuredProvider: Return completion response
AnyLLMStructuredProvider-->>CLI: Return validated structured data
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 39 38 -1
Lines 5881 5944 +63
Branches 334 323 -11
=======================================
+ Hits 5859 5922 +63
Misses 15 15
Partials 7 7 ☔ View full report in Codecov by Harness. |
db065ea to
82d3ef0
Compare
82d3ef0 to
4f12170
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
weather_briefing/api_client.py (1)
30-40: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd a brief comment to clarify the side-effect.
Since the return value of
api_call_extensionsis ignored here, consider adding a brief comment clarifying that it is called intentionally to validate theproviderandoperationlabels. This helps prevent future maintainers from mistakenly removing it as dead code.💡 Proposed comment
`@contextmanager` def api_call_context(provider: str, operation: str) -> Iterator[None]: """Classify requests made by an SDK that cannot set HTTPX extensions.""" - api_call_extensions(provider, operation) + api_call_extensions(provider, operation) # Validates label formats token = _CURRENT_API_CALL.set((provider, operation)) try: yield🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@weather_briefing/api_client.py` around lines 30 - 40, Add a brief inline comment immediately before the api_call_extensions call in api_call_context explaining that the call is intentional and validates the provider and operation labels, even though its return value is ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/design.md`:
- Line 11: Update the dependency-boundary section in docs/design.md to reconcile
its statement about vendor SDKs with the installation model described near the
provider-loading guidance: clarify that model-vendor SDKs are selectively
supplied through any-llm extras rather than introduced as direct project
dependencies. Also revise the later statement around the “no model-vendor SDKs”
decision so both sections consistently reflect the changed dependency boundary.
---
Nitpick comments:
In `@weather_briefing/api_client.py`:
- Around line 30-40: Add a brief inline comment immediately before the
api_call_extensions call in api_call_context explaining that the call is
intentional and validates the provider and operation labels, even though its
return value is ignored.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 03657e66-30a1-4c22-afb4-01d3c4a8f7c4
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (19)
.gitignoreAGENTS.mdREADME.mddocs/design.mddocs/requirements.mdenv.examplepyproject.tomltests/test_any_llm_provider.pytests/test_api_client.pytests/test_cli.pytests/test_config.pytests/test_deepseek_provider.pytests/test_llm.pytests/test_openai_compatible_provider.pytests/test_service.pyweather_briefing/api_client.pyweather_briefing/cli.pyweather_briefing/config.pyweather_briefing/llm.py
💤 Files with no reviewable changes (2)
- tests/test_deepseek_provider.py
- tests/test_openai_compatible_provider.py
4f12170 to
3cb0570
Compare
Summary
Verification
Local-only audit
Summary by CodeRabbit
New Features
Documentation
Tests