diff --git a/pr_agent/algo/ai_handlers/litellm_ai_handler.py b/pr_agent/algo/ai_handlers/litellm_ai_handler.py index e7561152..c8b620fe 100644 --- a/pr_agent/algo/ai_handlers/litellm_ai_handler.py +++ b/pr_agent/algo/ai_handlers/litellm_ai_handler.py @@ -106,6 +106,10 @@ class LiteLLMAIHandler(BaseAiHandler): deployment_id = self.deployment_id if self.azure: model = 'azure/' + model + if 'claude' in model and not system: + system = "\n" + get_logger().warning( + "Empty system prompt for claude model. Adding a newline character to prevent OpenAI API error.") messages = [{"role": "system", "content": system}, {"role": "user", "content": user}] if img_path: try: diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index bcf6afca..bb648060 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -147,7 +147,7 @@ def convert_to_markdown_v2(output_data: dict, else: markdown_text += f"### {emoji} {key_nice}: {value}\n\n" elif 'relevant tests' in key_nice.lower(): - value = value.strip().lower() + value = str(value).strip().lower() if gfm_supported: markdown_text += f"