mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
(test) custom logger
This commit is contained in:
parent
e23700dd19
commit
5fc61f6d7a
1 changed files with 13 additions and 1 deletions
|
|
@ -62,8 +62,12 @@ def test_embedding(client):
|
|||
print(litellm.callbacks)
|
||||
|
||||
# assert len(litellm.callbacks) == 1 # assert litellm is initialized with 1 callback
|
||||
|
||||
|
||||
my_custom_logger = litellm.callbacks[0]
|
||||
for callback in litellm.callbacks:
|
||||
if "MyCustomHandler" in str(callback):
|
||||
my_custom_logger = callback
|
||||
break
|
||||
assert my_custom_logger.async_success_embedding == False
|
||||
|
||||
test_data = {
|
||||
|
|
@ -101,6 +105,10 @@ def test_chat_completion(client):
|
|||
|
||||
# assert len(litellm.callbacks) == 1 # assert litellm is initialized with 1 callback
|
||||
my_custom_logger = litellm.callbacks[0]
|
||||
for callback in litellm.callbacks:
|
||||
if "MyCustomHandler" in str(callback):
|
||||
my_custom_logger = callback
|
||||
break
|
||||
assert my_custom_logger.async_success == False
|
||||
|
||||
test_data = {
|
||||
|
|
@ -148,6 +156,10 @@ def test_chat_completion_stream(client):
|
|||
|
||||
# assert len(litellm.callbacks) == 1 # assert litellm is initialized with 1 callback
|
||||
my_custom_logger = litellm.callbacks[0]
|
||||
for callback in litellm.callbacks:
|
||||
if "MyCustomHandler" in str(callback):
|
||||
my_custom_logger = callback
|
||||
break
|
||||
|
||||
assert my_custom_logger.streaming_response_obj == None # no streaming response obj is set pre call
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue