yym68686 commited on
Commit
aea01d0
·
1 Parent(s): 1126d73

🐛 Bug: Fix the bug where the system prompt is not deleted in the o1-mini model message.

Browse files
Files changed (1) hide show
  1. request.py +2 -2
request.py CHANGED
@@ -757,11 +757,11 @@ async def get_o1_payload(request, engine, provider):
757
  else:
758
  content = msg.content
759
 
760
- if isinstance(content, list):
761
  for item in content:
762
  if item["type"] == "text":
763
  messages.append({"role": msg.role, "content": item["text"]})
764
- else:
765
  messages.append({"role": msg.role, "content": content})
766
 
767
  model = provider['model'][request.model]
 
757
  else:
758
  content = msg.content
759
 
760
+ if isinstance(content, list) and msg.role != "system":
761
  for item in content:
762
  if item["type"] == "text":
763
  messages.append({"role": msg.role, "content": item["text"]})
764
+ elif msg.role != "system":
765
  messages.append({"role": msg.role, "content": content})
766
 
767
  model = provider['model'][request.model]