Commit graph

5 commits

Author SHA1 Message Date
Muja Kayadan
20142380cc
Merge 747689f6af into b82af5b826 2025-04-24 00:57:03 -07:00
Krish Dholakia
9b7ebb6a7d
build(pyproject.toml): add new dev dependencies - for type checking (#9631)
* build(pyproject.toml): add new dev dependencies - for type checking

* build: reformat files to fit black

* ci: reformat to fit black

* ci(test-litellm.yml): make tests run clear

* build(pyproject.toml): add ruff

* fix: fix ruff checks

* build(mypy/): fix mypy linting errors

* fix(hashicorp_secret_manager.py): fix passing cert for tls auth

* build(mypy/): resolve all mypy errors

* test: update test

* fix: fix black formatting

* build(pre-commit-config.yaml): use poetry run black

* fix(proxy_server.py): fix linting error

* fix: fix ruff safe representation error
2025-03-29 11:02:13 -07:00
Muja Kayadan
747689f6af
Fix asyncio get_event_loop deprecation warning
## Fix asyncio get_event_loop() deprecation warning

### Problem
The caching handler uses `asyncio.get_event_loop()` which raises a deprecation warning in Python 3.10+ and will be removed in future versions.

Error: "DeprecationWarning: There is no current event loop"

### Solution
Updated the code to use `asyncio.get_running_loop()` with a fallback to `asyncio.new_event_loop()` when no loop is running, which follows the recommended pattern for modern Python versions.

This approach:
- Avoids the deprecation warning
- Creates isolated event loops when needed
- Maintains the same functionality without modifying thread state
- Is compatible with Python 3.10 through 3.13

### Testing
Tested on Python 3.13.x with no deprecation warnings.

### Related Issues
This addresses the same issue discussed in python/cpython#93453
2025-03-23 02:32:04 -05:00
Krrish Dholakia
b8d1166e0c fix(llm_caching_handler.py): handle no current event loop error 2025-03-12 12:29:25 -07:00
Krrish Dholakia
7a8165eaba fix(llm_caching_handler.py): Add event loop to llm client cache info
Fixes https://github.com/BerriAI/litellm/issues/7667
2025-03-12 12:24:24 -07:00