-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for OpenAI o1 #4128
Comments
Actually, it looks like the above error comes from the OpenAI API itself. According to https://platform.openai.com/docs/guides/reasoning#limitations
Edit: o1-preview supports streaming, but it looks like o1 doesn't support it yet |
Released in |
Hi @lgrammel Thank you so much for quickly adding support for o1! I took a look at the changes, it looks like "developer" messages are not yet supported for o1. According to https://platform.openai.com/docs/guides/reasoning
|
You don't need them, OpenAI will translate system messages accordingly (it's just a rename) |
I see, thanks for the explanation! |
We are still seeing errors with o1-preview and using
|
o1-preview doesn't support system messages, but o1 does (though I haven't tried it myself yet, as o1 doesn't support streaming yet) |
Planning to automatically convert system messages to developer messages for openai reasoning models |
@lgrammel the default behavior that is currently shipped removes the system messages silently. I'm not even seeing any warnings when this happens. I've checked the result object and it's undefined. I'm using ai/packages/openai/src/openai-chat-language-model.ts Lines 955 to 972 in 0118fa7
Versions I'm running
Certainly the default should not be to drop system messages silently. I feel like this should throw an error with how unexpected this behavior is. OpenRouter seems to be silently converting system messages to developer messages, which feels like another option. |
a) o1-mini and o1-preview rejected both developer messages and system messages when I last check; therefore stripping is required |
I tried a few raw requests to OpenAI and you're absolutely right that they are currently erroring on
I feel the default behavior of the AI SDK to drop system messages is dangerous and unexpected (even if warnings are returned). Possible Fixesa) Convert system messages to user or assistant messages (this feels like it could create a lot of downstream issues, but would at least retain some instruction to the LLM) |
Feature Description
OpenAI has just released o1-2024-12-17. See https://platform.openai.com/docs/models/gpt-4o#o1
I tried to use
o1-2024-12-17
with streamText, but ran into the following error:Note: according to https://platform.openai.com/docs/guides/reasoning, o1 supports "developer messages" (whereas o1-preview didn't support system messages):
Use Cases
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: