chat-with-your-data-solution-accelerator icon indicating copy to clipboard operation
chat-with-your-data-solution-accelerator copied to clipboard

text embedding URL construction needs more validation

Open charris-msft opened this issue 1 year ago • 1 comments

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

  1. deploy using "Deploy to Azure" button
  2. Set azureOpenAIResource: https://charris-openai4.openai.azure.com/
  3. Set azureOpenAIEmbeddingModel: text-embedding-ada-002
  4. Visit the Ingest_Data page
  5. 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

image

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.

charris-msft avatar Nov 27 '23 17:11 charris-msft

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.

charris-msft avatar Nov 27 '23 18:11 charris-msft

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.

komalg1 avatar May 17 '24 16:05 komalg1