mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
(fix) allow using more than 1 custom callback
This commit is contained in:
parent
a48a8bf4b6
commit
de3005ee9e
1 changed files with 4 additions and 1 deletions
|
@ -333,6 +333,7 @@ class Logging:
|
||||||
messages=self.messages,
|
messages=self.messages,
|
||||||
kwargs=self.model_call_details,
|
kwargs=self.model_call_details,
|
||||||
print_verbose=print_verbose,
|
print_verbose=print_verbose,
|
||||||
|
callback_func=callback
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
@ -544,6 +545,7 @@ class Logging:
|
||||||
start_time=start_time,
|
start_time=start_time,
|
||||||
end_time=end_time,
|
end_time=end_time,
|
||||||
print_verbose=print_verbose,
|
print_verbose=print_verbose,
|
||||||
|
callback_func=callback
|
||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -617,6 +619,7 @@ class Logging:
|
||||||
start_time=start_time,
|
start_time=start_time,
|
||||||
end_time=end_time,
|
end_time=end_time,
|
||||||
print_verbose=print_verbose,
|
print_verbose=print_verbose,
|
||||||
|
callback_func=callback
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print_verbose(
|
print_verbose(
|
||||||
|
@ -2052,7 +2055,7 @@ def set_callbacks(callback_list, function_id=None):
|
||||||
else:
|
else:
|
||||||
liteDebuggerClient = LiteDebugger(email=str(uuid.uuid4()))
|
liteDebuggerClient = LiteDebugger(email=str(uuid.uuid4()))
|
||||||
elif callable(callback):
|
elif callable(callback):
|
||||||
customLogger = CustomLogger(callback_func=callback)
|
customLogger = CustomLogger()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue