"detail": "Invalid input. Please specify the prompt."
if not messages or messages[-1].get("role") not in ["user", "system", "tool"]:
raise HTTPException(
status_code=400, detail="Invalid input. Please specify the prompt."
)https://openi.pcl.ac.cn/o3sky/inference/src/tag/v0.11.2.post1/xinference/api/restful_api.py:1281
我方法是:
if len(messages)>2:
messages[-1]['role']='system'