azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

Error:TypeError: Cannot read properties of undefined (reading '0')

Open namratam30 opened this issue 2 years ago • 4 comments

Please provide us with the following information:

I am getting this error while running the code using existing infrastructure- TypeError: Cannot read properties of undefined (reading '0')

After investigation i found that it is giving issue on api.ts call. Please find below screen shot. image

image

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

azd version?

run azd version and copy paste here.

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

namratam30 avatar Nov 01 '23 10:11 namratam30

Did you also check it by running it locally? if you did can you share default-docker.log file

M0inUddin avatar Nov 01 '23 12:11 M0inUddin

Seems it is releted to the part- Enabling CORS for an alternate frontend By default, the deployed Azure web app will only allow requests from the same origin. To enable CORS for a frontend hosted on a different origin, run:

Run azd env set ALLOWED_ORIGIN https://<your-domain.com> Run azd up For the frontend code, change BACKEND_URI in api.ts to point at the deployed backend URL, so that all fetch requests will be sent to the deployed backend.

Can you please tell me how to give backend uri in api.ts

namratam30 avatar Nov 02 '23 08:11 namratam30

@pamelafox Could you please explain us how to use existing open ai for the backend.I want used existing open ai which is in different group- OPENAI_API_TYPE = "azure" OPENAI_API_VERSION = "2023-07-01-preview" OPENAI_API_KEY = "xxxxxx" OPENAI_API_BASE = " https://openaxxxx.openai.azure.com/" DEPLOYMENT_NAME = "gpt-4-32k" # 60K TPM

namratam30 avatar Nov 14 '23 06:11 namratam30

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.

github-actions[bot] avatar Jan 23 '24 01:01 github-actions[bot]