Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct model type extraction for O1 model handling #1295

Merged
merged 2 commits into from
Oct 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pr_agent/algo/ai_handlers/litellm_ai_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
mrT23 marked this conversation as resolved.
Show resolved Hide resolved
user = f"{system}\n\n\n{user}"
system = ""
get_logger().info(f"Using O1 model, combining system and user prompts")
Expand Down
Loading