handle vertex pass through separately

This commit is contained in:
Ishaan Jaff 2024-11-22 13:18:08 -08:00
parent dcab2d0c6f
commit e829b228b2

View file

@ -40,8 +40,12 @@ async def chunk_processor(
- Yields chunks from the response
- Collect non-empty chunks for post-processing (logging)
"""
collected_chunks: List[str] = [] # List to store all chunks
try:
if endpoint_type == EndpointType.VERTEX_AI:
async for chunk in response.aiter_bytes():
yield chunk
else:
collected_chunks: List[str] = [] # List to store all chunks
async for chunk in response.aiter_lines():
verbose_proxy_logger.debug(f"Processing chunk: {chunk}")
if not chunk: