langchain icon indicating copy to clipboard operation
langchain copied to clipboard

openai[patch]: update system role to developer for o-series models

Open ccurme opened this issue 1 week ago • 1 comments

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).

ccurme avatar Feb 13 '25 18:02 ccurme