mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix: replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction
- Replace asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() - Add inspect import - Fixes deprecation warning in Python 3.16 The asyncio.iscoroutinefunction is deprecated and will be removed in Python 3.16. Using inspect.iscoroutinefunction is the recommended approach. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
7a097ae97f
commit
e9929d2798
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import asyncio
|
||||
import functools
|
||||
import inspect
|
||||
import time
|
||||
from datetime import datetime
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
|
@ -270,7 +271,7 @@ def track_llm_api_timing():
|
|||
verbose_logger.debug(f"Error in service logging: {str(e)}")
|
||||
|
||||
# Check if the function is async or sync
|
||||
if asyncio.iscoroutinefunction(func):
|
||||
if inspect.iscoroutinefunction(func):
|
||||
return async_wrapper
|
||||
return sync_wrapper
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue