Skip to content

Commit

Permalink
fix(proxy_server.py): fix setting offset-aware datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed Apr 26, 2024
1 parent 1bb82ef commit 5583197
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion litellm/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3668,7 +3668,7 @@ async def chat_completion(
logging_obj, data = litellm.utils.function_setup(
original_function="acompletion",
rules_obj=litellm.utils.Rules(),
start_time=litellm.utils.get_utc_datetime(),
start_time=datetime.now(),
**data,
)

Expand Down
4 changes: 3 additions & 1 deletion tests/test_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ async def test_key_info_spend_values_streaming():
)
rounded_response_cost = round(response_cost, 8)
rounded_key_info_spend = round(key_info["info"]["spend"], 8)
assert rounded_response_cost == rounded_key_info_spend
assert (
rounded_response_cost == rounded_key_info_spend
), f"Expected={rounded_response_cost}, Got={rounded_key_info_spend}"


@pytest.mark.asyncio
Expand Down

0 comments on commit 5583197

Please sign in to comment.