mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-07 07:58:09 +00:00
Response transformation crashed with TypeError when counting tokens for multimodal (dict-shaped) embedding inputs, since encoding.encode() was called directly on the dict instead of its text parts. Also removed a dead, equally-buggy duplicate of the same loop in _transform_response. Separately, the embeddings guardrail handler silently skipped multimodal dict inputs instead of scanning them, letting prohibited text/image content bypass the configured guardrail. It now extracts and scans the text parts while leaving image parts untouched.
6.8 KiB
6.8 KiB
TLDR
Problem this solves:
- ...
How it solves it:
- ...
User Flow
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
- I have added meaningful tests
- My PR passes all CI/CD checks (e.g., lint, format, unit tests)
- My PR's scope is as isolated as possible; it only solves 1 specific problem
- I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment
@greptileaito re-request a review after pushing changes)
Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Type
🆕 New Feature 🐛 Bug Fix 🧹 Refactoring 📖 Documentation 🚄 Infrastructure ✅ Test
Caveats (if any)
QA runbook
Final Attestation
- The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR