ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
74.89k stars 58.96k forks source link

[Bug] 单独自定义azure模型的情况下无法生效 #5016

Open aiyurui opened 2 months ago

aiyurui commented 2 months ago

📦 Deployment Method

Docker

📌 Version

v2.13

💻 Operating System

Other Linux

📌 System Version

debian 11

🌐 Browser

Chrome

📌 Browser Version

126

🐛 Bug Description

最新版本docker compose部署,只配置了azure相关,openai相关全部注释

如果在默认模型中直接选择gpt-4o(azure),会走AZURE_URL且正常返回消息

但是如果yml中定义模型:- CUSTOM_MODELS=-all,+gpt-4o@azure

默认走会openai解析,导致返回失败

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] It cannot take effect when the azure model is customized separately

Sha1rholder commented 2 months ago

我遇到了相同的问题,在仅配置azure服务时完全无法使用

image

无论是配置自定义endpoint还是写access code都无效,希望大佬早日修复。Azure openai matters, thanks!

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


I had the same issue and it didn't work at all when only configuring the azure service

image

No matter configuring a custom endpoint or writing access code, it is invalid. I hope you can fix it as soon as possible. Azure openai matters, thanks!

miaoxiaohei666 commented 2 months ago

me too

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Now the entire nextchat azure is completely unavailable

lloydzhou commented 2 months ago

看了看几个相关的issue,都提到azure使用上的问题。

但是,我不管是使用环境变量配置,还是配置自定义接口,都正常使用。

所以,希望出现问题的朋友,能提供一些更加详细的配置(移除key等敏感信息)以及报错信息,以方便排查吗?

例如报错的时候,提供一下网络面板的截图,以及控制台的截图之类的。 image

如果大家只说一句“不可用”,又没有其他信息以便复现问题,那么,就找不到问题所在,修复也就无从谈起,对吧?

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


After looking at several related issues, they all mentioned problems with using Azure.

However, whether I use environment variable configuration or configure a custom interface, it works normally.

Therefore, I hope that friends who have problems can provide some more detailed configurations (removing sensitive information such as keys) and error messages to facilitate troubleshooting?

Sha1rholder commented 2 months ago

看了看几个相关的issue,都提到azure使用上的问题。

但是,我不管是使用环境变量配置,还是配置自定义接口,都正常使用。

所以,希望出现问题的朋友,能提供一些更加详细的配置(移除key等敏感信息)以及报错信息,以方便排查吗?

这里是我所有配置信息:

image
image
image

密码是临时写的不用担心泄露

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


After looking at several related issues, they all mentioned problems with using Azure.

However, whether I use environment variable configuration or configure a custom interface, it works normally.

So, I hope that friends who have problems can provide some more detailed configurations (removing sensitive information such as keys) and error messages to facilitate troubleshooting?

Here is all my configuration information:

image image image

The password is written temporarily, so you don’t have to worry about it being leaked.

lloydzhou commented 2 months ago

@Sha1rholder image 我应该找到问题了:

  1. gpt4o不是内置的模型名称,应该是 gpt-4o(你第二张截图显示的模型名称也应该是gpt-4o)所以你的配置应该写gpt-4o@azure=gpt4o
  2. 这里配置的模型名称错了,所以找不到模型列表,展示的模型选项是gpt4o(azure),如果正常匹配到模型名称,应该是gpt4o(Azure)其中Azure是大写。
  3. 如果想要添加不在内置模型列表中的模型,这个时候,配置CUSTOM_MODELS的时候@后面可以使用大写的供应商类型gpt-4o@Azure=gpt4o
Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


@Sha1rholder image I should have found the problem:

  1. gpt4o is not a built-in model name, it should be gpt-4o (the model name shown in your second screenshot should also be gpt-4o)
  2. The model name configured here is wrong, so the model list cannot be found. The model option displayed is gpt4o(azure). If the model name is matched normally, it should be gpt4o(Azure), where Azure is capitalized .
  3. If you want to add a model that is not in the built-in model list, at this time, when configuring CUSTOM_MODELS, you can use the uppercase supplier type gpt-4o@Azure=gpt4o after @
aiyurui commented 2 months ago

看了看几个相关的issue,都提到azure使用上的问题。

但是,我不管是使用环境变量配置,还是配置自定义接口,都正常使用。

所以,希望出现问题的朋友,能提供一些更加详细的配置(移除key等敏感信息)以及报错信息,以方便排查吗?

例如报错的时候,提供一下网络面板的截图,以及控制台的截图之类的。 image

