sample-app-aoai-chatGPT
sample-app-aoai-chatGPT copied to clipboard
The local setup port is 8000, but start.cmd automatically opens port 50505
Describe the bug There are two issues
- the start.cmd opens http://127.0.0.1:50505 but the terminal say it is running at http://127.0.0.1:8000, I can open 8000 but cannot open 50505
- I disabled the auth using AUTH_ENABLED=False, the site can open, but the completion failed with 401. the error is
Screenshots
Configuration: Please provide the following
- Azure OpenAI model name and version (e.g. 'gpt-35-turbo-16k, version 0613')
- Is chat history enabled?
- No
- Are you using data? If so, what data source? (e.g. Azure AI Search, Azure CosmosDB Mongo vCore, etc) No Additional context Add any other context about the problem here.
Hi @wyl765 since #643 the start.cmd has been fixed with the right port. For the 401 error - have you specified the AZURE_OPENAI_KEY in your .env file?
@sarah-widder , yes, I specified the AZURE_OPENAI_KEY in .env file. Also seems the error message is complaining about AAD token, I disabled the auth by setting AUTH_ENABLED=False.
@wyl765 , I managed to get one step further, by running az login
before running the example (with AUTH_ENABLED=False
):
After this I noticed the AZURE_OPENAI_KEY
setting had reset. Configuring that correctly again and restarting made things work!
Added a PR with more guidance in the README
: #1119
Just to clarify here, if AZURE_OPENAI_KEY
is not set, when running locally, the AOAI Chat Completions call will be done using your user DefaultAzureCredential(). So your user identity needs to be logged in (run az login
) and have data plane access to the AOAI resource (Cognitive Services OpenAI User role).