feat(litellm): Add async callbacks#5969
Conversation
Codecov Results 📊✅ 100 passed | ⏭️ 1 skipped | Total: 101 | Pass Rate: 99.01% | Execution Time: 33.64s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 14749 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 26.75% 30.69% +3.94%
==========================================
Files 191 191 —
Lines 21282 21279 -3
Branches 7006 7010 +4
==========================================
+ Hits 5692 6530 +838
- Misses 15590 14749 -841
- Partials 490 537 +47Generated by Codecov Action |
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Anthropic
Pydantic Ai
Other
Internal Changes 🔧Litellm
Other
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Test mocks embeddings path instead of completions
- Updated
test_async_exception_handlingto patchclient.completions._client._clientso the mock target matches thelitellm.acompletioncode path.
- Updated
Or push these changes by commenting:
@cursor push 270c50b1f3
Preview (270c50b1f3)
diff --git a/tests/integrations/litellm/test_litellm.py b/tests/integrations/litellm/test_litellm.py
--- a/tests/integrations/litellm/test_litellm.py
+++ b/tests/integrations/litellm/test_litellm.py
@@ -867,7 +867,7 @@
model_response = get_rate_limit_model_response()
with mock.patch.object(
- client.embeddings._client._client,
+ client.completions._client._client,
"send",
return_value=model_response,
):This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6626a1b. Configure here.


Description
Add asynchronous variants of callbacks to
litellm.input_callbackandlitellm.success_callbackIssues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)