Combining system and user prompts for o1 series and deepseek-reasoner models

This commit is contained in:
Trung Dinh
2025-01-22 20:33:43 +07:00
parent 63f1d449ce
commit c2ca79da0d

View File

@ -200,10 +200,10 @@ class LiteLLMAIHandler(BaseAiHandler):
# Currently, model OpenAI o1 series does not support a separate system and user prompts
O1_MODEL_PREFIX = 'o1'
model_type = model.split('/')[-1] if '/' in model else model
if model_type.startswith(O1_MODEL_PREFIX):
if (model_type.startswith(O1_MODEL_PREFIX)) or ("deepseek-reasoner" in model):
user = f"{system}\n\n\n{user}"
system = ""
get_logger().info(f"Using O1 model, combining system and user prompts")
get_logger().info(f"Using model {model}, combining system and user prompts")
messages = [{"role": "user", "content": user}]
kwargs = {
"model": model,