mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
Add datadog health check support + fix bedrock converse cost tracking w/ region name specified (#7958)
* fix(bedrock/converse_handler.py): fix bedrock region name on async calls * fix(utils.py): fix split model handling Fixes bedrock cost calculation when region name is given * feat(_health_endpoints.py): support health checking datadog integration Closes https://github.com/BerriAI/litellm/issues/7921
This commit is contained in:
parent
c0e83ab377
commit
fe460f19f5
13 changed files with 254 additions and 33 deletions
|
@ -539,17 +539,19 @@ class BaseLLMChatTest(ABC):
|
|||
|
||||
return url
|
||||
|
||||
def test_completion_cost(self):
|
||||
@pytest.mark.asyncio
|
||||
async def test_completion_cost(self):
|
||||
from litellm import completion_cost
|
||||
|
||||
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
|
||||
litellm.model_cost = litellm.get_model_cost_map(url="")
|
||||
|
||||
litellm.set_verbose = True
|
||||
response = self.completion_function(
|
||||
response = await self.async_completion_function(
|
||||
**self.get_base_completion_call_args(),
|
||||
messages=[{"role": "user", "content": "Hello, how are you?"}],
|
||||
)
|
||||
print(response._hidden_params)
|
||||
cost = completion_cost(response)
|
||||
|
||||
assert cost > 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue