Files
litellm/tests/logging_callback_tests/test_azure_blob_storage.py
T
Ishaan Jaff 3c984ed60e (feat) Add Azure Blob Storage Logging Integration (#7265)
* add path to http handler

* AzureBlobStorageLogger

* test_azure_blob_storage

* use constants for Azure storage

* use helper get_azure_ad_token_from_entrata_id

* azure blob storage support

* get_azure_ad_token_from_azure_storage

* fix import

* azure logging

* docs azure storage

* add docs on azure blobs

* add premium user check

* add azure_storage  as identified logging callback

* async_upload_payload_to_azure_blob_storage

* docs azure storage

* callback_class_str_to_classType
2024-12-16 22:18:22 -08:00

46 lines
1.0 KiB
Python

import io
import os
import sys
sys.path.insert(0, os.path.abspath("../.."))
import asyncio
import gzip
import json
import logging
import time
from unittest.mock import AsyncMock, patch
import pytest
import litellm
from litellm import completion
from litellm._logging import verbose_logger
from litellm.integrations.datadog.datadog import *
from datetime import datetime, timedelta
from litellm.types.utils import (
StandardLoggingPayload,
StandardLoggingModelInformation,
StandardLoggingMetadata,
StandardLoggingHiddenParams,
)
from litellm.integrations.azure_storage.azure_storage import AzureBlobStorageLogger
verbose_logger.setLevel(logging.DEBUG)
@pytest.mark.asyncio
async def test_azure_blob_storage():
azure_storage_logger = AzureBlobStorageLogger(flush_interval=1)
litellm.callbacks = [azure_storage_logger]
response = await litellm.acompletion(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello, world!"}],
)
print(response)
await asyncio.sleep(3)
pass