The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test_async_embedding_azure_caching
Ishaan Jaffer3a8e4f31600f
diff --git a/tests/logging_callback_tests/test_custom_callback_router.py b/tests/logging_callback_tests/test_custom_callback_router.pyindex 5948fb6a2e5..1e3f5f4cfb9 100644--- a/tests/logging_callback_tests/test_custom_callback_router.py+++ b/tests/logging_callback_tests/test_custom_callback_router.py@@ -725,16 +725,22 @@ async def test_async_embedding_azure_caching():port=os.environ["REDIS_PORT"],password=os.environ["REDIS_PASSWORD"],)+ router = Router(model_list=[{+ "model_name": "text-embedding-ada-002",+ "litellm_params": {+ "model": "openai/text-embedding-ada-002",+ },+ }])litellm.callbacks = [customHandler_caching]unique_time = time.time()- response1 = await litellm.aembedding(- model="azure/text-embedding-ada-002",+ response1 = await router.aembedding(+ model="text-embedding-ada-002",input=[f"good morning from litellm1 {unique_time}"],caching=True,)await asyncio.sleep(1) # set cache is async for aembedding()- response2 = await litellm.aembedding(- model="azure/text-embedding-ada-002",+ response2 = await router.aembedding(+ model="text-embedding-ada-002",input=[f"good morning from litellm1 {unique_time}"],caching=True,)