(fix) proxy: custom callbacks

This commit is contained in:
ishaan-jaff 2023-12-04 11:29:26 -08:00
parent c5b92837c2
commit 4ef0378e6e

View file

@ -564,7 +564,6 @@ def load_router_config(router: Optional[litellm.Router], config_file_path: str):
) )
elif key == "callbacks": elif key == "callbacks":
print(f"{blue_color_code}\nSetting custom callbacks on Proxy") print(f"{blue_color_code}\nSetting custom callbacks on Proxy")
print()
passed_module, instance_name = value.split(".") passed_module, instance_name = value.split(".")
# Dynamically import the module # Dynamically import the module
@ -574,11 +573,12 @@ def load_router_config(router: Optional[litellm.Router], config_file_path: str):
methods = [method for method in dir(instance) if callable(getattr(instance, method))] methods = [method for method in dir(instance) if callable(getattr(instance, method))]
# Print the methods # Print the methods
print("Methods in the instance:") print("Methods in the custom callbacks instance:")
for method in methods: for method in methods:
print(method) print(method)
litellm.callbacks = [instance] litellm.callbacks = [instance]
print()
else: else:
setattr(litellm, key, value) setattr(litellm, key, value)