Closed magedhelmy1 closed 1 year ago
Currently, you can use a custom api endpoint in the api settings. Is the Azure endpoint not working as a custom endpoint?
Currently, you can use a custom api endpoint in the api settings. Is the Azure endpoint not working as a custom endpoint?
It seems that Azure's API specification requires sending the key with "api-key: TOKEN" in the header instead of "Authorization: Bearer TOKEN". Therefore, even if you set up the Azure endpoint, it will result in a 401 unauthorized error.
~In addition, here is an example - we need to include the engine parameters:~
We will add support for the api-key: TOKEN
in the headers for azure endpoints. I believe that the engine
parameter is for the python usage method. In the REST method, there is no engine parameter.
Hi, thanks for adding that! I see that the following in your code is being executed when I set the custom API to Azure:
export const isAzureEndpoint = (endpoint: string) => {
return endpoint.includes('openai.azure.com');
};
However I still get the following Error
api.ts:48 POST https://researchproject.openai.azure.com/ 404
getChatCompletionStream @ api.ts:48
handleSubmit @ useSubmit.ts:91
handleSaveAndSubmit @ MessageContent.tsx:409
callCallback2 @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
(anonymous) @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26140
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430
useSubmit.ts:175 Message from Better ChatGPT:
Invalid API endpoint! We recommend you to check your free API endpoint.
I am sure that the API Key and Endpoint is correct on my end.
I think the issue is specifically in the Rest code below and it is in the example of the Rest on the website
curl $OPENAI_API_BASE/openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-03-15-preview \ -H "Content-Type: application/json" \ -H "api-key: $OPENAI_API_KEY" \ -d '{"messages":[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Does Azure OpenAI support customer managed keys?"},{"role": "assistant", "content": "Yes, customer managed keys are supported by Azure OpenAI."},{"role": "user", "content": "Do other Azure Cognitive Services support this too?"}]}'
I should be able to insert the gpt-35-turbo
and api-version=2023-03-15-preview
from the frontend of BetterGPT.
The gpt-35-turbo
is the deployment name and that is different for different users and similarly with the api-version, that is different.
On the BetterChatGPT frontend these fields can be added for Azure?
Thanks again.
You can try adding the entire thing $OPENAI_API_BASE/openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-03-15-preview
to the custom endpoint, instead of just https://researchproject.openai.azure.com/
.
We will add support for the
api-key: TOKEN
in the headers for azure endpoints. I believe that theengine
parameter is for the python usage method. In the REST method, there is no engine parameter.
Thank you for your work. I have confirmed that it works without any issues using the Azure OpenAI Service endpoint.
keep show error when use $OPENAI_API_BASE/openai/deployments/GPT4/chat/completions?api-version=2023-06-01-preview
It is working for my own python script with this api url
没有到密码验证, 似乎直接判断格式不对, mac 客户端
看code似乎是因为 model name 写死了..., azure api的deployments_id 不是确定的.
我们GPT4只能部署一个model, 我没办法改名字了
Please add support to support OpenAI endpoints from Azure.
Thank you