如果大家只说一句“不可用”,又没有其他信息以便复现问题,那么,就找不到问题所在,修复也就无从谈起,对吧?

老师您好,我刚想把配置发出来,但是我重新测试了一下发现又没有问题了,昨天我无论如何测试,都会出现这个问题。抱歉:)

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


After looking at several related issues, they all mentioned problems with using Azure.

However, whether I use environment variable configuration or configure a custom interface, it works normally.

So, I hope that friends who have problems can provide some more detailed configurations (removing sensitive information such as keys) and error messages to facilitate troubleshooting?

For example, when reporting an error, provide screenshots of the network panel and console. ! [Image] (https://private- user-images.githubusercontent.com/1826685/34896118-284c63d6-3aca-94e4-5871c9bf5a03.jwt=eyjhbg CIOJIUZI1NIISINR5CCI6IKPXVCJ9.EYJPC3MIOJNAXRODWIUY29TIIWIYXVKI je3mjexmTi3nti3ntiM5izii6MTCYMTEXMJQ1NIWICGF0ACI6II8XODI2NJG1LZM 0odk2njexoc0zywnhltotrncxyzlizjvhmDMUC G5NP1GTQW16LUFSZ29YAXROBT1BV1M0LUHNQUMTU0HBMJLGTQW16lunyzwr LBNRPYWW9QUTJQVZDTFNKELMDCXNVZLWVHC3 Qtmsuyrnmzjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtznf9yzxf1zxn0JLGTQW16Lurhdgu9mjaynda3MTZMTZM2wizyluftei1fehbpczyluftei1CMDQXZJZM MJGWMTEZNJY4ZZZYWEWODK5YJEWNTVLZTG1MJJHMWMMJQ5555555MTKXZGIZNTE2OTK3NIZYLUZWRIZWFKZPHVC3QMYWN0B3JFAWQ 9mczrzxLFAWQ9MCZYZXBVX2LKPTAIFQ.87jbt075a0JD7NCYWGJICBGIG6KA_D_ZZAUJ0UMISC0))))))

If everyone just says "not available" and there is no other information to reproduce the problem, then the problem cannot be found and there is no way to fix it, right?

Hello teacher, I just wanted to send out the configuration, but I retested it and found that there was no problem again. No matter how I tested yesterday, this problem would appear. Feel sorry:)

lloydzhou commented 2 months ago

关于如何配置使用Azure的资源,大家可以仔细的看一下READMECUSTOM_MODELS部分关于Azure的说明:其实主要就是使用以前的display_name当作deploy_name使用。

也可以看这个issue中的说明 #5001 (里面列举了几种情况应该怎么配置。这个issue现在是置顶状态,应该挺好找的)

aiyurui commented 2 months ago

关于如何配置使用Azure的资源,大家可以仔细的看一下READMECUSTOM_MODELS部分关于Azure的说明:其实主要就是使用以前的display_name当作deploy_name使用。

也可以看这个issue中的说明 #5001 (里面列举了几种情况应该怎么配置。这个issue现在是置顶状态,应该挺好找的)

