From eb4452df5fd86617f326d1ff006b1a2d1d99cde2 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Sat, 21 Dec 2024 06:37:00 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Support=20for=20o1,=20o1-2024-12-17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pr_agent/algo/__init__.py | 2 ++ pr_agent/algo/ai_handlers/litellm_ai_handler.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pr_agent/algo/__init__.py b/pr_agent/algo/__init__.py index 20e463c37..9ab84c3f7 100644 --- a/pr_agent/algo/__init__.py +++ b/pr_agent/algo/__init__.py @@ -24,6 +24,8 @@ 'o1-mini-2024-09-12': 128000, # 128K, but may be limited by config.max_model_tokens 'o1-preview': 128000, # 128K, but may be limited by config.max_model_tokens 'o1-preview-2024-09-12': 128000, # 128K, but may be limited by config.max_model_tokens + 'o1': 200000, # 200K, but may be limited by config.max_model_tokens + 'o1-2024-12-17': 200000, # 200K, but may be limited by config.max_model_tokens 'claude-instant-1': 100000, 'claude-2': 100000, 'command-nightly': 4096, diff --git a/pr_agent/algo/ai_handlers/litellm_ai_handler.py b/pr_agent/algo/ai_handlers/litellm_ai_handler.py index c53c1ec3d..8f18a00af 100644 --- a/pr_agent/algo/ai_handlers/litellm_ai_handler.py +++ b/pr_agent/algo/ai_handlers/litellm_ai_handler.py @@ -194,7 +194,7 @@ async def chat_completion(self, model: str, system: str, user: str, temperature: {"type": "image_url", "image_url": {"url": img_path}}] # Currently O1 does not support separate system and user prompts - O1_MODEL_PREFIX = 'o1-' + O1_MODEL_PREFIX = 'o1' model_type = model.split('/')[-1] if '/' in model else model if model_type.startswith(O1_MODEL_PREFIX): user = f"{system}\n\n\n{user}"