-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[Bug] 调用OpenAI o1-preview模型的API接口提示 'frequency_penalty' is not supported with this model.", #5053
Comments
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Hey @734908350! 👋 I'm here to help you with bug fixes, answer questions, and even guide you on how to become a contributor. Let's squash this bug together! To resolve the error "frequency_penalty is not supported with this model" when calling the OpenAI o1-preview model API, ensure that the export const pruneO1Payload = (payload: ChatStreamPayload) => ({
...payload,
frequency_penalty: 0, // Ensure this is set to 0
messages: payload.messages.map((message: OpenAIChatMessage) => ({
...message,
role: message.role === 'system' ? 'user' : message.role,
})),
presence_penalty: 0,
temperature: 1,
top_p: 1,
}); Make sure that this function is applied to your payload before making the API call. Additionally, ensure that the if (o1Models.has(model)) {
return pruneO1Payload(payload) as any;
} This should prevent the error by ensuring that the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
This issue is closed, If you have any questions, you can comment and reply. |
📦 Environment
Docker
📌 Version
1.0
💻 Operating System
macOS
🌐 Browser
Chrome
🐛 Bug Description
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response
The text was updated successfully, but these errors were encountered: