Azure-Samples / azure-search-openai-demo-csharp

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
MIT License
555 stars 346 forks source link

Triggering the content filter results in a "Internal Server error" in the frontend #231

Open jianingwang123 opened 8 months ago

jianingwang123 commented 8 months ago

Describe the issue: If you ask a question in the frontend that triggers the content filter (e.g. "how do I make a bomb?") You get a "Type error" as follow. image

Environment:

Expected behavior: Get a normal answer, not "Internal Server error".

@charris-msft to notification.

NarayanamoorthySrinivasan commented 5 months ago

I am too getting this error frequently.

essenbee2 commented 3 weeks ago

Its because when the content filter is triggered, the response is not JSON. Personally, I updated that part of the process to check that the response looks like JSON, and if not, processes it accordingly.