garrytrinder/msteams-azure-search-openai-demo

Bot not responding

Closed this issue · 20 comments

image
So, I tried two different repo yours and the forked one by tawfek both gave me different results

Your repo,

  • When ran both locally and from dev environment I saw no welcome card and when I send a message no response of error or anything in chat window or in terminal

tawfek repo

  • When ran both locally and from dev environment I did saw a welcome card and did get a response though in error but when I google this error didn't find any solutions there.

Apologies for the delay. This is mostly likely caused by a response returned from the API that the bot code cannot transform. Have you made any changes to the API?

No, I have not in the console I saw the Error 500 response.

Are you able to share more information about the request being made?

The error in your screenshot looks like the error is being thrown by the getCitations function.

https://github.dev/garrytrinder/msteams-azure-search-openai-demo/blob/c6d36e035eb420bd88a321d172a4c018b1ccc905/app/shared/helpers.ts#L82

So I console.log('Answer:',answer) and it's returning undefined

Response: _Response [Response] { [Symbol(realm)]: null, [Symbol(state)]: { aborted: false, rangeRequested: false, timingAllowPassed: true, requestIncludesCredentials: true, type: 'default', status: 500, timingInfo: { startTime: 50312.802999999374, redirectStartTime: 0, redirectEndTime: 0, postRedirectStartTime: 50312.802999999374, finalServiceWorkerStartTime: 0, finalNetworkResponseStartTime: 0, finalNetworkRequestStartTime: 0, endTime: 0, encodedBodySize: 23, decodedBodySize: 23, finalConnectionTimingInfo: null }, cacheState: '', statusText: 'Internal Server Error', headersList: _HeadersList { cookies: null, [Symbol(headers map)]: [Map], [Symbol(headers map sorted)]: null }, urlList: [ [URL] ], body: { stream: undefined } }, [Symbol(headers)]: _HeadersList { cookies: null, [Symbol(headers map)]: Map(4) { 'content-length' => [Object], 'content-type' => [Object], 'date' => [Object], 'server' => [Object] }, [Symbol(headers map sorted)]: null } }
and this is the log of response when getChatResponse function in helper.tsx

Thanks, can you confirm that the front end web app is working correctly?

The getChatResponse function is making the same call to the backend API that the web app does, which seems to be returning an Internal Server Error.

yeah, the frontend web app is live at the moment already in use.
image

I just re-deployed the frontend and backend from the latest source and noticed that the payload sent in the request is now different to what is being sent from the bot, it's possible that the API has been updated which is causing this issue.

If you inspect the request sent to the API when you submit a message in the chat using Dev Tools, do you see similar to the below?

image

I'll need to take a further look into this.

image
Yup it looks similar to this. Would really appreciate that.

As thought, the API has certainly changed, the request and response payloads are very different.

I've made some progress this morning and have the request and response working in a local branch.

image

I'm going to spend some time on the card logic tomorrow, so that the citations and references are represented similar to the way the web app displays the inline references and to remove the duplicate Citations.

I'll keep you updated on my progress.

Here are the new inline references and removed duplicates.

image

The code is a bit rough so needs some tidying up so I'll do that tomorrow.

No problem, thanks mate what you're doing is greatly appreciated.

I've just pushed the updates to the repo.

@UsamaMoinJavid are you able to pull down the latest changes and confirm that all is now working OK?

Yes, it seems to be working fine now but the API call takes time except that everything is working as it should thanks for the update, I was seeing the changes you made it was close to creating a new project. Thanks

Thanks for confirming @UsamaMoinJavid 👍

Please do raise an issue if you run into any problems or have any feedback.

@garrytrinder it seem that we have encountered the same issue as Moin Uddin, when we run the app locally it works fine this based on the previous code (https://github.com/Azure-Samples/azure-search-openai-demo). when the app is provisoned and deployed to the team store and published and run, none of the cards are loading and the bot is not responding. i have attaached the logs from the bot below

HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Most likely causes:

  • The directory or file specified does not exist on the Web server.
  • your help in undersatnding the problem will be much appriciated. what is conerning is the bot feel like it does not contain any app refrences .

Bot not working when deployed to Azure Services

@garrytrinder I have got the deployment working with no auth, while building the app we have noticed the node compiled lib is addressing to server.js . once we have changed the rules in the web.config the published teams app was communicating to the bot services then forwarding to the frontend of the web app .

i will raise a pr for your review

Thanks for the comments @M0inUddin @pvejayan I'll take a look later today.

Thanks for investigating @pvejayan ❤️

The web.config files was referencing index.js when it should have been server.js.

I've just merged a PR with a fix.

Thanks again, appreciate you trying out this sample.