add testing for spend logs payload

This commit is contained in:
Ishaan Jaff 2024-11-21 21:27:19 -08:00
parent 43d483db5b
commit 46d5aae2ae
2 changed files with 6 additions and 0 deletions

View file

@ -118,6 +118,8 @@ class AnthropicPassthroughLoggingHandler:
# set litellm_call_id to logging response object
litellm_model_response.id = logging_obj.litellm_call_id
litellm_model_response.model = model
logging_obj.model_call_details["model"] = model
return kwargs
@staticmethod

View file

@ -150,6 +150,8 @@ async def test_anthropic_basic_completion_with_headers():
"user_api_key" in log_entry["metadata"]
), "Should have user API key in metadata"
assert "claude" in log_entry["model"]
@pytest.mark.asyncio
async def test_anthropic_streaming_with_headers():
@ -257,3 +259,5 @@ async def test_anthropic_streaming_with_headers():
assert (
"user_api_key" in log_entry["metadata"]
), "Should have user API key in metadata"
assert "claude" in log_entry["model"]