确定昨天按照置顶issue配置的,仔细核实复现了多次才提交了bug issue,但今天却无论如何都复现不了了,不知道是什么问题。。(我确定不是上面那位朋友模型名写错的原因)

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Regarding how to configure resources using Azure, you can take a closer look at CUSTOM_MODELS in [README](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web?tab=readme-ov-file#custom_models-optional)Part of the explanation about Azure: In fact, the main thing is to use the previous display_name as deploy_name.

You can also read the instructions in this issue #5001 (it lists how to configure it in several situations. This issue is now pinned, so it should be easy to find)

I made sure that I configured it according to the issued issue yesterday. I carefully verified that it recurred many times before submitting a bug issue. But today, it can't reoccur anyway. I don't know what the problem is. . (I’m sure it’s not because the friend above wrote the wrong model name)

yidasanqian commented 1 month ago

碰到同样问题,之前好好的,这几天都用不了 image

AZURE_URL=https://xx.openai.azure.com/openai/deployments/gpt-4o image

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I encountered the same problem. It worked fine before, but now it doesn’t work for the past few days. image

AZURE_URL=https://xx.openai.azure.com/openai/deployments/gpt-4o image

Sha1rholder commented 1 month ago

大佬,经过我多次修改环境变量和自定义配置后终于知道是哪里的问题了!也知道为什么您实验不出来这个问题了,您可能是直接在网页中的 Custom Endpoint 中修改,而有些用户直接在环境变量中修改。现在解决Azure不可用的问题需要修改两个东西,一个是 环境变量中只配置azure openai相关配置时,修改关于访问码 CODE 的bug,一个是 修改使用azure openai的文档,应该是 https://xxxx.azure.com/openai 而不是 https://xxxx.azure.com/openai/deployments,这两个修好后应该就可以把最近Azure的问题Close掉了。关于代码中需要改的,具体可以看下面两个示例:

  1. 只填写azure相关环境变量时,访问码不可用
    image
    网页配置
    image
    环境变量设置
    image
    image
    报错,但是图中可以看到我实际上都填好了access code

  2. Custom Endpoint后,跳过access code环节,就完全可用了
    image
    image
    如图

Azure文档还不是很清晰,如果大佬觉得ok的话我待会交个pr修改一下文档把azure使用方面讲详细点

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Boss, after I modified the environment variables and customized configuration many times, I finally figured out what the problem was! I also know why you can't find this problem in your experiment. You may modify it directly in the Custom Endpoint on the web page, while some users modify it directly in the environment variables. Now to solve the problem of Azure unavailability, two things need to be modified. One is to modify the bug about the access code CODE when only azure openai related configuration is configured in the environment variable, and the other is to modify the documentation for using azure openai. , it should be https://xxxx.azure.com/openai instead of https://xxxx.azure.com/openai/deployments**. After these two are repaired, you should be able to close the recent Azure issues. Lost. Regarding what needs to be changed in the code, you can see the following two examples:

  1. When only filling in Azure-related environment variables, the access code is not available. image Web page configuration image Environment variable settings image image An error is reported, but you can see in the picture that I actually filled in the access code.

  2. After Custom Endpoint, skip the access code link and it will be fully usable. image image As shown in the picture

The Azure documentation is not very clear yet. If you think it is ok, I will submit a PR later to modify the documentation and explain the use of Azure in more detail.

ElricLiu commented 1 month ago

@Sha1rholder 非常欢迎提交pr

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


@Sha1rholder is very welcome to submit PR

Sha1rholder commented 1 month ago

@Sha1rholder 非常欢迎提交pr

已经提交pr#5049了,这个pr只对原本就有的中英文文档进行了一些小幅的修改,希望麻烦主要贡献者审核通过。不过在仔细阅读README的时候我觉得写得实在不是很清晰,不是这点改动就能改好的。现在一方面需要作者大大修改仅使用Azure OpenAI时的empty access code的bug,一方面我想写个azure openai的教程,和vercel教程放同个地方,一方面我觉得README确实需要重构一下

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


@Sha1rholder is very welcome to submit PR

pr#5049 has been submitted. This PR only made some minor modifications to the original Chinese and English documents. I hope it will be troublesome. Approved by major contributors. However, when I read the README carefully, I feel that the writing is not very clear, and it cannot be improved by this change. Now on the one hand, the author needs to greatly modify the bug of empty access code when only using Azure OpenAI. On the other hand, I want to write an azure openai tutorial, and [vercel tutorial](https://github.com/ChatGPTNextWeb/ChatGPT- Next-Web/blob/main/docs/vercel-cn.md) in the same place. On the one hand, I think the README really needs to be restructured.

ElricLiu commented 1 month ago

@Sha1rholder 非常欢迎提交pr

已经提交pr#5049了,这个pr只对原本就有的中英文文档进行了一些小幅的修改,希望麻烦主要贡献者审核通过。不过在仔细阅读README的时候我觉得写得实在不是很清晰,不是这点改动就能改好的。现在一方面需要作者大大修改仅使用Azure OpenAI时的empty access code的bug,一方面我想写个azure openai的教程,和vercel教程放同个地方,一方面我觉得README确实需要重构一下

非常感谢,我们会在稍后bug 修复完毕后,来进行处理合并

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


@Sha1rholder is very welcome to submit PR

pr#5049 has been submitted. This PR only made some minor modifications to the original Chinese and English documents. I hope Please trouble the main contributors to approve it. However, when I read the README carefully, I feel that the writing is not very clear, and it cannot be improved by this change. Now on the one hand, the author needs to greatly modify the bug of empty access code when only using Azure OpenAI. On the other hand, I want to write an azure openai tutorial, and [vercel tutorial](https://github.com/ChatGPTNextWeb/ChatGPT- Next-Web/blob/main/docs/vercel-cn.md) in the same place. On the one hand, I think the README really needs to be restructured.

Thank you very much. We will merge it later after the bug is fixed.