fix checking if _known_custom_logger_compatible_callbacks

This commit is contained in:
Ishaan Jaff 2024-07-22 15:43:43 -07:00
parent d8d08a1ba3
commit 15c109f023
2 changed files with 7 additions and 7 deletions

View file

@ -158,6 +158,7 @@ from typing import (
Tuple,
Union,
cast,
get_args,
)
from .caching import Cache
@ -405,7 +406,6 @@ def function_setup(
# Pop the async items from input_callback in reverse order to avoid index issues
for index in reversed(removed_async_items):
litellm.input_callback.pop(index)
if len(litellm.success_callback) > 0:
removed_async_items = []
for index, callback in enumerate(litellm.success_callback): # type: ignore
@ -417,9 +417,9 @@ def function_setup(
# we only support async dynamo db logging for acompletion/aembedding since that's used on proxy
litellm._async_success_callback.append(callback)
removed_async_items.append(index)
elif callback == "langsmith":
elif callback in litellm._known_custom_logger_compatible_callbacks:
callback_class = litellm.litellm_core_utils.litellm_logging._init_custom_logger_compatible_class( # type: ignore
callback, internal_usage_cache=None, llm_router=None
callback, internal_usage_cache=None, llm_router=None # type: ignore
)
# don't double add a callback