diff --git a/pr_agent/algo/ai_handlers/litellm_ai_handler.py b/pr_agent/algo/ai_handlers/litellm_ai_handler.py index 12bdb4f7a..3127849e8 100644 --- a/pr_agent/algo/ai_handlers/litellm_ai_handler.py +++ b/pr_agent/algo/ai_handlers/litellm_ai_handler.py @@ -188,7 +188,8 @@ async def chat_completion(self, model: str, system: str, user: str, temperature: # Currently O1 does not support separate system and user prompts O1_MODEL_PREFIX = 'o1-' - if model.startswith(O1_MODEL_PREFIX): + model_type = model.split('/')[-1] # 'azure/o1-' or 'o1-' + if model_type.startswith(O1_MODEL_PREFIX): user = f"{system}\n\n\n{user}" system = "" get_logger().info(f"Using O1 model, combining system and user prompts")