feat - async_post_call_streaming_hook

This commit is contained in:
Ishaan Jaff 2024-05-23 09:30:53 -07:00
parent b20252b171
commit 56c2d63d1f
4 changed files with 92 additions and 9 deletions

View file

@ -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"