Skip to content
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] 使用Azure模型,不可以调用插件。 #2541

Closed
silvonli opened this issue May 17, 2024 · 7 comments · Fixed by #3046
Closed

[Bug] 使用Azure模型,不可以调用插件。 #2541

silvonli opened this issue May 17, 2024 · 7 comments · Fixed by #3046
Labels
🐛 Bug Something isn't working | 缺陷 released

Comments

@silvonli
Copy link

silvonli commented May 17, 2024

💻 系统环境

macOS

📦 部署环境

Vercel / Zeabur / Sealos

🌐 浏览器

Chrome

🐛 问题描述

在设置 Azure openAI 模型后,可以正常聊天,但如果使用插件,则回复内容为空。

在 Vercel 上查看日志,发现“/api/chat/openai”请求报错,提示 API key 不正确。

我没有开通openAI官方API,所以只在设置中开启了Azure模型,为什么会提示openAI API key不正确?

/api/chat/openai 报错信息:

Route: [openai] NoOpenAIAPIKey:  Error: 401 Incorrect API key provided: 16ed9055********************5c76. You can find your API key at https://platform.openai.com/account/api-keys.
    at (node_modules/openai/error.mjs:44:0)
    at (node_modules/openai/core.mjs:256:23)
    at (node_modules/openai/core.mjs:299:0)
    at (src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts:82:25)
    at (src/app/api/chat/[provider]/route.ts:38:11)
    at (node_modules/next/dist/esm/server/future/route-modules/app-route/module.js:207:0)
    at (node_modules/next/dist/esm/server/future/route-modules/app-route/module.js:122:0)
    at (node_modules/next/dist/esm/server/future/route-modules/app-route/module.js:269:0)
    at (node_modules/next/dist/esm/server/web/edge-route-module-wrapper.js:81:0)
    at (node_modules/next/dist/esm/server/web/adapter.js?9fa3:158:0) {
  status: 401,
  headers: {
  connection: 'keep-alive',
  content-length: '282',
  content-type: 'application/json; charset=utf-8',
  date: 'Fri, 17 May 2024 02:41:42 GMT',
  set-cookie: '_cfuvid=I8qBt8Yf.vKjFeaTAGw1CMGdSOf4gBb5Zww2Hzyx.pw-1715913702785-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None',
  strict-transport-security: 'max-age=15724800; includeSubDomains',
  vary: 'Origin',
  x-request-id: 'req_098596ece612a9895f0b1b18fecbbec0'
},
  request_id: 'req_098596ece612a9895f0b1b18fecbbec0',
  error: {
  message: 'Incorrect API key provided: 16ed9055********************5c76. You can find your API key at https://platform.openai.com/account/api-keys.',
  type: 'invalid_request_error',
  param: null,
  code: 'invalid_api_key'
},
  code: 'invalid_api_key',
  param: null,
  type: 'invalid_request_error'
}

🚦 期望结果

希望 Azure openAI 模型可以正常使用插件。

📷 复现步骤

截屏2024-05-17 12 07 37

📝 补充信息

版本号:v0.159.12

@silvonli silvonli added the 🐛 Bug Something isn't working | 缺陷 label May 17, 2024
@lobehubbot
Copy link
Member

👀 @silvonli

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@BrandonStudio
Copy link
Contributor

你这个报错可能是因为它要用OpenAI的3.5自动重命名,所以报的错。换句话说,这个报错和插件回复不显示没有关系

@lobehubbot
Copy link
Member

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


The error you reported may be because it needs to be automatically renamed using OpenAI 3.5, so the error is reported. In other words, this error report has nothing to do with the plug-in reply not being displayed.

@shog86
Copy link

shog86 commented Jun 15, 2024

你这个报错可能是因为它要用OpenAI的3.5自动重命名,所以报的错。换句话说,这个报错和插件回复不显示没有关系

在issue里搜Azure,已经陆续有好几位遇到Azure下插件用不了的情况了,希望能尽快修复,感谢

#2689

@lobehubbot
Copy link
Member

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


The error you reported may be because it needs to be automatically renamed using OpenAI 3.5, so the error is reported. In other words, this error has nothing to do with the plug-in reply not being displayed.

Searching Azure in the issue, several people have encountered the problem that the plug-in under Azure cannot be used. I hope it can be fixed as soon as possible. Thank you.

#2689

@lobehubbot
Copy link
Member

@silvonli

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

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 1.1.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 released
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants