anthropic prompt caching cost tracking (#5453)

* fix(utils.py): support 'drop_params' for embedding requests

Fixes https://github.com/BerriAI/litellm/issues/5444

* feat(anthropic/cost_calculation.py): Support calculating cost for prompt caching on anthropic

* feat(types/utils.py): allows us to migrate to openai's equivalent, once that comes out

* fix: fix linting errors

* test: mark flaky test
This commit is contained in:
Krish Dholakia 2024-08-31 14:09:35 -07:00 committed by Ishaan Jaff
parent de9efe76ca
commit 47ef1f9191
17 changed files with 432 additions and 84 deletions

View file

@ -77,13 +77,10 @@ from .caching import disable_cache, enable_cache, update_cache
from .llms import (
ai21,
aleph_alpha,
anthropic_text,
baseten,
bedrock,
clarifai,
cloudflare,
gemini,
huggingface_restapi,
maritalk,
nlp_cloud,
ollama,
@ -93,13 +90,10 @@ from .llms import (
palm,
petals,
replicate,
together_ai,
triton,
vllm,
watsonx,
)
from .llms.anthropic import AnthropicChatCompletion
from .llms.anthropic_text import AnthropicTextCompletion
from .llms.anthropic.chat import AnthropicChatCompletion
from .llms.anthropic.completion import AnthropicTextCompletion
from .llms.azure import AzureChatCompletion, _check_dynamic_azure_params
from .llms.azure_text import AzureTextCompletion
from .llms.bedrock_httpx import BedrockConverseLLM, BedrockLLM