From 8c7680d85ddef4bf77620acd0c77a2d373ce243e Mon Sep 17 00:00:00 2001 From: Makonike Date: Sun, 13 Jul 2025 22:57:43 +0800 Subject: [PATCH] refactor(ai_handler): add a return statement or raise an exception in the elif branch --- pr_agent/algo/ai_handlers/litellm_ai_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/algo/ai_handlers/litellm_ai_handler.py b/pr_agent/algo/ai_handlers/litellm_ai_handler.py index 380a7893..ad9747be 100644 --- a/pr_agent/algo/ai_handlers/litellm_ai_handler.py +++ b/pr_agent/algo/ai_handlers/litellm_ai_handler.py @@ -447,7 +447,7 @@ class LiteLLMAIHandler(BaseAiHandler): raise openai.APIError("Empty streaming response received without proper completion") elif not full_response and finish_reason: get_logger().debug(f"Streaming response resulted in empty content but completed with finish_reason: {finish_reason}") - + raise openai.APIError(f"Streaming response completed with finish_reason '{finish_reason}' but no content received") return full_response, finish_reason async def _get_completion(self, model, **kwargs):