lobe-chat icon indicating copy to clipboard operation
lobe-chat copied to clipboard

[Bug] Azure OpenAI 无法使用

Open securitgithub opened this issue 1 year ago • 21 comments

💻 系统环境

Rocky Linux release 9.1 (Blue Onyx)

📦 部署环境

Docker

🌐 浏览器

Chrome

🐛 问题描述

更新版本后, Azure OpenAI 无法使用,请问具体如何设置。https://chat-docs.lobehub.com/zh/self-hosting/examples/azure-openai 按照链接设置之前版本可以,现在不行了,截图里面的设置也没有了。

部署方式

安装此文档进行部署:https://chat-docs.lobehub.com/zh/self-hosting/platform/docker-compose

securitgithub avatar Apr 11 '24 03:04 securitgithub

👀 @securitgithub

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

lobehubbot avatar Apr 11 '24 03:04 lobehubbot

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


💻 System environment

Other Linux

📦 Deployment environment

Docker

🌐 Browser

Chrome

🐛 Problem description

After updating the version, Azure OpenAI cannot be used. Please tell me how to set it up. https://chat-docs.lobehub.com/zh/self-hosting/examples/azure-openai You can set the previous version according to the link, but it doesn’t work now, and the settings in the screenshot are gone.

🚦 Expected results

No response

📷 Steps to reproduce

No response

📝 Supplementary information

No response

lobehubbot avatar Apr 11 '24 03:04 lobehubbot

你是配置的环境变量,还是在界面上填 api key 的?

arvinxx avatar Apr 11 '24 03:04 arvinxx

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


Did you configure environment variables or fill in the api key on the interface?

lobehubbot avatar Apr 11 '24 03:04 lobehubbot

1712807089086 1712807188466 1712807395716

securitgithub avatar Apr 11 '24 03:04 securitgithub

你是配置的环境变量,还是在界面上填 api key 的?

dokcer 配置文件

securitgithub avatar Apr 11 '24 03:04 securitgithub

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


Did you configure environment variables or fill in the api key on the interface?

dokcer configuration file

lobehubbot avatar Apr 11 '24 03:04 lobehubbot

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

Did you configure environment variables or fill in the api key on the interface?

dokcer configuration file

之前都是正常的,跟配置文件应该没多大关系,curl测试也正常。

securitgithub avatar Apr 11 '24 03:04 securitgithub

1712808712444 next chat上没问题。

securitgithub avatar Apr 11 '24 04:04 securitgithub

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


1712808712444

lobehubbot avatar Apr 11 '24 04:04 lobehubbot

0.147.0 版本由于拆开来了 Azure 和 OpenAI 的配置,因此有些环境变量已经变了。针对 Azure OpenAI 的配置,需要从 OPENAI_PROXY_URL 改为 AZURE_ENDPOINT

arvinxx avatar Apr 11 '24 04:04 arvinxx

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


Version 0.147.0 has separated the configurations of Azure and OpenAI, so some environment variables have changed. For configuration of Azure OpenAI, you need to change from OPENAI_PROXY_URL to AZURE_ENDPOINT.

lobehubbot avatar Apr 11 '24 04:04 lobehubbot

AZURE_ENDPOINT

这里怎么选择,选择不了Azure OpenAi模型。 1712810073749 1712810106338 按道理前端不需要在设置了

securitgithub avatar Apr 11 '24 04:04 securitgithub

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


AZURE_ENDPOINT

How to choose here? 1712810073749 1712810106338

lobehubbot avatar Apr 11 '24 04:04 lobehubbot

@securitgithub 更新下最新的镜像,我理解应该和 #1958 这个是同一个问题

arvinxx avatar Apr 11 '24 05:04 arvinxx

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


@securitgithub updated the latest image, I understand it should be the same problem as #1958

lobehubbot avatar Apr 11 '24 05:04 lobehubbot

更新下最新的镜像,我理解应该和 #1958 这个是同一个问题

@arvinxx 开发者您好,我更新了最新的镜像,Azure处的模型依然默认为空。

是不是因为 src/app/api/config/route.ts 的 config 的 languageModel 没有设置azure模型的原因?

fooooxxxx avatar Apr 11 '24 05:04 fooooxxxx

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


@securitgithub Update to the latest image, I understand it should be the same problem as #1958

Hello developers, I updated the latest image, and the Azure model is still empty by default.

Is it because the languageModel of the config in src/app/api/config/route.ts does not set the azure model?

lobehubbot avatar Apr 11 '24 05:04 lobehubbot

@fooooxxxx 需要你自己在设置里添加 azure 模型了,因为之前实现的局限性,要求 id 和 deployment 同名,但是会有很多用户提 id 和部署名不一样的问题:

  • #1952
  • #1056

所以现在在这一版里支持了 id 和 deploymentName 分开设置。

arvinxx avatar Apr 11 '24 05:04 arvinxx

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


@fooooxxxx You need to add the azure model in the settings yourself. Because of the limitations of the previous implementation, the id and deployment name are required to have the same name. However, many users will raise the issue that the id and deployment name are different:

  • #1952
  • #1056

So now in this version, separate setting of id and deploymentName is supported.

lobehubbot avatar Apr 11 '24 05:04 lobehubbot

在最新的版本中 https://github.com/lobehub/lobe-chat/releases/tag/v0.147.6 Azure 仍然无法使用,在 Docker 环境变量中已经设置,但是仍然显示未开启 Azure 服务。

image

missuo avatar Apr 11 '24 19:04 missuo

@missuo 哦,我傻了,这块忘记改了,一会修下

arvinxx avatar Apr 12 '24 02:04 arvinxx

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


@missuo Oh, I was stupid. I forgot to change this. I will fix it later.

lobehubbot avatar Apr 12 '24 02:04 lobehubbot

✅ @securitgithub

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

lobehubbot avatar Apr 12 '24 08:04 lobehubbot

:tada: This issue has been resolved in version 0.147.8 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

lobehubbot avatar Apr 12 '24 08:04 lobehubbot