langchain
langchain copied to clipboard
openai[patch]: update system role to developer for o-series models
Some o-series models will raise a 400 error for "role": "system"
(o1-mini
and o1-preview
will raise, o1
and o3-mini
will not).
Here we update ChatOpenAI
to update the role to "developer"
for all model names matching ^o\d
.
We only make this change on the ChatOpenAI class (not BaseChatOpenAI).