(test) setting model in SpendTable logs

This commit is contained in:
ishaan-jaff 2024-01-24 11:09:20 -08:00
parent 5e8a6fd80e
commit a842e6520c
2 changed files with 6 additions and 0 deletions

View file

@ -892,6 +892,10 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time):
from pydantic import Json from pydantic import Json
import uuid import uuid
verbose_proxy_logger.debug(
f"SpendTable: get_logging_payload - kwargs: {kwargs}\n\n"
)
if kwargs == None: if kwargs == None:
kwargs = {} kwargs = {}
# standardize this function to be used across, s3, dynamoDB, langfuse logging # standardize this function to be used across, s3, dynamoDB, langfuse logging

View file

@ -735,6 +735,7 @@ def test_call_with_key_over_budget(prisma_client):
) )
await track_cost_callback( await track_cost_callback(
kwargs={ kwargs={
"model": "chatgpt-v-2",
"stream": False, "stream": False,
"litellm_params": { "litellm_params": {
"metadata": { "metadata": {
@ -759,6 +760,7 @@ def test_call_with_key_over_budget(prisma_client):
assert spend_log.request_id == request_id assert spend_log.request_id == request_id
assert spend_log.spend == float("2e-05") assert spend_log.spend == float("2e-05")
assert spend_log.model == "chatgpt-v-2"
# use generated key to auth in # use generated key to auth in
result = await user_api_key_auth(request=request, api_key=bearer_token) result = await user_api_key_auth(request=request, api_key=bearer_token)