feat: add validation for empty streaming responses in LiteLLM handler

This commit is contained in:
Makonike
2025-07-09 15:04:18 +08:00
parent 5e82d0a316
commit 2d8bee0d6d

View File

@ -436,4 +436,8 @@ class LiteLLMAIHandler(BaseAiHandler):
get_logger().error(f"Error handling streaming response: {e}") get_logger().error(f"Error handling streaming response: {e}")
raise raise
if not full_response:
get_logger().warning("Streaming response resulted in empty content")
raise openai.APIError("Empty streaming response received")
return full_response, finish_reason return full_response, finish_reason