Skip to content

openai 使用gpt-4.5-preview模型异常 #7167

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

Closed
ahuai opened this issue Mar 26, 2025 · 6 comments
Closed

openai 使用gpt-4.5-preview模型异常 #7167

ahuai opened this issue Mar 26, 2025 · 6 comments
Labels
🐛 Bug Something isn't working | 缺陷 unconfirm 未被维护者确认的问题

Comments

@ahuai
Copy link

ahuai commented Mar 26, 2025

📦 Platform

Other

📦 Deploymenet mode

client db (lobe-chat image)

📌 Version

1.75.2

💻 Operating System

Windows

🌐 Browser

Chrome

🐛 Bug Description

我通过拉取最新1.75.2本地启动项目 使用openai 的模型gpt-4.5-preview时发现请求异常 其他模型都正常
通过排查发现 请在请求webapi/chat/openai接口是 前端携带的参数model: "gpt-4.5-preview " 多了个空格 如图所示
导致请求返回"message": "invalid model ID"
Image

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

@ahuai ahuai added the unconfirm 未被维护者确认的问题 label Mar 26, 2025
@lobehubbot
Copy link
Member

👀 @ahuai

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@dosubot dosubot bot added the 🐛 Bug Something isn't working | 缺陷 label Mar 26, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Mar 26, 2025
Copy link

dosubot bot commented Mar 26, 2025

The issue you're encountering is due to an extra space in the model ID "gpt-4.5-preview " when making the OpenAI API request. This extra space causes the API to return an "invalid model ID" error.

To resolve this, ensure that the model ID is correctly formatted without any trailing spaces before making the request. You can check the part of the code where the model ID is set or modified, which is in the src/config/aiModels/openai.ts file. Make sure that the model ID is correctly specified as 'gpt-4.5-preview' without any spaces [1].

Additionally, you might want to review any part of the code that constructs the request payload to ensure no spaces are inadvertently added. The payload is constructed in the handlePayload function within the chatCompletion object, and there should be no logic that adds spaces to the model ID [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@ahuai
Copy link
Author

ahuai commented Mar 26, 2025

另外模型列表里 gpt-4.5-preview不知道为什么红框内会缺失视觉识别、函数调用、会话token数的小图标
我的启动命令如下
set ENABLED_OLLAMA=0 && set OPENAI_MODEL_LIST=-all,+o1-mini,+gpt-4o-mini,+gpt-4o,+gpt-4-turbo,+gpt-4.5-preview && set DEEPSEEK_API_KEY=xxx && set DEEPSEEK_PROXY_URL=xxx && pnpm run dev

Image

@arvinxx
Copy link
Contributor

arvinxx commented Apr 7, 2025

set OPENAI_MODEL_LIST=-all,+o1-mini,+gpt-4o-mini,+gpt-4o,+gpt-4-turbo,+gpt-4.5-preview && 应该是你的这个多了个空格导致的

@arvinxx arvinxx closed this as completed Apr 7, 2025
@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Apr 7, 2025
@lobehubbot
Copy link
Member

@ahuai

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


set OPENAI_MODEL_LIST=-all,+o1-mini,+gpt-4o-mini,+gpt-4o,+gpt-4-turbo,+gpt-4.5-preview && It should be caused by the extra space in yours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 unconfirm 未被维护者确认的问题
Projects
Status: Done
Development

No branches or pull requests

3 participants