Error: not support 'developer' role on o1-preview and o1-mini models

Hi, I’m encountering the below error when using models o1-preview and o1-mini.

■ Error Message:
openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: “Unsupported value: ‘messages[0].role’ does not support ‘developer’ with this model.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages[0].role’, ‘code’: ‘unsupported_value’}}

=======

Based on the following post, this is caused by Streamlit.
[Bug]: openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: “Unsupported value: ‘messages[0].role’ does not support ‘developer’ with this model.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages[0].role’, ‘code’: ‘unsupported_value’}} · Issue #17395 · run-llama/llama_index

I hope this will be resolved soon.

■ Libraries versions:
altair==5.4.0
annotated-types==0.7.0
anyio==4.4.0
appnope==0.1.4
asttokens==2.4.1
attrs==24.2.0
blinker==1.8.2
cachetools==5.5.0
certifi==2024.7.4
charset-normalizer==3.3.2
click==8.1.7
comm==0.2.2
debugpy==1.8.5
decorator==5.1.1
distro==1.9.0
executing==2.0.1
gitdb==4.0.11
gitpython==3.1.43
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
ipykernel==6.29.5
ipython==8.26.0
jedi==0.19.1
jinja2==3.1.4
jiter==0.5.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter-client==8.6.2
jupyter-core==5.7.2
markdown-it-py==3.0.0
markupsafe==2.1.5
matplotlib-inline==0.1.7
mdurl==0.1.2
narwhals==1.4.2
nest-asyncio==1.6.0
notion-client==2.3.0
numpy==2.1.0
openai==1.59.7
packaging==24.1
pandas==2.2.2
parso==0.8.4
pexpect==4.9.0
pillow==10.4.0
platformdirs==4.2.2
prompt-toolkit==3.0.47
protobuf==5.27.3
psutil==6.0.0
ptyprocess==0.7.0
pure-eval==0.2.3
pyarrow==17.0.0
pyasn1==0.6.1
pyasn1-modules==0.4.1
pydantic==2.8.2
pydantic-core==2.20.1
pydeck==0.9.1
pygments==2.18.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.1
pyzmq==26.1.1
referencing==0.35.1
requests==2.32.3
rich==13.7.1
rpds-py==0.20.0
-e file:///Users/atsuya/Documents/seeder_openai_notion_post
six==1.16.0
smmap==5.0.1
sniffio==1.3.1
stack-data==0.6.3
streamlit==1.41.1
tenacity==8.5.0
toml==0.10.2
tornado==6.4.1
tqdm==4.66.5
traitlets==5.14.3
typing-extensions==4.12.2
tzdata==2024.1
urllib3==2.2.2
wcwidth==0.2.13

Sorry, omitting {“role”: “developer” … } part resolved this issue! These model do not get system or developer role, but only use a user role.

And this problem does not caused by Streamlit side, this comes from openai itself! sorry.

1 Like