mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
feat - async_post_call_streaming_hook
This commit is contained in:
parent
b20252b171
commit
56c2d63d1f
4 changed files with 92 additions and 9 deletions
|
@ -3390,6 +3390,12 @@ async def async_data_generator(
|
|||
try:
|
||||
start_time = time.time()
|
||||
async for chunk in response:
|
||||
|
||||
### CALL HOOKS ### - modify outgoing data
|
||||
chunk = await proxy_logging_obj.async_post_call_streaming_hook(
|
||||
user_api_key_dict=user_api_key_dict, response=chunk
|
||||
)
|
||||
|
||||
chunk = chunk.model_dump_json(exclude_none=True)
|
||||
try:
|
||||
yield f"data: {chunk}\n\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue