Skip to content

Commit bacb63b

Browse files
fix(litellm): Prevent module shadowing
1 parent 86d326c commit bacb63b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sentry_sdk/integrations/litellm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
try:
2121
import litellm # type: ignore[import-not-found]
22+
from litellm import get_llm_provider
2223
except ImportError:
2324
raise DidNotEnable("LiteLLM not installed")
2425

@@ -45,7 +46,7 @@ def _input_callback(kwargs: "Dict[str, Any]") -> None:
4546
# Get key parameters
4647
full_model = kwargs.get("model", "")
4748
try:
48-
model, provider, _, _ = litellm.get_llm_provider(full_model)
49+
model, provider, _, _ = get_llm_provider(full_model)
4950
except Exception:
5051
model = full_model
5152
provider = "unknown"

tests/test_shadowed_module.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def pytest_generate_tests(metafunc):
3131
- {
3232
"clickhouse_driver",
3333
"grpc",
34-
"litellm",
3534
"opentelemetry",
3635
"pure_eval",
3736
"ray",

0 commit comments

Comments
 (0)