chat-with-your-data-solution-accelerator
chat-with-your-data-solution-accelerator copied to clipboard
text embedding URL construction needs more validation
Please provide us with the following information:
This issue is for a: (mark with an x
)
- [ ] bug report -> please search issues before submitting
- [X] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
- deploy using "Deploy to Azure" button
- Set azureOpenAIResource: https://charris-openai4.openai.azure.com/
- Set azureOpenAIEmbeddingModel: text-embedding-ada-002
- Visit the Ingest_Data page
- Paste in a URL and press the button to process
Receive the following error:
Error communicating with OpenAI: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //charris-openai4.openai.azure.com/.openai.azure.com//openai/deployments/text-embedding-ada-002/embeddings?api-version=2023-07-01-preview (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x73dd80a32740>: Failed to resolve 'https' ([Errno -2] Name or service not known)")
It looks like I provided the wrong value for azureOpenAIResource, but the instructions were not clear and there was nothing that caught the misconfiguration.
Any log messages given by the failure
Expected/desired behavior
page is processed without error. but, if there is a configuration error, I would like to be able to correct it on the
Configuration
page
OS and Version?
Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Versions
Mention any other details that might be useful
Thanks! We'll be in touch soon.
I've been continuing to work on this and realized that the AZURE_OPENAI_RESOURCE env var is set for both the Function and the Admin website. I was changing it on the admin website and was still getting the same error until I noticed something that mentioned "Function" so I updated the env var for the function app. This allowed my URL to be processed, but the instructions and validation of the template parameters could use some improvement.
Closing this issue as when using 'Deploy to Azure' button, OpenAI resource name is now picked up as [format('openai-{0}', parameters('resourceToken'))]
in the bicep file.
When running locally, hardcoding the name is not required any more. Using azd up
, the .env
gets automatically updated.