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

修复适配azure的问题 #787

Merged
merged 1 commit into from
Apr 9, 2023

Conversation

kayaklee
Copy link

@kayaklee kayaklee commented Apr 9, 2023

resole exception: "The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again."

@lanvent
Copy link
Collaborator

lanvent commented Apr 9, 2023

感谢PR,我不能在azure上测试,看到代码里azure openai service的API调用参数跟之前代码的调用方式有区别,Azure最近修改了api调用方式吗?

以及,config-template.json 是不用更改的。因为它只是作为用户使用openai api的配置参考。

@kayaklee
Copy link
Author

kayaklee commented Apr 9, 2023

是的,原代码中适配Azure的参数有问题,必须要传入deployment_id,否则会抛异常”The API deployment for this resource does not exist“,这个deployment_id是在azure管理控制台上deploy模型时自己指定的名字。

config-template.json我重新commit一下。

@lanvent lanvent merged commit fceabb8 into zhayujie:master Apr 9, 2023
@lanvent
Copy link
Collaborator

lanvent commented Apr 9, 2023

好的已合并,谢谢PR!

@zhuyaguang
Copy link

{
"open_ai_api_key": "a*************60414",
"model": "patent",
"single_chat_prefix": ["bot", "@bot"],
"single_chat_reply_prefix": "[bot] ",
"group_chat_prefix": ["@bot"],
"group_name_white_list": ["ALL_GROUP"],
"group_chat_in_one_session": ["ChatGPT测试群"],
"image_create_prefix": ["画", "看", "找"],
"conversation_max_tokens": 1000,
"speech_recognition": false,
"group_speech_recognition": false,
"use_azure_chatgpt": true,
"character_desc": "你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。",
"open_ai_api_base": "https://*****.openai.azure.com/"
}
@kayaklee 大佬请教下 我参数填的有问题吗,open_ai_api_key 填azure上的key model 填模型名称 open_ai_api_base 填endpoint

但是 报下面这个错误

[WARNING][2023-04-12 14:40:14][chat_gpt_bot.py:134] - [CHATGPT] Exception: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>

@teojs
Copy link

teojs commented Jun 5, 2023

@zhuyaguang 请问这个问题解决了吗,我也是遇到了同样的问题
[WARNING][2023-04-12 14:40:14][chat_gpt_bot.py:134] - [CHATGPT] Exception: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>

@Zhaoyi-Yan
Copy link
Contributor

@lanvent 请问这个问题怎么解决呢?我也遇到了这个问题 [WARNING][2023-04-12 14:40:14][chat_gpt_bot.py:134] - [CHATGPT] Exception: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>

@lanvent
Copy link
Collaborator

lanvent commented Jun 6, 2023

需要填写 azure_deployment_id 配置项

@teojs
Copy link

teojs commented Jun 6, 2023

需要填写 azure_deployment_id 配置项

是的,填了azure_deployment_id之后可以用了,但是发现tool用不了,最后选择cloudflare转换azure接口

@bentennysonyoung
Copy link

确实,用Azure Openai的API,会导致tool无法使用,请帮忙看下,如何修改插件的config.json?
@goldfishh

@JackieHeCc
Copy link

我配置的Azure Openai服务可以使用。
"open_ai_api_key": "Azure api key",
"model": "gpt-3.5-turbo", #即便你申请了4,这里model还是用3.5-turbo,如果用gpt-4会报错

"use_azure_chatgpt": true,
"open_ai_api_base": "https://xxx.openai.azure.com/",
"azure_deployment_id": "xxx", #自定义的那个部署模型名字,这个一定要填正确,可以在Azure后台查看,注意是deployment id即是接口模型的部署不是你项目的部署名,别搞混了
"azure_api_version": "2023-07-01-preview",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants