dotneet / smart-chatbot-ui

An open source ChatGPT UI.
https://smart-chatbot-ui.vercel.app/
MIT License
471 stars 97 forks source link

Azure OpenAI, can't make it work, error 401 #169

Open stevenbaert opened 11 months ago

stevenbaert commented 11 months ago

Hi,

I can make OpenAI work, but not Azure OpenAI. I got error below. It seems as if it's using Open AI whereas I want it to use Azure OpenAI.

I'm sure environment variables are correct because I use them in other Github Projects, these are my variables:

OPENAI_API_TYPE=azure AZURE_OPENAI_KEY=1234456 OPENAI_API_HOST=https://myinstance.openai.azure.com AZURE_DEPLOYMENT_ID_EMBEDDINGS=text-embedding-ada-002 OPENAI_API_VERSION=2023-03-15-preview

The error OpenAIError: Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource. at OpenAIStream (webpack-internal:///(api)/./utils/server/index.ts:84:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async handler (webpack-internal:///(api)/./pages/api/chat.ts:74:24) { type: undefined, param: undefined, code: '401'

Thanks for your input!