mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-17 22:48:35 +00:00
3c984ed60e
* 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
46 lines
1.0 KiB
Python
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
|