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

Make sure the streamed response isn't repeating tools unnecessarily

Open pamelafox opened this issue 2 years ago • 1 comments

I believe the app.py in this repo is based off the sample-app app.py. In that case, I believe it has a performance bug due to this line:

https://github.com/Azure-Samples/azure-search-openai-solution-accelerator/blob/db254e0316d0c9031158bb70a0531159b4d111af/app.py#L139

If you check in the browser when it's streaming, you'll see that the "tools" gets repeated in every chunk streamed, which requires a lot of bandwidth and is unnecessary. You should only need to stream the tools once, and the frontend can process it when it sees it.

pamelafox avatar Oct 16 '23 19:10 pamelafox

Thank you so much, @pamelafox we'll plan for the correction accordingly.

gmndrg avatar Oct 19 '23 04:10 gmndrg

Hello @pamelafox , it seems this branch is having very old code. If you see in the main branch of this repo which contains the latest code, over there we do not have such file called app.py. Instead we are using create_app.py which do not have any logic/condition for checking tools in every chunk streamed. Hence "tools" are not getting repeated in every chunk streamed in existing functionality. So can you please check once and let us know whether we can close this issue.

Prasanjeet-Microsoft avatar Jun 17 '24 07:06 Prasanjeet-Microsoft

Okay, feel free to close if the chunks are good now, I don't have the time to inspect the output myself. Thanks!

pamelafox avatar Jun 17 '24 16:06 pamelafox

As discussed, I am closing this issue.

Prasanjeet-Microsoft avatar Jun 18 '24 09:06 Prasanjeet-Microsoft