mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix(containers): Fix Python 3.10 compatibility for OpenAIContainerConfig
LiteLLM's pyproject.toml specifies `python = ">=3.9,<4.0"`, supporting
Python 3.9 and above. However, the OpenAIContainerConfig class was
failing to load on Python 3.10 with:
TypeError: Cannot subclass typing.Any
This occurred because `BaseContainerConfig = Any` was used as a
runtime placeholder, and the class then inherited from it.
In Python 3.11+, subclassing `typing.Any` is allowed (added to support
dynamic classes like unittest.Mock where type checkers should skip
verification). However, in Python 3.10 and earlier, this raises a
TypeError.
The fix imports the actual BaseContainerConfig class at runtime instead
of using Any as a placeholder.
Fixes #19727
This commit is contained in:
parent
aa4b0e0149
commit
25ff25d1ef
1 changed files with 1 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ if TYPE_CHECKING:
|
|||
BaseLLMException = _BaseLLMException
|
||||
else:
|
||||
LiteLLMLoggingObj = Any
|
||||
BaseContainerConfig = Any
|
||||
from ...base_llm.containers.transformation import BaseContainerConfig
|
||||
BaseLLMException = Any
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue