Skip to content

Conversation

@Chesars
Copy link
Contributor

@Chesars Chesars commented Nov 7, 2025

Title

Fix MyPy errors for aembedding call_type - CI pass

Relevant PR

#16328

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Summary

Fixes MyPy type checking errors that were causing CI to fail in proxy/proxy_server.py lines 5100 and 5109.

Problem

The embeddings endpoint uses call_type="aembedding" (from PR #16328) but the Literal type hints in ProxyLogging didn't include this value, causing MyPy failures in CI.

Solution

  • Added "aembedding" to Literal type hints in ProxyLogging methods (litellm/proxy/utils.py):
  • Added # type: ignore comments where needed (lines 1021, 1106)

Testing

✅ MyPy passes:

cd litellm && poetry run mypy proxy/proxy_server.py

✅ CI should pass with these changes

  • ✅ No functional changes, only type hint updates

Related

Add "aembedding" to Literal type hints in ProxyLogging methods:
- pre_call_hook overloads (lines 872, 893, 913)
- during_call_hook (line 1052)
- _process_guardrail_callback (line 803)

Add type: ignore comments where ProxyLogging calls CustomLogger
callbacks (lines 1021, 1106) to handle type mismatch between
ProxyLogging's broader Literal (includes "aembedding") and
CustomLogger's narrower Literal (doesn't include "aembedding").

Related to PR BerriAI#16328 which changed embeddings endpoint to use
call_type="aembedding" for async operations.
@vercel
Copy link

vercel bot commented Nov 7, 2025

@Chesars is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chesars please make sure the linting passes after this

@ishaan-jaff ishaan-jaff merged commit 8c58f65 into BerriAI:main Nov 7, 2025
4 of 6 checks passed
@Chesars
Copy link
Contributor Author

Chesars commented Nov 7, 2025

@Chesars please make sure the linting passes after this

Hi @ishaan-jaff . Ok 👍

@Chesars Chesars deleted the fix/mypy-aembedding-type-hints branch November 7, 2025 22:47
LingXuanYin pushed a commit to talesofai/litellm that referenced this pull request Nov 14, 2025
Add "aembedding" to Literal type hints in ProxyLogging methods:
- pre_call_hook overloads (lines 872, 893, 913)
- during_call_hook (line 1052)
- _process_guardrail_callback (line 803)

Add type: ignore comments where ProxyLogging calls CustomLogger
callbacks (lines 1021, 1106) to handle type mismatch between
ProxyLogging's broader Literal (includes "aembedding") and
CustomLogger's narrower Literal (doesn't include "aembedding").

Related to PR BerriAI#16328 which changed embeddings endpoint to use
call_type="aembedding" for async operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants