Support post-call guards for stream and non-stream responses

This commit is contained in:
Tomer Bin 2025-01-26 12:28:22 +02:00
parent be35c9a663
commit 4a31b32a88
8 changed files with 297 additions and 33 deletions

View file

@ -251,6 +251,15 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac
) -> Any:
pass
async def async_post_call_streaming_iterator_hook(
self,
user_api_key_dict: UserAPIKeyAuth,
response: Any,
request_data: dict,
) -> Any:
async for item in response:
yield item
#### SINGLE-USE #### - https://docs.litellm.ai/docs/observability/custom_callback#using-your-custom-callback-function
def log_input_event(self, model, messages, kwargs, print_verbose, callback_func):