mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(cost_calculator.py): fix cost calc
This commit is contained in:
parent
89e3141e2d
commit
ef8fb23334
2 changed files with 22 additions and 8 deletions
|
@ -1,11 +1,17 @@
|
|||
### What this tests ####
|
||||
import sys, os, time, inspect, asyncio, traceback
|
||||
import asyncio
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, os.path.abspath("../.."))
|
||||
|
||||
from litellm import completion, embedding
|
||||
import litellm
|
||||
from litellm import completion, embedding
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
|
||||
|
||||
|
@ -201,7 +207,7 @@ def test_async_custom_handler_stream():
|
|||
print("complete_streaming_response: ", complete_streaming_response)
|
||||
assert response_in_success_handler == complete_streaming_response
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
pytest.fail(f"Error occurred: {e}\n{traceback.format_exc()}")
|
||||
|
||||
|
||||
# test_async_custom_handler_stream()
|
||||
|
@ -457,11 +463,11 @@ async def test_cost_tracking_with_caching():
|
|||
|
||||
|
||||
def test_redis_cache_completion_stream():
|
||||
from litellm import Cache
|
||||
|
||||
# Important Test - This tests if we can add to streaming cache, when custom callbacks are set
|
||||
import random
|
||||
|
||||
from litellm import Cache
|
||||
|
||||
try:
|
||||
print("\nrunning test_redis_cache_completion_stream")
|
||||
litellm.set_verbose = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue