mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
refactor: fix import order and use get_running_loop in AliyunSLSLogger
- Move AliyunSLSLogger import to correct alphabetical position in custom_logger_registry.py - Replace asyncio.get_event_loop() with asyncio.get_running_loop() to avoid Python 3.10+ deprecation warnings - Prefix unused interface params with _ in _build_contents Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
44d92eefbb
commit
3f9cc2d205
2 changed files with 6 additions and 6 deletions
|
|
@ -70,9 +70,9 @@ class AliyunSLSLogger(CustomLogger):
|
|||
def _build_contents(
|
||||
self,
|
||||
kwargs: Dict[str, Any],
|
||||
response_obj: Any,
|
||||
start_time: Any,
|
||||
end_time: Any,
|
||||
_response_obj: Any,
|
||||
_start_time: Any,
|
||||
_end_time: Any,
|
||||
status: str,
|
||||
) -> list:
|
||||
payload: Optional[StandardLoggingPayload] = kwargs.get(
|
||||
|
|
@ -119,7 +119,7 @@ class AliyunSLSLogger(CustomLogger):
|
|||
contents = self._build_contents(
|
||||
kwargs, response_obj, start_time, end_time, "success"
|
||||
)
|
||||
await asyncio.get_event_loop().run_in_executor(
|
||||
await asyncio.get_running_loop().run_in_executor(
|
||||
None, self._put_logs, contents
|
||||
)
|
||||
except Exception as e:
|
||||
|
|
@ -134,7 +134,7 @@ class AliyunSLSLogger(CustomLogger):
|
|||
contents = self._build_contents(
|
||||
kwargs, response_obj, start_time, end_time, "failure"
|
||||
)
|
||||
await asyncio.get_event_loop().run_in_executor(
|
||||
await asyncio.get_running_loop().run_in_executor(
|
||||
None, self._put_logs, contents
|
||||
)
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from typing import Union
|
|||
|
||||
from litellm import _custom_logger_compatible_callbacks_literal
|
||||
from litellm.integrations.agentops import AgentOps
|
||||
from litellm.integrations.aliyun_sls import AliyunSLSLogger
|
||||
from litellm.integrations.anthropic_cache_control_hook import AnthropicCacheControlHook
|
||||
from litellm.integrations.argilla import ArgillaLogger
|
||||
from litellm.integrations.azure_storage.azure_storage import AzureBlobStorageLogger
|
||||
|
|
@ -41,7 +42,6 @@ from litellm.integrations.mlflow import MlflowLogger
|
|||
from litellm.integrations.openmeter import OpenMeterLogger
|
||||
from litellm.integrations.opentelemetry import OpenTelemetry
|
||||
from litellm.integrations.opik.opik import OpikLogger
|
||||
from litellm.integrations.aliyun_sls import AliyunSLSLogger
|
||||
from litellm.integrations.posthog import PostHogLogger
|
||||
from litellm.integrations.prometheus import PrometheusLogger
|
||||
from litellm.integrations.s3_v2 import S3Logger
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue